summaryrefslogtreecommitdiffstats
path: root/lld/COFF/Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/COFF/Writer.cpp')
-rw-r--r--lld/COFF/Writer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp
index 23ce8485581..ca50e8bdce5 100644
--- a/lld/COFF/Writer.cpp
+++ b/lld/COFF/Writer.cpp
@@ -592,7 +592,8 @@ OutputSection *Writer::createSection(StringRef Name) {
// Dest is .reloc section. Add contents to that section.
void Writer::addBaserels(OutputSection *Dest) {
std::vector<uint32_t> V;
- Defined *ImageBase = cast<Defined>(Symtab->find("__ImageBase")->Body);
+ StringRef Name = Config->is64() ? "__ImageBase" : "___ImageBase";
+ Defined *ImageBase = cast<Defined>(Symtab->find(Name)->Body);
for (OutputSection *Sec : OutputSections) {
if (Sec == Dest)
continue;
OpenPOWER on IntegriCloud