aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/elfdump/elfdump.c
diff options
context:
space:
mode:
authorAndreas Tobler <andreast@FreeBSD.org>2014-07-26 19:44:45 +0000
committerAndreas Tobler <andreast@FreeBSD.org>2014-07-26 19:44:45 +0000
commit8edba45283e39bd98477e99b84abfcb2c0ff4ee7 (patch)
tree84046b8197701d32408ca0e7fd8442f26b71878c /usr.bin/elfdump/elfdump.c
parent1e0a021e3dae7d1885a947b9c353d64ad4c27c04 (diff)
downloadsrc-8edba45283e39bd98477e99b84abfcb2c0ff4ee7.tar.gz
src-8edba45283e39bd98477e99b84abfcb2c0ff4ee7.zip
Further improvements on elfdump, to follow up r269092:
- Add ARM specific section header types. - Add SHT_GNU_HASH section header type. - Improve reporting of undefined tags in d_tags. - Add DT_GNU_HASH tag. Reviewed by: emaste
Notes
Notes: svn path=/head/; revision=269143
Diffstat (limited to 'usr.bin/elfdump/elfdump.c')
-rw-r--r--usr.bin/elfdump/elfdump.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/usr.bin/elfdump/elfdump.c b/usr.bin/elfdump/elfdump.c
index 1ca356563e32..4ba4529e50d2 100644
--- a/usr.bin/elfdump/elfdump.c
+++ b/usr.bin/elfdump/elfdump.c
@@ -167,7 +167,10 @@ static int elf64_offsets[] = {
/* http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#tag_encodings */
static const char *
-d_tags(u_int64_t tag) {
+d_tags(u_int64_t tag)
+{
+ static char unknown_tag[48];
+
switch (tag) {
case 0: return "DT_NULL";
case 1: return "DT_NEEDED";
@@ -215,6 +218,7 @@ d_tags(u_int64_t tag) {
case 0x6ffffdfe: return "DT_SYMINSZ";
case 0x6ffffdff: return "DT_SYMINENT (DT_VALRNGHI)";
case 0x6ffffe00: return "DT_ADDRRNGLO";
+ case 0x6ffffef5: return "DT_GNU_HASH";
case 0x6ffffef8: return "DT_GNU_CONFLICT";
case 0x6ffffef9: return "DT_GNU_LIBLIST";
case 0x6ffffefa: return "DT_SUNW_CONFIG";
@@ -236,8 +240,10 @@ d_tags(u_int64_t tag) {
case 0x7ffffffd: return "DT_SUNW_AUXILIARY";
case 0x7ffffffe: return "DT_SUNW_USED";
case 0x7fffffff: return "DT_SUNW_FILTER";
- default: return "ERROR: TAG NOT DEFINED";
}
+ snprintf(unknown_tag, sizeof(unknown_tag),
+ "ERROR: TAG NOT DEFINED -- tag 0x%jx", (uintmax_t)tag);
+ return (unknown_tag);
}
static const char *
@@ -334,6 +340,7 @@ sh_types(uint64_t machine, uint64_t sht) {
switch (sht) {
case 0x6ffffff0: return "XXX:VERSYM";
case 0x6ffffff4: return "SHT_SUNW_dof";
+ case 0x6ffffff6: return "SHT_GNU_HASH";
case 0x6ffffff7: return "SHT_GNU_LIBLIST";
case 0x6ffffffc: return "XXX:VERDEF";
case 0x6ffffffd: return "SHT_SUNW(GNU)_verdef";
@@ -347,6 +354,15 @@ sh_types(uint64_t machine, uint64_t sht) {
} else if (sht < 0x80000000) {
/* 0x70000000-0x7fffffff processor-specific semantics */
switch (machine) {
+ case EM_ARM:
+ switch (sht) {
+ case 0x70000001: return "SHT_ARM_EXIDX";
+ case 0x70000002: return "SHT_ARM_PREEMPTMAP";
+ case 0x70000003: return "SHT_ARM_ATTRIBUTES";
+ case 0x70000004: return "SHT_ARM_DEBUGOVERLAY";
+ case 0x70000005: return "SHT_ARM_OVERLAYSECTION";
+ }
+ break;
case EM_MIPS:
switch (sht) {
case 0x7000000d: return "SHT_MIPS_OPTIONS";