]> 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)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 1 Sep 2022 23:11:55 +0000 (16:11 -0700)
commit6497edeafcf4c296b7ab393bc50dfb4476124b77
tree564b17290d5b60c9a6539cabebe3eb357b848786
parentbe3aa1f3c9eb947a079b670c4841efddbc740808
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]