mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-20 10:24:12 +00:00
[ELF][Mips] Fix recognition of MIPS 64-bit arch in the ELFObjectFile:getArch() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211891 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -917,6 +917,7 @@ StringRef ELFObjectFile<ELFT>::getFileFormatName() const {
|
||||
|
||||
template <class ELFT>
|
||||
unsigned ELFObjectFile<ELFT>::getArch() const {
|
||||
bool IsLittleEndian = ELFT::TargetEndianness == support::little;
|
||||
switch (EF.getHeader()->e_machine) {
|
||||
case ELF::EM_386:
|
||||
return Triple::x86;
|
||||
@ -929,11 +930,16 @@ unsigned ELFObjectFile<ELFT>::getArch() const {
|
||||
case ELF::EM_HEXAGON:
|
||||
return Triple::hexagon;
|
||||
case ELF::EM_MIPS:
|
||||
return (ELFT::TargetEndianness == support::little) ? Triple::mipsel
|
||||
: Triple::mips;
|
||||
switch (EF.getHeader()->e_ident[ELF::EI_CLASS]) {
|
||||
case ELF::ELFCLASS32:
|
||||
return IsLittleEndian ? Triple::mipsel : Triple::mips;
|
||||
case ELF::ELFCLASS64:
|
||||
return IsLittleEndian ? Triple::mips64el : Triple::mips64;
|
||||
default:
|
||||
report_fatal_error("Invalid ELFCLASS!");
|
||||
}
|
||||
case ELF::EM_PPC64:
|
||||
return (ELFT::TargetEndianness == support::little) ? Triple::ppc64le
|
||||
: Triple::ppc64;
|
||||
return IsLittleEndian ? Triple::ppc64le : Triple::ppc64;
|
||||
case ELF::EM_S390:
|
||||
return Triple::systemz;
|
||||
|
||||
|
Reference in New Issue
Block a user