[llvm] ee068aa - [llvm-readelf] - Do not treat SHT_ANDROID_RELR sections the same as SHT_RELR.
Georgii Rymar via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 28 01:25:13 PDT 2020
Author: Georgii Rymar
Date: 2020-07-28T11:24:58+03:00
New Revision: ee068aafbc5c6722158d5113290a211503e1cfe4
URL: https://github.com/llvm/llvm-project/commit/ee068aafbc5c6722158d5113290a211503e1cfe4
DIFF: https://github.com/llvm/llvm-project/commit/ee068aafbc5c6722158d5113290a211503e1cfe4.diff
LOG: [llvm-readelf] - Do not treat SHT_ANDROID_RELR sections the same as SHT_RELR.
Currently, when dumping section headers, llvm-readelf
prints "RELR" for SHT_ANDROID_RELR/SHT_RELR sections.
The behavior was introduced in D47919 and revealed in D84330.
But "SHT_ANDROID_RELR" has a different value from "SHT_RELR".
Also, "SHT_ANDROID_REL/SHT_ANDROID_RELA" are printed as "ANDROID_REL/ANDROID_RELA",
what makes the handling of the "SHT_ANDROID_RELR" inconsistent.
This patch makes llvm-readelf to print "ANDROID_RELR" instead of "RELR".
Differential revision: https://reviews.llvm.org/D84393
Added:
Modified:
llvm/test/tools/llvm-readobj/ELF/section-types.test
llvm/tools/llvm-readobj/ELFDumper.cpp
Removed:
################################################################################
diff --git a/llvm/test/tools/llvm-readobj/ELF/section-types.test b/llvm/test/tools/llvm-readobj/ELF/section-types.test
index 8718f5894c68..edbc59772f88 100644
--- a/llvm/test/tools/llvm-readobj/ELF/section-types.test
+++ b/llvm/test/tools/llvm-readobj/ELF/section-types.test
@@ -110,7 +110,7 @@
# GNU-NEXT: relr RELR
# GNU-NEXT: android_rel ANDROID_REL
# GNU-NEXT: android_rela ANDROID_RELA
-# GNU-NEXT: android_relr RELR
+# GNU-NEXT: android_relr ANDROID_RELR
# GNU-NEXT: llvm_odrtab LLVM_ODRTAB
# GNU-NEXT: linker_options LLVM_LINKER_OPTIONS
# GNU-NEXT: llvm_call_graph_profile LLVM_CALL_GRAPH_PROFILE
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index 16270cb0f58c..72dcb9c5a15a 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -3757,11 +3757,6 @@ static std::string getSectionTypeString(unsigned Machine, unsigned Type) {
if (Name == "SHT_SYMTAB_SHNDX")
return "SYMTAB SECTION INDICES";
- // The SHT_ANDROID_RELR is special, all other SHT_ANDROID_* types are handled
- // in the common block below.
- if (Name == "SHT_ANDROID_RELR")
- return "RELR";
-
if (Name.startswith("SHT_"))
return Name.drop_front(4).str();
return getSectionTypeOffsetString(Type);
More information about the llvm-commits
mailing list