From: Matthieu Longo Date: Thu, 14 Nov 2024 17:35:24 +0000 (+0000) Subject: aarch64: remove early exit when setting up GNU properties with partial linking X-Git-Tag: gdb-16-branchpoint~230 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ad1fffee5f0eb055d7919dd1098107fa131501d;p=thirdparty%2Fbinutils-gdb.git 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. --- diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c index 406b2fac0d3..896497a7812 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)