[lld] r250048 - ELF2: Handle default entry name in the driver.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 12 08:23:55 PDT 2015
Author: ruiu
Date: Mon Oct 12 10:23:54 2015
New Revision: 250048
URL: http://llvm.org/viewvc/llvm-project?rev=250048&view=rev
Log:
ELF2: Handle default entry name in the driver.
Modified:
lld/trunk/ELF/Driver.cpp
lld/trunk/ELF/Target.cpp
lld/trunk/ELF/Target.h
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=250048&r1=250047&r2=250048&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Mon Oct 12 10:23:54 2015
@@ -218,8 +218,9 @@ template <class ELFT> void LinkerDriver:
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.
Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=250048&r1=250047&r2=250048&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Mon Oct 12 10:23:54 2015
@@ -348,7 +348,6 @@ void AArch64TargetInfo::relocateOne(uint
MipsTargetInfo::MipsTargetInfo() {
// PCRelReloc = FIXME
// GotReloc = FIXME
- DefaultEntry = "__start";
PageSize = 65536;
VAStart = 0x400000;
}
Modified: lld/trunk/ELF/Target.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.h?rev=250048&r1=250047&r2=250048&view=diff
==============================================================================
--- lld/trunk/ELF/Target.h (original)
+++ lld/trunk/ELF/Target.h Mon Oct 12 10:23:54 2015
@@ -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 {
More information about the llvm-commits
mailing list