summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/include/lld/ReaderWriter/PECOFFLinkingContext.h6
-rw-r--r--lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp2
2 files changed, 6 insertions, 2 deletions
diff --git a/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h b/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h
index 7de6f6d6cba..fdc8c10c9a6 100644
--- a/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h
+++ b/lld/include/lld/ReaderWriter/PECOFFLinkingContext.h
@@ -250,7 +250,11 @@ protected:
virtual std::unique_ptr<File> createUndefinedSymbolFile() const;
private:
- enum { invalidBaseAddress = UINT64_MAX };
+ enum {
+ invalidBaseAddress = UINT64_MAX,
+ pe32DefaultBaseAddress = 0x400000UL,
+ pe32PlusDefaultBaseAddress = 0x140000000UL
+ };
// The start address for the program. The default value for the executable is
// 0x400000, but can be altered using /base command line option.
diff --git a/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp b/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
index 067fd5ccd24..c727ab8df58 100644
--- a/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
+++ b/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
@@ -203,7 +203,7 @@ StringRef PECOFFLinkingContext::undecorateSymbol(StringRef name) const {
uint64_t PECOFFLinkingContext::getBaseAddress() const {
if (_baseAddress == invalidBaseAddress)
- return is64Bit() ? 0x140000000UL : 0x400000UL;
+ return is64Bit() ? pe32PlusDefaultBaseAddress : pe32DefaultBaseAddress;
return _baseAddress;
}
OpenPOWER on IntegriCloud