]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Account for LSB on DT_INIT/DT_FINI entries
authorMatthew Malcomson <matthew.malcomson@arm.com>
Thu, 28 Apr 2022 08:50:29 +0000 (09:50 +0100)
committerMatthew Malcomson <matthew.malcomson@arm.com>
Thu, 28 Apr 2022 08:52:42 +0000 (09:52 +0100)
commitb2cb8a193229c81cd4a1248e011351cb8ecc6ea8
tree80d9075eb580d0e38b81c4fe08537ccb78cee077
parent808c324b6d4ac59d8cf9f71776a788c8cfa3e131
Account for LSB on DT_INIT/DT_FINI entries

When DT_INIT and/or DT_FINI point to C64 functions they should have
their LSB set.  I.e. these entries should contain the address of the
relevant functions and not a slight variation on them.

This is already done by Morello clang, and we want GNU ld updated to
match.

Here we account for these LSB's for Morello in the same way as the Arm
backend accounts for the Thumb LSB.  This is done in the
finish_dynamic_sections hook by checking the two dynamic section
entries, looking up the relevant functions, and adding that LSB onto the
entry value.

In our testcase we simply check that the INIT and FINI section entries
have the same address as the _init and _fini symbols.
bfd/elfnn-aarch64.c
ld/testsuite/ld-aarch64/aarch64-elf.exp
ld/testsuite/ld-aarch64/morello-dt-init-fini.d [new file with mode: 0644]
ld/testsuite/ld-aarch64/morello-dt-init-fini.s [new file with mode: 0644]