diff options
author | Rui Ueyama <ruiu@google.com> | 2016-03-13 19:29:17 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2016-03-13 19:29:17 +0000 |
commit | 22b5d1f9013de93f68eb36e9f8804d9bb1651f17 (patch) | |
tree | 2f5cc7cb48f172c49bed07e64995e7fc028016d8 | |
parent | 5f1326f8ccb82141adb00051aa0b213c86426bee (diff) | |
download | bcm5719-llvm-22b5d1f9013de93f68eb36e9f8804d9bb1651f17.tar.gz bcm5719-llvm-22b5d1f9013de93f68eb36e9f8804d9bb1651f17.zip |
ELF: Set e_flags header only when MIPS.
The field is zero by default, so this is NFC.
llvm-svn: 263385
-rw-r--r-- | lld/ELF/Writer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index ca6cc66d602..27857683612 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1425,9 +1425,7 @@ template <class ELFT> void Writer<ELFT>::assignAddresses() { } } -static uint32_t getELFFlags() { - if (Config->EMachine != EM_MIPS) - return 0; +static uint32_t getMipsEFlags() { // FIXME: In fact ELF flags depends on ELF flags of input object files // and selected emulation. For now just use hard coded values. uint32_t V = EF_MIPS_ABI_O32 | EF_MIPS_CPIC | EF_MIPS_ARCH_32R2; @@ -1505,13 +1503,15 @@ template <class ELFT> void Writer<ELFT>::writeHeader() { EHdr->e_version = EV_CURRENT; EHdr->e_entry = getEntryAddr<ELFT>(); EHdr->e_shoff = SectionHeaderOff; - EHdr->e_flags = getELFFlags(); EHdr->e_ehsize = sizeof(Elf_Ehdr); EHdr->e_phnum = Phdrs.size(); EHdr->e_shentsize = sizeof(Elf_Shdr); EHdr->e_shnum = getNumSections(); EHdr->e_shstrndx = Out<ELFT>::ShStrTab->SectionIndex; + if (Config->EMachine == EM_MIPS) + EHdr->e_flags = getMipsEFlags(); + if (!Config->Relocatable) { EHdr->e_phoff = sizeof(Elf_Ehdr); EHdr->e_phentsize = sizeof(Elf_Phdr); |