]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Use global GOT type to determine GOT action
authorMatthew Malcomson <matthew.malcomson@arm.com>
Fri, 1 Jul 2022 10:48:56 +0000 (11:48 +0100)
committerMatthew Malcomson <matthew.malcomson@arm.com>
Fri, 1 Jul 2022 10:48:56 +0000 (11:48 +0100)
commitd465be7beffaafa7e09fc262a8ecf1e2d399b25d
tree370c3ade6530433fd41b6c726b791d438e8d4af8
parent604a5d22c9095bf644b9ab4c67058db83d29a9f4
Use global GOT type to determine GOT action

morello-binutils: Use global GOT type to determine GOT action

In final_link_relocate we currently use whether the relocation we're
looking at is a Morello relocation to decide whether we should treat the
GOT entry as a Morello GOT entry or not.

This is problematic since we can have an AArch64 relocation against a
capability GOT entry (even if it isn't a very useful thing to have).

The current patch decides whether we need to emit a MORELLO RELATIVE
relocation in the GOT based on whether the GOT as a whole contains
capabilities rather than based on whether the first relocation against
this GOT is a Morello relocation.

Until now we did not see any problem from this.  Here we add a testcase
that triggers the problem.
bfd/elfnn-aarch64.c
ld/testsuite/ld-aarch64/aarch64-elf.exp
ld/testsuite/ld-aarch64/emit-relocs-morello-10.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/emit-relocs-morello-10.s [new file with mode: 0644]