[PATCH] D46429: [LLD][ELF][AArch64] Add aarch64_elf64_le_vec emulation
Peter Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 4 06:13:08 PDT 2018
peter.smith created this revision.
peter.smith added reviewers: ruiu, grimar.
Herald added subscribers: kristof.beyls, arichardson, emaste, rengolin.
Herald added a reviewer: javed.absar.
Herald added a reviewer: espindola.
Android AOSP has started specifying -m aarch64_elf64_le_vec as supported by gold and BFD. This is a simple change to add the emulation so that LLD doesn't immediately error when used as a linker in an AOSP build.
See https://android.googlesource.com/platform/build/soong/+/master/cc/config/arm64_device.go#31
https://reviews.llvm.org/D46429
Files:
ELF/Driver.cpp
test/ELF/emulation.s
Index: test/ELF/emulation.s
===================================================================
--- test/ELF/emulation.s
+++ test/ELF/emulation.s
@@ -366,8 +366,12 @@
# RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-linux %s -o %taarch64
# RUN: ld.lld -m aarch64linux %taarch64 -o %t2aarch64
# RUN: llvm-readobj -file-headers %t2aarch64 | FileCheck --check-prefix=AARCH64 %s
-# RUN: ld.lld %taarch64 -o %t3aarch64
+# RUN: ld.lld -m aarch64elf %taarch64 -o %t3aarch64
# RUN: llvm-readobj -file-headers %t3aarch64 | FileCheck --check-prefix=AARCH64 %s
+# RUN: ld.lld -m aarch64_elf64_le_vec %taarch64 -o %t4aarch64
+# RUN: llvm-readobj -file-headers %t4aarch64 | FileCheck --check-prefix=AARCH64 %s
+# RUN: ld.lld %taarch64 -o %t5aarch64
+# RUN: llvm-readobj -file-headers %t5aarch64 | FileCheck --check-prefix=AARCH64 %s
# AARCH64: ElfHeader {
# AARCH64-NEXT: Ident {
# AARCH64-NEXT: Magic: (7F 45 4C 46)
Index: ELF/Driver.cpp
===================================================================
--- ELF/Driver.cpp
+++ ELF/Driver.cpp
@@ -118,7 +118,8 @@
std::pair<ELFKind, uint16_t> Ret =
StringSwitch<std::pair<ELFKind, uint16_t>>(S)
- .Cases("aarch64elf", "aarch64linux", {ELF64LEKind, EM_AARCH64})
+ .Cases("aarch64elf", "aarch64linux", "aarch64_elf64_le_vec",
+ {ELF64LEKind, EM_AARCH64})
.Cases("armelf", "armelf_linux_eabi", {ELF32LEKind, EM_ARM})
.Case("elf32_x86_64", {ELF32LEKind, EM_X86_64})
.Cases("elf32btsmip", "elf32btsmipn32", {ELF32BEKind, EM_MIPS})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46429.145182.patch
Type: text/x-patch
Size: 1565 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180504/e85434a2/attachment.bin>
More information about the llvm-commits
mailing list