[llvm-dev] ld.lld --overwrite-section-script for linker script extension

Fāng-ruì Sòng via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 3 21:22:16 PDT 2021


To linker script users,

I posted https://reviews.llvm.org/D103303 for a feature customizing
output section descriptions[1] without affecting the output section
order[2].
There is a dispute about whether an explicit option should be
required. Hope users can share your thoughts.

An argument favoring no-option is for convenience.

An argument favoring an explicit option is that the behavior can be
subtle (https://sourceware.org/bugzilla/show_bug.cgi?id=26404#c3)
A glibc libm.a may look like this: GROUP (
/usr/lib/x86_64-linux-gnu/libm-2.31.a
/usr/lib/x86_64-linux-gnu/libmvec.a ). It adds two input files.
Allowing the full power of output section descriptions can be non-intuitive.


[1]: https://sourceware.org/binutils/docs/ld/Output-Section-Description.html
[2]: The default SECTIONS command specifies an output section order
and suppresses some built-in rules of section placement.


-- 
宋方睿


More information about the llvm-dev mailing list