GNU tools generate mapping symbols "$d" for .ARM.exidx sections. The symbols are added to the symbol table much earlier than the merging takes place, and after that, they become dangling. Before the patch, LLD output those symbols as SHN_ABS with the value of 0. The patch removes such symbols from the symbol table.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Thanks for the patch. I think what you have looks like it will work.
I'm thinking that there may be a simpler option. As the .ARM.exidx is only accessed via the linker defined start and end symbols and mapping symbols are optional for sections containing data; we can either not add any symbols from .ARM.exidx sections to the symbol table, or strip all of them rather than having to select just the ones defined in the merged sections. Maybe worth seeing if that is possible?
Comment Actions
(a minor general comment about the code from me).
lld/ELF/SyntheticSections.cpp | ||
---|---|---|
2034 ↗ | (On Diff #259934) | I think you wanted to use cast: auto *d = cast<Defined>(s.sym); |
Comment Actions
- Reworked the patch so that the local symbols for .ARM.exidx sections are not added to the symbols table. Thanks for the suggestion, @psmith!
Comment Actions
Thanks for the update, I'm happy with that. Will be worth seeing if MaskRay or George have any final comments.
lld/test/ELF/arm-exidx-mapping-symbols.s | ||
---|---|---|
16 | /// |
///