summaryrefslogtreecommitdiffstats
path: root/contrib/elftoolchain/readelf/readelf.c
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-01-02 20:49:43 +0000
committeremaste <emaste@FreeBSD.org>2015-01-02 20:49:43 +0000
commitd0987293c184ec842e00ce78f7d0e0e269a5b47e (patch)
tree18abf588f167f1a7c5a31d8cd6b53dd2e85bcc57 /contrib/elftoolchain/readelf/readelf.c
parentd7781b68234b8e34e7704a324a38ec29059c6fc9 (diff)
downloadFreeBSD-src-d0987293c184ec842e00ce78f7d0e0e269a5b47e.zip
FreeBSD-src-d0987293c184ec842e00ce78f7d0e0e269a5b47e.tar.gz
readelf: Correct rounding on note padding
In general 64-bit ELF notes use 4-byte padding, not 8, despite what is claimed in various specs. Upstream elftoolchain ticket 472 https://sourceforge.net/p/elftoolchain/tickets/472/ Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'contrib/elftoolchain/readelf/readelf.c')
-rw-r--r--contrib/elftoolchain/readelf/readelf.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c
index dac20aa..764e94d 100644
--- a/contrib/elftoolchain/readelf/readelf.c
+++ b/contrib/elftoolchain/readelf/readelf.c
@@ -1492,6 +1492,7 @@ note_type(unsigned int osabi, unsigned int et, unsigned int nt)
return "NT_FPREGSET (Floating point information)";
case NT_PRPSINFO:
return "NT_PRPSINFO (Process information)";
+#if 0
case NT_AUXV:
return "NT_AUXV (Auxiliary vector)";
case NT_PRXFPREG:
@@ -1506,12 +1507,14 @@ note_type(unsigned int osabi, unsigned int et, unsigned int nt)
return "NT_LWPSTATUS (Linux lwpstatus_t type)";
case NT_LWPSINFO:
return "NT_LWPSINFO (Linux lwpinfo_t type)";
+#endif
default:
snprintf(s_nt, sizeof(s_nt), "<unknown: %u>", nt);
return (s_nt);
}
} else {
switch (nt) {
+#if 0
case NT_ABI_TAG:
switch (osabi) {
case ELFOSABI_FREEBSD:
@@ -1529,11 +1532,13 @@ note_type(unsigned int osabi, unsigned int et, unsigned int nt)
return "NT_GNU_BUILD_ID (Build id set by ld(1))";
case NT_GNU_GOLD_VERSION:
return "NT_GNU_GOLD_VERSION (GNU gold version)";
+#endif
default:
snprintf(s_nt, sizeof(s_nt), "<unknown: %u>", nt);
return (s_nt);
}
}
+ (void)osabi;
}
static struct {
@@ -3592,13 +3597,8 @@ dump_notes_content(struct readelf *re, const char *buf, size_t sz, off_t off)
(uintmax_t) note->n_descsz);
printf(" %s\n", note_type(re->ehdr.e_ident[EI_OSABI],
re->ehdr.e_type, note->n_type));
- buf += sizeof(Elf_Note);
- if (re->ec == ELFCLASS32)
- buf += roundup2(note->n_namesz, 4) +
- roundup2(note->n_descsz, 4);
- else
- buf += roundup2(note->n_namesz, 8) +
- roundup2(note->n_descsz, 8);
+ buf += sizeof(Elf_Note) + roundup2(note->n_namesz, 4) +
+ roundup2(note->n_descsz, 4);
}
}
OpenPOWER on IntegriCloud