[lld] [lld/ELF] Warn on conflicting SHF_X86_64_LARGE flag (PR #72335)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 16:27:46 PST 2024


MaskRay wrote:

> One concern I have with this change is that it will create linker warnings for instrumentation tools (PGO & ASan) with mixed code models.
> 
> For ASan, asan_globals is large under large/medium models. For PGO, __llvm_prof_names is large under large/medium models There are no direct references to these sections, so taking the union of flags in the linker is safe, and the warning is safe to ignore in this case.
> 
> Would it be overkill to anticipate this? Should we special case some sections out of this, or should we plan to create a general mechanism to suppress this warning for particular sections?

Yes. There are my concerns. Essentially, this is a lint feature disguised as a warning. However, if we reach a point where we need a hard-coded list, I think the diagnostic no longer pull its weight and should be removed instead.


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


More information about the llvm-commits mailing list