summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-07-14 17:43:28 +0000
committerRui Ueyama <ruiu@google.com>2016-07-14 17:43:28 +0000
commit941faa77adb172a17a84b9d8af8ea5a097badfbe (patch)
treec2f895b85beaaba3cf791a8f9e0b836248103e3f
parentcafc0f2e03269e3d67da2535f8db188ba8363a16 (diff)
downloadbcm5719-llvm-941faa77adb172a17a84b9d8af8ea5a097badfbe.tar.gz
bcm5719-llvm-941faa77adb172a17a84b9d8af8ea5a097badfbe.zip
Remove TargetInfo::getImageBase. NFC.
llvm-svn: 275447
-rw-r--r--lld/ELF/Driver.cpp3
-rw-r--r--lld/ELF/Target.cpp6
-rw-r--r--lld/ELF/Target.h3
3 files changed, 4 insertions, 8 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 0801f9d94d2..a967a7fe127 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -535,6 +535,7 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) {
Config->EntrySym = Symtab.addUndefined(S);
}
+ // Initialize Config->ImageBase.
if (auto *Arg = Args.getLastArg(OPT_image_base)) {
StringRef S = Arg->getValue();
if (S.getAsInteger(0, Config->ImageBase))
@@ -542,7 +543,7 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) {
else if ((Config->ImageBase % Target->PageSize) != 0)
warning(Arg->getSpelling() + ": address isn't multiple of page size");
} else {
- Config->ImageBase = Target->getImageBase();
+ Config->ImageBase = Config->Pic ? 0 : Target->DefaultImageBase;
}
for (std::unique_ptr<InputFile> &F : Files)
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index 437a500206d..466d1b47ce1 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -250,10 +250,6 @@ uint64_t TargetInfo::getImplicitAddend(const uint8_t *Buf,
return 0;
}
-uint64_t TargetInfo::getImageBase() const {
- return Config->Pic ? 0 : ImageBase;
-}
-
bool TargetInfo::usesOnlyLowPageBits(uint32_t Type) const { return false; }
RelExpr TargetInfo::getThunkExpr(RelExpr Expr, uint32_t RelocType,
@@ -997,7 +993,7 @@ PPC64TargetInfo::PPC64TargetInfo() {
//
// And because the lowest non-zero 256M boundary is 0x10000000, PPC64 linkers
// use 0x10000000 as the starting address.
- ImageBase = 0x10000000;
+ DefaultImageBase = 0x10000000;
}
static uint64_t PPC64TocOffset = 0x8000;
diff --git a/lld/ELF/Target.h b/lld/ELF/Target.h
index df4ceb17c98..d335c1e051b 100644
--- a/lld/ELF/Target.h
+++ b/lld/ELF/Target.h
@@ -23,7 +23,6 @@ class SymbolBody;
class TargetInfo {
public:
- uint64_t getImageBase() const;
virtual bool isTlsInitialExecRel(uint32_t Type) const;
virtual bool isTlsLocalDynamicRel(uint32_t Type) const;
virtual bool isTlsGlobalDynamicRel(uint32_t Type) const;
@@ -70,7 +69,7 @@ public:
// Given that, the smallest value that can be used in here is 0x10000.
// If using 2MB pages, the smallest page aligned address that works is
// 0x200000, but it looks like every OS uses 4k pages for executables.
- uint64_t ImageBase = 0x10000;
+ uint64_t DefaultImageBase = 0x10000;
uint32_t CopyRel;
uint32_t GotRel;
OpenPOWER on IntegriCloud