aboutsummaryrefslogtreecommitdiff
path: root/deps/lld/ELF/MapFile.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-03-20 13:34:07 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-03-20 13:34:07 -0400
commit3c7555cb679492f3f1c0ce320cbdf4a3769e56db (patch)
tree6a59ff4cd7d7e27e8d066fb3d3e07be6dffa012b /deps/lld/ELF/MapFile.cpp
parent2fdf69bc4082c49a571c0ee7bb7441d910def795 (diff)
parent1b25dcde9691835d0c3f5449f4c9565b9074de0e (diff)
downloadzig-3c7555cb679492f3f1c0ce320cbdf4a3769e56db.tar.gz
zig-3c7555cb679492f3f1c0ce320cbdf4a3769e56db.zip
Merge remote-tracking branch 'origin/llvm8'
Diffstat (limited to 'deps/lld/ELF/MapFile.cpp')
-rw-r--r--deps/lld/ELF/MapFile.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/deps/lld/ELF/MapFile.cpp b/deps/lld/ELF/MapFile.cpp
index 54fddfb7b2..b0dc620300 100644
--- a/deps/lld/ELF/MapFile.cpp
+++ b/deps/lld/ELF/MapFile.cpp
@@ -126,7 +126,7 @@ static void printEhFrame(raw_ostream &OS, OutputSection *OSec) {
};
// Gather section pieces.
- for (const CieRecord *Rec : InX::EhFrame->getCieRecords()) {
+ for (const CieRecord *Rec : In.EhFrame->getCieRecords()) {
Add(*Rec->Cie);
for (const EhSectionPiece *Fde : Rec->Fdes)
Add(*Fde);
@@ -163,17 +163,18 @@ void elf::writeMapFile() {
OS << right_justify("VMA", W) << ' ' << right_justify("LMA", W)
<< " Size Align Out In Symbol\n";
+ OutputSection* OSec = nullptr;
for (BaseCommand *Base : Script->SectionCommands) {
if (auto *Cmd = dyn_cast<SymbolAssignment>(Base)) {
if (Cmd->Provide && !Cmd->Sym)
continue;
- //FIXME: calculate and print LMA.
- writeHeader(OS, Cmd->Addr, 0, Cmd->Size, 1);
+ uint64_t LMA = OSec ? OSec->getLMA() + Cmd->Addr - OSec->getVA(0) : 0;
+ writeHeader(OS, Cmd->Addr, LMA, Cmd->Size, 1);
OS << Cmd->CommandString << '\n';
continue;
}
- auto *OSec = cast<OutputSection>(Base);
+ OSec = cast<OutputSection>(Base);
writeHeader(OS, OSec->Addr, OSec->getLMA(), OSec->Size, OSec->Alignment);
OS << OSec->Name << '\n';
@@ -181,7 +182,7 @@ void elf::writeMapFile() {
for (BaseCommand *Base : OSec->SectionCommands) {
if (auto *ISD = dyn_cast<InputSectionDescription>(Base)) {
for (InputSection *IS : ISD->Sections) {
- if (IS == InX::EhFrame) {
+ if (IS == In.EhFrame) {
printEhFrame(OS, OSec);
continue;
}