summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/Writer.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index ceff38c4e68..7124c01caf2 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -1166,15 +1166,14 @@ template <class ELFT> void Writer<ELFT>::setPhdrs() {
}
}
-template <class ELFT>
-static uint32_t getMipsEFlags(bool Is64Bits,
- const ELFFileBase<ELFT> &FirstElf) {
+template <class ELFT> static uint32_t getMipsEFlags() {
// FIXME: ELF flags depends on ELF flags of all input object files and
// selected emulation. For now pick the arch flag from the fisrt input file
// and use hard coded values for other flags.
- uint32_t FirstElfFlags = FirstElf.getObj().getHeader()->e_flags;
+ uint32_t FirstElfFlags =
+ cast<ELFFileBase<ELFT>>(Config->FirstElf)->getObj().getHeader()->e_flags;
uint32_t ElfFlags = FirstElfFlags & EF_MIPS_ARCH;
- if (Is64Bits)
+ if (ELFT::Is64Bits)
ElfFlags |= EF_MIPS_CPIC | EF_MIPS_PIC;
else {
ElfFlags |= EF_MIPS_CPIC | EF_MIPS_ABI_O32;
@@ -1258,7 +1257,7 @@ template <class ELFT> void Writer<ELFT>::writeHeader() {
EHdr->e_shstrndx = Out<ELFT>::ShStrTab->SectionIndex;
if (Config->EMachine == EM_MIPS)
- EHdr->e_flags = getMipsEFlags(ELFT::Is64Bits, FirstObj);
+ EHdr->e_flags = getMipsEFlags<ELFT>();
if (!Config->Relocatable) {
EHdr->e_phoff = sizeof(Elf_Ehdr);
OpenPOWER on IntegriCloud