Support shf link order#1085
Conversation
Be consistent across partial link, GC, and COMDAT. User-visible improvements: - Garbage collection now consistently follows dependencies through sh_link, so dependent link-order sections are kept or removed together with their target sections. - COMDAT resolution now drops SHF_LINK_ORDER members from discarded duplicate groups. - Output ordering and linker map ordering for link-order sections are validated to stay aligned. - User guide documentation now explains SHF_LINK_ORDER behavior for partial linking, garbage collection, and linker scripts. Signed-off-by: Shankar Easwaran <seaswara@qti.qualcomm.com>
- Adds --trace=link-order to print SHF_LINK_ORDER dependencies. - Adds --trace=discard-sections to print why sections were discarded. - Extends --trace=garbage-collection and --trace=live-edges to show SHF_LINK_ORDER dependency edges in reachability output. - Explicit /DISCARD/ of link-order sections. - Discard of SHF_LINK_ORDER dependents when their linked parent section is discarded. - Link-order edge visibility in live-edge tracing output. Signed-off-by: Shankar Easwaran <seaswara@qti.qualcomm.com>
|
This PR is quite difficult to review because it bundles several independent changes. The core The new lit Functionality-wise, eld seems to allow what lld and bfd reject: -ld.eld --gc-sections -e _start 1.o -o e.out
ld.lld --gc-sections -e _start 1.o -o l.out
+ld.lld: error: 1.o:(.meta.bar): sh_link points to discarded section 1.o:(.text.bar)
/usr/bin/aarch64-linux-gnu-ld --gc-sections -e _start 1.o -o g.out
+`meta_bar' referenced in section `.text' of 1.o: defined in discarded section `.meta.bar' of 1.oI have other comments, but this should do for now. |
|
Thanks for the review!. I will create a seperate PR for tracing diagnostics. Will remove asm-helper, good to know %progbits is accepted by all targets. |
No description provided.