[lld] r280982 - ELF: accept -m elf_amd64 as an alias for -m elf_x86_64
Ed Maste via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 8 12:30:48 PDT 2016
Author: emaste
Date: Thu Sep 8 14:30:47 2016
New Revision: 280982
URL: http://llvm.org/viewvc/llvm-project?rev=280982&view=rev
Log:
ELF: accept -m elf_amd64 as an alias for -m elf_x86_64
In the FreeBSD world x86_64 still has its original name, amd64. Accept
it as an alias.
Differential Revision: https://reviews.llvm.org/D24356
Modified:
lld/trunk/ELF/Driver.cpp
lld/trunk/test/ELF/emulation.s
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=280982&r1=280981&r2=280982&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Thu Sep 8 14:30:47 2016
@@ -70,6 +70,7 @@ static std::pair<ELFKind, uint16_t> pars
.Case("elf64btsmip", {ELF64BEKind, EM_MIPS})
.Case("elf64ltsmip", {ELF64LEKind, EM_MIPS})
.Case("elf64ppc", {ELF64BEKind, EM_PPC64})
+ .Case("elf_amd64", {ELF64LEKind, EM_X86_64})
.Case("elf_i386", {ELF32LEKind, EM_386})
.Case("elf_iamcu", {ELF32LEKind, EM_IAMCU})
.Case("elf_x86_64", {ELF64LEKind, EM_X86_64})
Modified: lld/trunk/test/ELF/emulation.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/emulation.s?rev=280982&r1=280981&r2=280982&view=diff
==============================================================================
--- lld/trunk/test/ELF/emulation.s (original)
+++ lld/trunk/test/ELF/emulation.s Thu Sep 8 14:30:47 2016
@@ -1,3 +1,34 @@
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-freebsd %s -o %tx64
+# RUN: ld.lld -m elf_amd64_fbsd %tx64 -o %t2x64
+# RUN: llvm-readobj -file-headers %t2x64 | FileCheck --check-prefix=AMD64 %s
+# RUN: ld.lld %tx64 -o %t3x64
+# RUN: llvm-readobj -file-headers %t3x64 | FileCheck --check-prefix=AMD64 %s
+# AMD64: ElfHeader {
+# AMD64-NEXT: Ident {
+# AMD64-NEXT: Magic: (7F 45 4C 46)
+# AMD64-NEXT: Class: 64-bit (0x2)
+# AMD64-NEXT: DataEncoding: LittleEndian (0x1)
+# AMD64-NEXT: FileVersion: 1
+# AMD64-NEXT: OS/ABI: FreeBSD (0x9)
+# AMD64-NEXT: ABIVersion: 0
+# AMD64-NEXT: Unused: (00 00 00 00 00 00 00)
+# AMD64-NEXT: }
+# AMD64-NEXT: Type: Executable (0x2)
+# AMD64-NEXT: Machine: EM_X86_64 (0x3E)
+# AMD64-NEXT: Version: 1
+# AMD64-NEXT: Entry:
+# AMD64-NEXT: ProgramHeaderOffset: 0x40
+# AMD64-NEXT: SectionHeaderOffset:
+# AMD64-NEXT: Flags [ (0x0)
+# AMD64-NEXT: ]
+# AMD64-NEXT: HeaderSize: 64
+# AMD64-NEXT: ProgramHeaderEntrySize: 56
+# AMD64-NEXT: ProgramHeaderCount:
+# AMD64-NEXT: SectionHeaderEntrySize: 64
+# AMD64-NEXT: SectionHeaderCount:
+# AMD64-NEXT: StringTableSectionIndex:
+# AMD64-NEXT: }
+
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %tx64
# RUN: ld.lld -m elf_x86_64 %tx64 -o %t2x64
# RUN: llvm-readobj -file-headers %t2x64 | FileCheck --check-prefix=X86-64 %s
More information about the llvm-commits
mailing list