[PATCH] D72234: [llvm-readelf] Print EI_ABIVERSION as decimal instead of hexadecimal
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 5 15:04:23 PST 2020
MaskRay created this revision.
MaskRay added reviewers: grimar, jhenderson, rupprecht.
Herald added subscribers: llvm-commits, atanasyan, jrtc27, emaste.
Herald added a reviewer: espindola.
Herald added a reviewer: alexshap.
Herald added a project: LLVM.
This matches GNU readelf and llvm-readobj.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D72234
Files:
lld/test/ELF/mips-n32-rels.s
llvm/test/tools/llvm-objcopy/ELF/partitions.test
llvm/test/tools/llvm-readobj/ELF/file-header-abi-version.test
llvm/test/tools/llvm-readobj/ELF/gnu-file-headers.test
llvm/tools/llvm-readobj/ELFDumper.cpp
Index: llvm/tools/llvm-readobj/ELFDumper.cpp
===================================================================
--- llvm/tools/llvm-readobj/ELFDumper.cpp
+++ llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -3061,8 +3061,8 @@
OS << "\n";
Str = printEnum(e->e_ident[ELF::EI_OSABI], makeArrayRef(ElfOSABI));
printFields(OS, "OS/ABI:", Str);
- Str = "0x" + to_hexString(e->e_ident[ELF::EI_ABIVERSION]);
- printFields(OS, "ABI Version:", Str);
+ printFields(OS,
+ "ABI Version:", std::to_string(e->e_ident[ELF::EI_ABIVERSION]));
Str = printEnum(e->e_type, makeArrayRef(ElfObjectFileType));
printFields(OS, "Type:", Str);
Str = printEnum(e->e_machine, makeArrayRef(ElfMachineType));
Index: llvm/test/tools/llvm-readobj/ELF/gnu-file-headers.test
===================================================================
--- llvm/test/tools/llvm-readobj/ELF/gnu-file-headers.test
+++ llvm/test/tools/llvm-readobj/ELF/gnu-file-headers.test
@@ -14,7 +14,7 @@
# I386-NEXT: Data: 2's complement, little endian
# I386-NEXT: Version: 1 (current)
# I386-NEXT: OS/ABI: UNIX - System V
-# I386-NEXT: ABI Version: 0x0
+# I386-NEXT: ABI Version: 0
# I386-NEXT: Type: REL (Relocatable file)
# I386-NEXT: Machine: Intel 80386
# I386-NEXT: Version: 0x1
@@ -57,7 +57,7 @@
# X86-64-NEXT: Data: 2's complement, little endian
# X86-64-NEXT: Version: 1 (current)
# X86-64-NEXT: OS/ABI: UNIX - System V
-# X86-64-NEXT: ABI Version: 0x0
+# X86-64-NEXT: ABI Version: 0
# X86-64-NEXT: Type: REL (Relocatable file)
# X86-64-NEXT: Machine: Advanced Micro Devices X86-64
# X86-64-NEXT: Version: 0x1
@@ -101,7 +101,7 @@
# MIPSEL-NEXT: Data: 2's complement, little endian
# MIPSEL-NEXT: Version: 1 (current)
# MIPSEL-NEXT: OS/ABI: UNIX - System V
-# MIPSEL-NEXT: ABI Version: 0x0
+# MIPSEL-NEXT: ABI Version: 0
# MIPSEL-NEXT: Type: REL (Relocatable file)
# MIPSEL-NEXT: Machine: MIPS R3000
# MIPSEL-NEXT: Version: 0x1
Index: llvm/test/tools/llvm-readobj/ELF/file-header-abi-version.test
===================================================================
--- llvm/test/tools/llvm-readobj/ELF/file-header-abi-version.test
+++ llvm/test/tools/llvm-readobj/ELF/file-header-abi-version.test
@@ -14,13 +14,13 @@
# RUN: llvm-readelf --file-headers %t.abiver.max | FileCheck %s --match-full-lines --check-prefix=ABIVER-MAX-GNU
# ABIVER-ZERO-LLVM: ABIVersion: 0
-# ABIVER-ZERO-GNU: ABI Version: 0x0
+# ABIVER-ZERO-GNU: ABI Version: 0
# ABIVER-ANY-LLVM: ABIVersion: 52
-# ABIVER-ANY-GNU: ABI Version: 0x34
+# ABIVER-ANY-GNU: ABI Version: 52
# ABIVER-MAX-LLVM: ABIVersion: 255
-# ABIVER-MAX-GNU: ABI Version: 0xFF
+# ABIVER-MAX-GNU: ABI Version: 255
--- !ELF
FileHeader:
Index: llvm/test/tools/llvm-objcopy/ELF/partitions.test
===================================================================
--- llvm/test/tools/llvm-objcopy/ELF/partitions.test
+++ llvm/test/tools/llvm-objcopy/ELF/partitions.test
@@ -17,7 +17,7 @@
MAIN-NEXT: Data: 2's complement, little endian
MAIN-NEXT: Version: 1 (current)
MAIN-NEXT: OS/ABI: UNIX - System V
-MAIN-NEXT: ABI Version: 0x0
+MAIN-NEXT: ABI Version: 0
MAIN-NEXT: Type: EXEC (Executable file)
MAIN-NEXT: Machine: Advanced Micro Devices X86-64
MAIN-NEXT: Version: 0x1
Index: lld/test/ELF/mips-n32-rels.s
===================================================================
--- lld/test/ELF/mips-n32-rels.s
+++ lld/test/ELF/mips-n32-rels.s
@@ -51,7 +51,7 @@
# ELF: Data: 2's complement, big endian
# ELF: Version: 1 (current)
# ELF: OS/ABI: UNIX - System V
-# ELF: ABI Version: 0x0
+# ELF: ABI Version: 0
# ELF: Type: EXEC (Executable file)
# ELF: Machine: MIPS R3000
# ELF: Version: 0x1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72234.236266.patch
Type: text/x-patch
Size: 4618 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200105/33018953/attachment.bin>
More information about the llvm-commits
mailing list