[llvm] [llvm-readelf] Print ARM specific OSABI values in GNU mode (PR #82186)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 18 11:28:21 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-binary-utilities
Author: Fangrui Song (MaskRay)
<details>
<summary>Changes</summary>
Similar to #<!-- -->75661. Currently, there is only ELFOSABI_ARM, but I plan to
add ELFOSABI_ARM_FDPIC in a subsequent patch.
---
Full diff: https://github.com/llvm/llvm-project/pull/82186.diff
2 Files Affected:
- (modified) llvm/test/tools/llvm-readobj/ELF/file-header-os-abi.test (+1-1)
- (modified) llvm/tools/llvm-readobj/ELFDumper.cpp (+3)
``````````diff
diff --git a/llvm/test/tools/llvm-readobj/ELF/file-header-os-abi.test b/llvm/test/tools/llvm-readobj/ELF/file-header-os-abi.test
index f815e78e0c540b..eb60d2a021af63 100644
--- a/llvm/test/tools/llvm-readobj/ELF/file-header-os-abi.test
+++ b/llvm/test/tools/llvm-readobj/ELF/file-header-os-abi.test
@@ -190,7 +190,7 @@ FileHeader:
# RUN: llvm-readelf --file-headers %t.osabi.arm | FileCheck %s --match-full-lines --check-prefix=OSABI-ARM-GNU
# OSABI-ARM-LLVM: OS/ABI: ARM (0x61)
-# OSABI-ARM-GNU: OS/ABI: 61
+# OSABI-ARM-GNU: OS/ABI: ARM
## Check all EM_TI_C6000 specific values.
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index 50ea63e87a43be..fa39e04f4ce9c0 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -3553,6 +3553,9 @@ template <class ELFT> void GNUELFDumper<ELFT>::printFileHeaders() {
if (e.e_ident[ELF::EI_OSABI] >= ELF::ELFOSABI_FIRST_ARCH &&
e.e_ident[ELF::EI_OSABI] <= ELF::ELFOSABI_LAST_ARCH) {
switch (e.e_machine) {
+ case ELF::EM_ARM:
+ OSABI = ArrayRef(ARMElfOSABI);
+ break;
case ELF::EM_AMDGPU:
OSABI = ArrayRef(AMDGPUElfOSABI);
break;
``````````
</details>
https://github.com/llvm/llvm-project/pull/82186
More information about the llvm-commits
mailing list