Revert "[lld][elf2] Fix hard coded entry address."

This reverts commit r247073.

It broke

    lld :: elf2/basic32be.s
    lld :: elf2/basic64be.s

llvm-svn: 247077
This commit is contained in:
Rafael Espindola 2015-09-08 21:32:44 +00:00
parent a610cb5ba0
commit b9fe03d4a9
3 changed files with 3 additions and 7 deletions

View File

@ -576,11 +576,7 @@ template <class ELFT> void Writer<ELFT>::writeHeader() {
auto &FirstObj = cast<ObjectFile<ELFT>>(*Symtab.getFirstELF());
EHdr->e_machine = FirstObj.getEMachine();
EHdr->e_version = EV_CURRENT;
llvm::DenseMap<StringRef, Symbol *>::const_iterator Entry =
Symtab.getSymbols().find("_start");
EHdr->e_entry = getSymVA(cast<DefinedRegular<ELFT>>(Entry->second->Body));
EHdr->e_entry = 0x401000;
EHdr->e_phoff = sizeof(Elf_Ehdr_Impl<ELFT>);
EHdr->e_shoff = SectionHeaderOff;
EHdr->e_ehsize = sizeof(Elf_Ehdr_Impl<ELFT>);

View File

@ -23,7 +23,7 @@ _start:
# CHECK-NEXT: Type: Executable (0x2)
# CHECK-NEXT: Machine: EM_X86_64 (0x3E)
# CHECK-NEXT: Version: 1
# CHECK-NEXT: Entry: 0x1000
# CHECK-NEXT: Entry: 0x401000
# CHECK-NEXT: ProgramHeaderOffset: 0x40
# CHECK-NEXT: SectionHeaderOffset: 0x1070
# CHECK-NEXT: Flags [ (0x0)

View File

@ -23,7 +23,7 @@ _start:
# CHECK-NEXT: Type: Executable (0x2)
# CHECK-NEXT: Machine: EM_386 (0x3)
# CHECK-NEXT: Version: 1
# CHECK-NEXT: Entry: 0x1000
# CHECK-NEXT: Entry: 0x401000
# CHECK-NEXT: ProgramHeaderOffset: 0x34
# CHECK-NEXT: SectionHeaderOffset: 0x1058
# CHECK-NEXT: Flags [ (0x0)