aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Longo <matthieu.longo@arm.com>2024-11-14 17:35:24 +0000
committerMatthieu Longo <matthieu.longo@arm.com>2024-12-02 15:18:40 +0000
commit2ad1fffee5f0eb055d7919dd1098107fa131501d (patch)
tree41f4101165625870f5ca250c4543d1ac9f95030f
parent827a2b93fe9551dbe788d838e6c6562bfe98920a (diff)
downloadfsf-binutils-gdb-2ad1fffee5f0eb055d7919dd1098107fa131501d.zip
fsf-binutils-gdb-2ad1fffee5f0eb055d7919dd1098107fa131501d.tar.gz
fsf-binutils-gdb-2ad1fffee5f0eb055d7919dd1098107fa131501d.tar.bz2
aarch64: remove early exit when setting up GNU properties with partial linking
There is an early exit in _bfd_aarch64_elf_link_setup_gnu_properties that is enabled when the output link unit is relocatable, i.e. ld generates an output file that can in turn serve as input to ld. (see ld manual, -r,--relocatable for more details). At this stage, the GNU properties have already been merged and errors or warnings (if any) have already been issued. However, OUTPROP has not been updated yet. Not updating OUTPROP means that implicits enablement of BTI PLTs via the GNU properties will be ignored for final links. Indeed, the enablement of BTI PLTs is checked inside _bfd_aarch64_add_call_stub_entries by looking up at gnu_property_aarch64_feature_1_and (OUTPROP). Since the final link does not happen in the case of partial linking, the behaviour with or without the early exit should be the same. Given that there is currently no comment for explain why the exit is there, and that there might in the future be cases were these properties affect relocatable links, it is preferrable to drop the early exit.
-rw-r--r--bfd/elfxx-aarch64.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c
index 406b2fa..896497a 100644
--- a/bfd/elfxx-aarch64.c
+++ b/bfd/elfxx-aarch64.c
@@ -797,9 +797,6 @@ _bfd_aarch64_elf_link_setup_gnu_properties (struct bfd_link_info *info)
GNU properties (if found). */
bfd *pbfd = _bfd_elf_link_setup_gnu_properties (info);
- if (bfd_link_relocatable (info))
- return pbfd;
-
/* If pbfd has any GNU_PROPERTY_AARCH64_FEATURE_1_AND properties, update
outprop accordingly. */
if (pbfd != NULL)