summaryrefslogtreecommitdiff
path: root/ELF/MapFile.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-29 16:26:20 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-29 16:26:20 +0000
commitbef2946c219dc621608bcc9e47f8b973e5ef5c70 (patch)
tree1e4dfae199fc27167ed7496693938fec2dab65c2 /ELF/MapFile.cpp
parentc53addf38e24e4dafe992aafb3ae928bfa8fdb0a (diff)
Notes
Diffstat (limited to 'ELF/MapFile.cpp')
-rw-r--r--ELF/MapFile.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/ELF/MapFile.cpp b/ELF/MapFile.cpp
index 7b82eceba02a..806e99e3d9dd 100644
--- a/ELF/MapFile.cpp
+++ b/ELF/MapFile.cpp
@@ -132,12 +132,17 @@ void elf::writeMapFile(llvm::ArrayRef<BaseCommand *> Script) {
OS << OSec->Name << '\n';
// Dump symbols for each input section.
- for (InputSection *IS : OSec->Sections) {
- writeHeader<ELFT>(OS, OSec->Addr + IS->OutSecOff, IS->getSize(),
- IS->Alignment);
- OS << indent(1) << toString(IS) << '\n';
- for (DefinedRegular *Sym : SectionSyms[IS])
- OS << SymStr[Sym] << '\n';
+ for (BaseCommand *Base : Cmd->Commands) {
+ auto *ISD = dyn_cast<InputSectionDescription>(Base);
+ if (!ISD)
+ continue;
+ for (InputSection *IS : ISD->Sections) {
+ writeHeader<ELFT>(OS, OSec->Addr + IS->OutSecOff, IS->getSize(),
+ IS->Alignment);
+ OS << indent(1) << toString(IS) << '\n';
+ for (DefinedRegular *Sym : SectionSyms[IS])
+ OS << SymStr[Sym] << '\n';
+ }
}
}
}