[PATCH v3 00/18] PR ld/24600: Add general linker support for mapless archives
Maciej W. Rozycki
macro@orcam.me.uk
Thu Nov 20 10:55:51 GMT 2025
Hi,
This is v3 of a patch series originally posted here
<https://inbox.sourceware.org/binutils/alpine.DEB.2.21.2509251408330.15999@angie.orcam.me.uk/>.
As from v2 it includes `--start-lib'/`--end-lib' linker command line
option support, however I chose to keep the original subject for the cover
letter for the purpose of mailbox sorting.
I have now investigated and fixed the issue originally triggered by v1
for the `cris*-*-*' target related to commit c1a7d039587b ("cris: bfd:
Default selected target to the configured target"). The CRIS targets
turned out to be the only ones that make use of the multiple emulation
support in GAS for dislike target object formats (the only other target
that makes use of the feature is MIPS, but nowadays only as an alternative
way to choose the endianness between otherwise ELF formats), so I made it
the basis for new tests to verify generic BFD support for switching the
emulation where archives are involved, as with other targets extra messing
with `objcopy' would be required to change the format of assembly output.
This fix also revealed missing support in the `--start-lib'/`--end-lib'
linker feature for using a non-default linker emulation, now also fixed in
this version.
Extra changes now added caused patch positions to change again, and just
as with v2 the respective previous versions are referred from individual
updated changes.
Here's an overview of the updated set:
1. Add a set of XFAILs referring PR binutils/33485 for NS32k targets.
2. Update the testsuite for the Alpha/VMS target, recently fixed.
3. Fix a sign-extension bug for Alpha/VMS.
4. Add test cases for the `--whole-archive' feature.
5. Add tests for emulation switching, based on the CRIS target feature.
6. Add test cases for the archive group feature.
7. Make the file position consistently unsigned in symbol maps.
8. Add a BFD pointer member to `struct carsym' (symbol map).
9. Fix a crash on an attempt to free an uninitialized section hash.
10. Unset the format on releasing a BFD's objalloc memory.
11. Correct archive format determination for non-default link emulations.
12. Expand support for mapless archives across all the BFD linkers (beyond
just XCOFF).
13. Add `--link-mapless'/`--no-link-mapless' LD options to control the new
feature, on by default (and now switchable off for XCOFF too, but not
effective for Alpha/VMS whose archive format does not support omitting
an index).
14. Guard NULL pointer use with assertions in LD where adding a new input
file.
15. Factor out input file insertion in LD.
16. Add a BFD pointer member to structures referring to archive members.
17. Add fake archive support to BFD as a list of member BFDs supplied.
18. Add `--start-lib'/`--end-lib' LD options and a corresponding linker
script feature building upon the fake archive BFD feature.
See individual change descriptions for details.
This has been verified across 250 targets, causing no regressions and
adding no failures in new tests. Additional verification for the plugin
feature potentially affected included the `powerpc64le-linux-gnu' native
configuration as well as going by hand through the recipe given with PR
binutils/13278.
OK to apply?
Previous iterations:
- v2 at: <https://inbox.sourceware.org/binutils/alpine.DEB.2.21.2511050716450.25436@angie.orcam.me.uk/>.
- v1 at: <https://inbox.sourceware.org/binutils/alpine.DEB.2.21.2509251408330.15999@angie.orcam.me.uk/>.
Maciej
More information about the Binutils
mailing list