diff options
author | Simon Atanasyan <simon@atanasyan.com> | 2016-04-29 10:39:17 +0000 |
---|---|---|
committer | Simon Atanasyan <simon@atanasyan.com> | 2016-04-29 10:39:17 +0000 |
commit | ae77ab71d875f31672d7dbba264586d5a32f4329 (patch) | |
tree | 84daf44e8b9fc39447c5b11904dc08dcec36ecd1 /lld/ELF/Writer.cpp | |
parent | bfaa63a82eb84ed59573a8cb77ccd3e0d2b01bb0 (diff) | |
download | bcm5719-llvm-ae77ab71d875f31672d7dbba264586d5a32f4329.tar.gz bcm5719-llvm-ae77ab71d875f31672d7dbba264586d5a32f4329.zip |
[ELF][MIPS] Accept MIPS 64-bit binaries
LLD accepts MIPS 64-bit binaries, supports corresponding eulation (-m)
arguments and emits 64-bit specific ELF flags.
llvm-svn: 268024
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r-- | lld/ELF/Writer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 514b21a5826..86915f31beb 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1760,10 +1760,13 @@ template <class ELFT> void Writer<ELFT>::setPhdrs() { } } -static uint32_t getMipsEFlags() { +static uint32_t getMipsEFlags(bool Is64Bits) { // 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; + if (Is64Bits) + return EF_MIPS_CPIC | EF_MIPS_PIC | EF_MIPS_ARCH_64R2; + + uint32_t V = EF_MIPS_CPIC | EF_MIPS_ABI_O32 | EF_MIPS_ARCH_32R2; if (Config->Shared) V |= EF_MIPS_PIC; return V; @@ -1844,7 +1847,7 @@ template <class ELFT> void Writer<ELFT>::writeHeader() { EHdr->e_shstrndx = Out<ELFT>::ShStrTab->SectionIndex; if (Config->EMachine == EM_MIPS) - EHdr->e_flags = getMipsEFlags(); + EHdr->e_flags = getMipsEFlags(ELFT::Is64Bits); if (!Config->Relocatable) { EHdr->e_phoff = sizeof(Elf_Ehdr); |