diff options
| -rw-r--r-- | lld/ELF/Driver.cpp | 5 | ||||
| -rw-r--r-- | lld/ELF/Target.cpp | 1 | ||||
| -rw-r--r-- | lld/ELF/Target.h | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 7f8f6f4254c..b9f55613f55 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -218,8 +218,9 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &Args) { if (!Config->Shared) { // Add entry symbol. - Config->EntrySym = Symtab.addUndefined( - Config->Entry.empty() ? Target->getDefaultEntry() : Config->Entry); + if (Config->Entry.empty()) + Config->Entry = (Config->EMachine == EM_MIPS) ? "__start" : "_start"; + Config->EntrySym = Symtab.addUndefined(Config->Entry); // In the assembly for 32 bit x86 the _GLOBAL_OFFSET_TABLE_ symbol // is magical and is used to produce a R_386_GOTPC relocation. diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index 1ab553e36a1..4be867a71d5 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -348,7 +348,6 @@ void AArch64TargetInfo::relocateOne(uint8_t *Buf, const void *RelP, MipsTargetInfo::MipsTargetInfo() { // PCRelReloc = FIXME // GotReloc = FIXME - DefaultEntry = "__start"; PageSize = 65536; VAStart = 0x400000; } diff --git a/lld/ELF/Target.h b/lld/ELF/Target.h index 6c8d2ba29d0..9d3d7b9eeb9 100644 --- a/lld/ELF/Target.h +++ b/lld/ELF/Target.h @@ -20,7 +20,6 @@ class SymbolBody; class TargetInfo { public: - llvm::StringRef getDefaultEntry() const { return DefaultEntry; } unsigned getPageSize() const { return PageSize; } uint64_t getVAStart() const { return VAStart; } unsigned getPCRelReloc() const { return PCRelReloc; } @@ -47,7 +46,6 @@ protected: unsigned GotReloc; unsigned RelativeReloc; unsigned PltEntrySize = 8; - llvm::StringRef DefaultEntry = "_start"; }; class X86TargetInfo final : public TargetInfo { |

