Merge relocation sections with linker script in lld

Example 1: Group Sections are not discarded
[…]
Example 2: Relocation sections are not combined

Thanks for the summary. It’s very useful.

After some investigation of GNU ld behavior, I find that its --force-group-allocation (introduced in 2017) implements the section group behavior you and @davidchisnall need

[PATCH] ld: Allow section groups to be resolved as part of a relocatable link - Andrew Burgess contains some descriptions.

I’ve created [ELF] Implement --force-group-allocation by MaskRay · Pull Request #94704 · llvm/llvm-project · GitHub

1 Like