================ @@ -1103,31 +1106,36 @@ template <class ELFT> void Writer<ELFT>::setReservedSymbolSections() { } PhdrEntry *last = nullptr; - PhdrEntry *lastRO = nullptr; - + OutputSection *lastRO = nullptr; + auto isLarge = [](OutputSection *osec) { + return config->emachine == EM_X86_64 && osec->flags & SHF_X86_64_LARGE; + }; for (Partition &part : partitions) { for (PhdrEntry *p : part.phdrs) { if (p->p_type != PT_LOAD) continue; last = p; - if (!(p->p_flags & PF_W)) - lastRO = p; + if (!(p->p_flags & PF_W) && p->lastSec && !isLarge(p->lastSec)) ---------------- MaskRay wrote:
This is a new change. We need to adjust `_etext` as there is now a read-only PT_LOAD segment after RW PT_LOAD segments. (Mentioned in the updated description). https://github.com/llvm/llvm-project/pull/81224 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits