[lld] [ELF] Orphan placement: remove hasInputSections condition (PR #93761)
Igor Kudrin via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 11 20:20:58 PDT 2024
igorkudrin wrote:
> To progress this one do we have an example of one of these sample linker scripts having a problematic Output Section acting as an anchor for orphans, or is it a theoretical risk?
So far, the risk is theoretical. I just don't like it when data can be written to an executable segment unexpectedly. Since `LinkerScript::adjustOutputSections()` propagates `SHF_WRITE` but not `SHF_EXECINSTR`, the problematic case could be a linker script that defines read-only sections before executable sections, and among the executable sections there is an empty output section with symbol assignments, data values, or other similar instructions; in this scenario, read-only orphan sections are placed in the executable segment. I can't say how likely this case is, nor how harmful or harmless it might be.
https://github.com/llvm/llvm-project/pull/93761
More information about the llvm-commits
mailing list