[Object] Use BFD name for little-endian PowerPC64
authorBill Wendling <isanbard@gmail.com>
Mon, 20 Apr 2020 03:08:30 +0000 (20:08 -0700)
committerBill Wendling <isanbard@gmail.com>
Mon, 20 Apr 2020 03:10:05 +0000 (20:10 -0700)
Summary:
Little-endian PowerPC object files should report "elf64-powerpcle" instead of
"elf64-powerpc".

Reviewers: jhenderson, MaskRay, espindola, alexshap, rupprecht, #powerpc

Reviewed By: MaskRay

Subscribers: wuzish, emaste, nemanjai, shchenz, steven.zhang, llvm-commits

Tags: #llvm, #powerpc

Differential Revision: https://reviews.llvm.org/D78344

llvm/include/llvm/Object/ELFObjectFile.h
llvm/test/tools/llvm-objcopy/ELF/cross-arch-headers.test

index 3fbfa9c..b0aa869 100644 (file)
@@ -1121,7 +1121,7 @@ StringRef ELFObjectFile<ELFT>::getFileFormatName() const {
     case ELF::EM_AARCH64:
       return (IsLittleEndian ? "elf64-littleaarch64" : "elf64-bigaarch64");
     case ELF::EM_PPC64:
-      return "elf64-powerpc";
+      return (IsLittleEndian ? "elf64-powerpcle" : "elf64-powerpc");
     case ELF::EM_RISCV:
       return "elf64-littleriscv";
     case ELF::EM_S390:
index e4ab2dd..db82c36 100644 (file)
@@ -147,7 +147,7 @@ Symbols:
 # MIPS-SAME:    mips
 # PPC-SAME:     powerpc{{$}}
 # PPC64BE-SAME: powerpc{{$}}
-# PPC64LE-SAME: powerpc{{$}}
+# PPC64LE-SAME: powerpcle{{$}}
 # RISCV32-SAME: riscv{{$}}
 # RISCV64-SAME: riscv{{$}}
 # SPARC-SAME:   sparc