[PATCH v1 22/27] aarch64: remove early exit when setting up GNU properties with partial linking
Matthieu Longo
matthieu.longo@arm.com
Mon Dec 2 14:22:14 GMT 2024
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.
---
bfd/elfxx-aarch64.c | 3 ---
1 file changed, 3 deletions(-)
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)
--
2.47.0
More information about the Binutils
mailing list