[PATCH] D58655: lld: add support for aarch64be -m flags
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 25 16:46:35 PST 2019
nickdesaulniers created this revision.
nickdesaulniers added reviewers: psmith, ruiu, grimar.
Herald added subscribers: llvm-commits, kristof.beyls, arichardson, javed.absar, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
The Linux kernel makes use of -maarch64elfb and -maarch64linuxb.
Link: https://github.com/ClangBuiltLinux/linux/issues/380
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D58655
Files:
lld/ELF/Driver.cpp
lld/test/ELF/emulation-aarch64.s
Index: lld/test/ELF/emulation-aarch64.s
===================================================================
--- lld/test/ELF/emulation-aarch64.s
+++ lld/test/ELF/emulation-aarch64.s
@@ -53,5 +53,27 @@
# AARCH64-FBSD-NEXT: Flags [ (0x0)
# AARCH64-FBSD-NEXT: ]
+# RUN: llvm-mc -filetype=obj -triple=aarch64_be-unknown-linux %s -o %t5
+# RUN: ld.lld -maarch64elfb %t5 -o %t5
+# RUN: llvm-readobj -file-headers %t5 | FileCheck --check-prefix=AARCH64BE %s
+# AARCH64BE: ElfHeader {
+# AARCH64BE-NEXT: Ident {
+# AARCH64BE-NEXT: Magic: (7F 45 4C 46)
+# AARCH64BE-NEXT: Class: 64-bit (0x2)
+# AARCH64BE-NEXT: DataEncoding: BigEndian (0x2)
+# AARCH64BE-NEXT: FileVersion: 1
+# AARCH64BE-NEXT: OS/ABI: SystemV (0x0)
+# AARCH64BE-NEXT: ABIVersion: 0
+# AARCH64BE-NEXT: Unused: (00 00 00 00 00 00 00)
+# AARCH64BE-NEXT: }
+# AARCH64BE-NEXT: Type: Executable (0x2)
+# AARCH64BE-NEXT: Machine: EM_AARCH64 (0xB7)
+# AARCH64BE-NEXT: Version: 1
+# AARCH64BE-NEXT: Entry: 0x210000
+# AARCH64BE-NEXT: ProgramHeaderOffset: 0x40
+# AARCH64BE-NEXT: SectionHeaderOffset: 0x10070
+# AARCH64BE-NEXT: Flags [ (0x0)
+# AARCH64BE-NEXT: ]
+
.globl _start
_start:
Index: lld/ELF/Driver.cpp
===================================================================
--- lld/ELF/Driver.cpp
+++ lld/ELF/Driver.cpp
@@ -124,6 +124,7 @@
StringSwitch<std::pair<ELFKind, uint16_t>>(S)
.Cases("aarch64elf", "aarch64linux", "aarch64_elf64_le_vec",
{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})
.Cases("elf32btsmip", "elf32btsmipn32", {ELF32BEKind, EM_MIPS})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58655.188278.patch
Type: text/x-patch
Size: 1789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190226/46eedf85/attachment.bin>
More information about the llvm-commits
mailing list