Skip to content

Commit

Permalink
[llvm-objdump] Support PLT decoding for aarch64_be
Browse files Browse the repository at this point in the history
Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D96211
  • Loading branch information
MaskRay committed Feb 8, 2021
1 parent 7e20a41 commit 157ac42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions llvm/lib/Object/ELFObjectFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ ELFObjectFileBase::getPltAddresses() const {
JumpSlotReloc = ELF::R_X86_64_JUMP_SLOT;
break;
case Triple::aarch64:
case Triple::aarch64_be:
JumpSlotReloc = ELF::R_AARCH64_JUMP_SLOT;
break;
default:
Expand Down
8 changes: 5 additions & 3 deletions llvm/test/tools/llvm-objdump/ELF/AArch64/plt.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
# CHECK: bl {{.*}} <__cfi_slowpath@plt>

# RUN: yaml2obj %s -o %t.aarch64
# RUN: llvm-objdump -d --mattr=+bti %t.aarch64 | \
# RUN: FileCheck --check-prefix=CHECK-BTI %s
# RUN: llvm-objdump -d --mattr=+bti %t.aarch64 | FileCheck --check-prefix=CHECK-BTI %s
# RUN: yaml2obj -DENDIAN=MSB %s -o %t.aarch64_be
# RUN: llvm-objdump -d --mattr=+bti %t.aarch64_be | FileCheck --check-prefix=CHECK-BTI %s
# CHECK-BTI: bl {{.*}} <f1@plt>
# CHECK-BTI: bl {{.*}} <f2@plt>
# CHECK-BTI: Disassembly of section .plt:
Expand All @@ -34,7 +35,7 @@
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Data: ELFDATA2[[ENDIAN=LSB]]
Type: ET_EXEC
Machine: EM_AARCH64
Sections:
Expand Down Expand Up @@ -62,6 +63,7 @@ Sections:
Content: 5F2403D5F07BBFA910010090110A40F91042009120021FD61F2003D51F2003D55F2403D510010090110E40F9106200919F2103D520021FD65F2403D510010090111240F9108200919F2103D520021FD6
- Name: .got.plt
Type: SHT_PROGBITS
## The content is in little-endian, but it does not affect aarch64_be PLT decoding.
Content: '000000000000000000000000000000000000000000000000100021000000000010002100000000001000210000000000'
Symbols:
- Name: f1
Expand Down

0 comments on commit 157ac42

Please sign in to comment.