[llvm] [llvm-readobj][ELF] Print ELF e_entry in lowercase mode (PR #156683)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 3 07:45:35 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-binary-utilities
Author: Ádám Kallai (kaadam)
<details>
<summary>Changes</summary>
Currently llvm-readobj prints e_entry address in uppercase mode, however all other places such as 'symbols', 'relocs', the addresses are printed in lowercase mode. This PR aims to print the addresses in uniform manner.
Other use-case:
FileCheck comparison is case-sensitive by default, so if you would like to compare e_entry address with the same address in the symbol table it won't match by default.
---
Full diff: https://github.com/llvm/llvm-project/pull/156683.diff
1 Files Affected:
- (modified) llvm/tools/llvm-readobj/ELFDumper.cpp (+1-1)
``````````diff
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index a440bad130f4c..79a6ce1fd88b8 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -3640,7 +3640,7 @@ template <class ELFT> void GNUELFDumper<ELFT>::printFileHeaders() {
printFields(OS, "Machine:", Str);
Str = "0x" + utohexstr(e.e_version);
printFields(OS, "Version:", Str);
- Str = "0x" + utohexstr(e.e_entry);
+ Str = "0x" + utohexstr(e.e_entry, /*LowerCase=*/true);
printFields(OS, "Entry point address:", Str);
Str = to_string(e.e_phoff) + " (bytes into file)";
printFields(OS, "Start of program headers:", Str);
``````````
</details>
https://github.com/llvm/llvm-project/pull/156683
More information about the llvm-commits
mailing list