[lld] d82679d - [ELF] Drop Android specific workaround -m aarch64_elf64_le_vec

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 9 00:43:19 PST 2021


Author: Fangrui Song
Date: 2021-02-09T00:43:10-08:00
New Revision: d82679d8050130522ebcf90c6061211a25b1c83d

URL: https://github.com/llvm/llvm-project/commit/d82679d8050130522ebcf90c6061211a25b1c83d
DIFF: https://github.com/llvm/llvm-project/commit/d82679d8050130522ebcf90c6061211a25b1c83d.diff

LOG: [ELF] Drop Android specific workaround -m aarch64_elf64_le_vec

`extern const bfd_target aarch64_elf64_le_vec;` is a variable in BFD.
It was somehow misused as an emulation by Android.

```
% aarch64-linux-gnu-ld -m aarch64_elf64_le_vec a.o
aarch64-linux-gnu-ld: unrecognised emulation mode: aarch64_elf64_le_vec
Supported emulations: aarch64linux aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb aarch64linuxb aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi
```

Acked by Stephen Hines, who removed the flag from Android a while back.

Added: 
    

Modified: 
    lld/ELF/Driver.cpp
    lld/test/ELF/emulation-aarch64.s

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index fe722ebd4891..4e10b02f04bf 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -144,8 +144,7 @@ static std::tuple<ELFKind, uint16_t, uint8_t> parseEmulation(StringRef emul) {
 
   std::pair<ELFKind, uint16_t> ret =
       StringSwitch<std::pair<ELFKind, uint16_t>>(s)
-          .Cases("aarch64elf", "aarch64linux", "aarch64_elf64_le_vec",
-                 {ELF64LEKind, EM_AARCH64})
+          .Cases("aarch64elf", "aarch64linux", {ELF64LEKind, EM_AARCH64})
           .Cases("aarch64elfb", "aarch64linuxb", {ELF64BEKind, EM_AARCH64})
           .Cases("armelf", "armelf_linux_eabi", {ELF32LEKind, EM_ARM})
           .Case("elf32_x86_64", {ELF32LEKind, EM_X86_64})

diff  --git a/lld/test/ELF/emulation-aarch64.s b/lld/test/ELF/emulation-aarch64.s
index 2d26a1e8e64e..68db8b4fefb0 100644
--- a/lld/test/ELF/emulation-aarch64.s
+++ b/lld/test/ELF/emulation-aarch64.s
@@ -9,8 +9,6 @@
 # RUN: echo 'OUTPUT_FORMAT(elf64-littleaarch64)' > %t.script
 # RUN: ld.lld %t.script %t.o -o %t3
 # RUN: llvm-readobj --file-headers %t3 | FileCheck --check-prefixes=AARCH64,LE %s
-# RUN: ld.lld -m aarch64_elf64_le_vec %t.o -o %taosp
-# RUN: llvm-readobj --file-headers %taosp | FileCheck --check-prefixes=AARCH64,LE %s
 
 # RUN: llvm-mc -filetype=obj -triple=aarch64_be %s -o %t.be.o
 # RUN: ld.lld %t.be.o -o %t


        


More information about the llvm-commits mailing list