forked from OSchip/llvm-project
ELF: Set e_flags header only when MIPS.
The field is zero by default, so this is NFC. llvm-svn: 263385
This commit is contained in:
parent
5f1326f8cc
commit
22b5d1f901
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue