]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Neaten up a clause in final_link_relocate
authorMatthew Malcomson <matthew.malcomson@arm.com>
Fri, 1 Jul 2022 10:48:57 +0000 (11:48 +0100)
committerMatthew Malcomson <matthew.malcomson@arm.com>
Fri, 1 Jul 2022 10:48:57 +0000 (11:48 +0100)
commitf0a8e7c6fed06ec1d952cd4b47528a0cc3171b26
treefa283a7cf1187a984af066dbc149f49b6ac4b4da
parentd465be7beffaafa7e09fc262a8ecf1e2d399b25d
Neaten up a clause in final_link_relocate

Originally this clause included lines checking `!bfd_link_pic &&
bfd_link_executable`.  I left these in to ensure that the new Morello
part to the clause did not interfere with the original stock AArch64
part of the clause.

Now we have split the condition into multiple if statements for clarity,
we can remove the confusing parts of the clause.  This clause is to
catch any symbols that go in the GOT but would not be otherwise given a
relocation by finish_dynamic_symbol.  We can express that check better
with a modified condition.

What we want to do in this clause is to account for all GOT entries
which would not get a dynamic relocation otherwise, but need a RELATIVE
dynamic relocation for Morello.  This is any symbol for which
c64_should_not_relocate is false and WILL_CALL_FINISH_DYNAMIC_SYMBOL is
false.  Changing the clause to only mention these two predicates (plus
ensuring that we do not mess around with such relocations when creating
a relocatable object file rather than a final binary) explains the
purpose of this condition much better.

N.b. see the commit message of 8f5baae3d15 for the reasoning for the
original decision to not change the conditional.
bfd/elfnn-aarch64.c