[clang] [lld][ELF] Warn instead of error when linker script fails to find section (PR #68058)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 3 01:06:48 PDT 2023


MaskRay wrote:

I can understand downgrading an error could be convenient for for (optimizing section layout or alleviate relocation overflow) but the motivation is a bit strange. GNU ld does use an error for this case and this change would not address `--fatal-warnings` builds. 
In the absence of an insertion anchor, discarding the effect of the output section descriptions could be benign in some cases but disruptive in other cases. I think an error is appropriate.

Have you tried defining the anchor sections in a relocatable object file that's always linked into the executable instead?
The relocatable object file can be used together with a global linker script.


https://github.com/llvm/llvm-project/pull/68058


More information about the cfe-commits mailing list