[PATCH] D103815: [LLD][ELF] Fix PT_LOAD program header creation for NO_LOAD sections

Konstantin Schwarz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 7 07:48:36 PDT 2021


kschwarz created this revision.
kschwarz added reviewers: grimar, MaskRay, peter.smith.
Herald added subscribers: arichardson, emaste.
kschwarz requested review of this revision.
Herald added a project: LLVM.

During PHDR creation, the case where an output section does not require a
PT_LOAD header but still occupies memory in the current VMA region was not handled.

If such an output section interleaves two output sections that have the same
VMA and LMA regions set, we would previously re-use the existing PT_LOAD header
for the second output section.
However, since the memory region is not contiguous, we need to start a new PT_LOAD
segment.

This fixes https://bugs.llvm.org/show_bug.cgi?id=50558


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103815

Files:
  lld/ELF/Writer.cpp
  lld/test/ELF/linkerscript/phdrs-noload.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103815.350290.patch
Type: text/x-patch
Size: 3679 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210607/5285c47a/attachment.bin>


More information about the llvm-commits mailing list