aboutsummaryrefslogtreecommitdiff
path: root/lld/ELF/MapFile.cpp
diff options
context:
space:
mode:
authorDaniel Thornburgh <dthorn@google.com>2024-08-05 13:06:45 -0700
committerGitHub <noreply@github.com>2024-08-05 13:06:45 -0700
commit7e8a9020b1ae3dea28c19f0cd68743482dca13d9 (patch)
treec56b216f7eec1c04d1a03c29eaf7faf6b6167626 /lld/ELF/MapFile.cpp
parent88d288489e09a261f6740972dcaf6fedaf87a762 (diff)
downloadllvm-7e8a9020b1ae3dea28c19f0cd68743482dca13d9.zip
llvm-7e8a9020b1ae3dea28c19f0cd68743482dca13d9.tar.gz
llvm-7e8a9020b1ae3dea28c19f0cd68743482dca13d9.tar.bz2
[LLD] Add CLASS syntax to SECTIONS (#95323)
This allows the input section matching algorithm to be separated from output section descriptions. This allows a group of sections to be assigned to multiple output sections, providing an explicit version of --enable-non-contiguous-regions's spilling that doesn't require altering global linker script matching behavior with a flag. It also makes the linker script language more expressive even if spilling is not intended, since input section matching can be done in a different order than sections are placed in an output section. The implementation reuses the backend mechanism provided by --enable-non-contiguous-regions, so it has roughly similar semantics and limitations. In particular, sections cannot be spilled into or out of INSERT, OVERWRITE_SECTIONS, or /DISCARD/. The former two aren't intrinsic, so it may be possible to relax those restrictions later.
Diffstat (limited to 'lld/ELF/MapFile.cpp')
-rw-r--r--lld/ELF/MapFile.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lld/ELF/MapFile.cpp b/lld/ELF/MapFile.cpp
index c4f3fdd..1bad529 100644
--- a/lld/ELF/MapFile.cpp
+++ b/lld/ELF/MapFile.cpp
@@ -167,6 +167,8 @@ static void writeMapFile(raw_fd_ostream &os) {
os << assign->commandString << '\n';
continue;
}
+ if (isa<SectionClassDesc>(cmd))
+ continue;
osec = &cast<OutputDesc>(cmd)->osec;
writeHeader(os, osec->addr, osec->getLMA(), osec->size, osec->addralign);