summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2022-02-10 22:38:55 +0100
committerAndreas Kling <kling@serenityos.org>2022-02-11 18:07:53 +0100
commit10c629055f8efaad37b82cda6a4da62723fe68f4 (patch)
treeeafbb178594b5ceaf0d87a7dbeb627bf3a41dd35 /Userland/Utilities
parent3974cac148ff12f04fd98fa3a1c4578767988897 (diff)
downloadserenity-10c629055f8efaad37b82cda6a4da62723fe68f4.zip
Utilities/readelf: Add printing for RELR relocations
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/readelf.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Userland/Utilities/readelf.cpp b/Userland/Utilities/readelf.cpp
index 1946ee3c47..c3183af64c 100644
--- a/Userland/Utilities/readelf.cpp
+++ b/Userland/Utilities/readelf.cpp
@@ -102,6 +102,8 @@ static const char* object_section_header_type_to_string(ElfW(Word) type)
return "GROUP";
case SHT_SYMTAB_SHNDX:
return "SYMTAB_SHNDX";
+ case SHT_RELR:
+ return "RELR";
case SHT_LOOS:
return "SOOS";
case SHT_SUNW_dof:
@@ -534,6 +536,16 @@ int main(int argc, char** argv)
outln();
});
}
+
+ outln();
+
+ size_t relr_count = 0;
+ object->for_each_relr_relocation([&relr_count](auto) { ++relr_count; });
+ if (relr_count != 0) {
+ outln("Relocation section '.relr.dyn' at offset {:#08x} contains {} entries:", object->relr_relocation_section().offset(), object->relr_relocation_section().entry_count());
+ outln("{:>8x} offsets", relr_count);
+ object->for_each_relr_relocation([](auto offset) { outln("{:p}", offset); });
+ }
} else {
outln("No relocations in this file.");
}