aarch64: Return an error on conditional branch to an undefined symbol
authorSiddhesh Poyarekar <siddesh.poyarekar@arm.com>
Tue, 1 Sep 2020 08:55:52 +0000 (14:25 +0530)
committerSiddhesh Poyarekar <siddhesh@gotplt.org>
Thu, 10 Sep 2020 16:12:37 +0000 (21:42 +0530)
commitc7cd291722779c9d4703ed0010388fe394c644c8
tree23053bc30ff3bc5f846937c4588493635f3d14c1
parent93d49941edbb5274bee6ce3e547a07c7ce4c4301
aarch64: Return an error on conditional branch to an undefined symbol

The fix in 7e05773767820b441b23a16628b55c98cb1aef46 introduced a PLT
for conditional jumps when the target symbol is undefined.  This is
incorrect because conditional branch relocations are not allowed to
clobber IP0/IP1 and hence, should not result in a dynamic relocation.

Revert that change and in its place, issue an error when the target
symbol is undefined.

bfd/

2020-09-10  Siddhesh Poyarekar  <siddesh.poyarekar@arm.com>

* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Revert
changes in 7e05773767820b441b23a16628b55c98cb1aef46.  Set
error for undefined symbol in BFD_RELOC_AARCH64_BRANCH19 and
BFD_RELOC_AARCH64_TSTBR14 relocations.

ld/

2020-09-10  Siddhesh Poyarekar  <siddesh.poyarekar@arm.com>

* testsuite/ld-aarch64/emit-relocs-560.d: Expect error instead
of valid output.
bfd/ChangeLog
bfd/elfnn-aarch64.c
ld/ChangeLog
ld/testsuite/ld-aarch64/emit-relocs-560.d