readelf(1) -S: Include zero index and match binutils' no-name
Include the SHN_UNDEF (zero) index special section in extended-attribute ELF files, like GNU binutils' readelf. Additionally, print "<no-name>" for sections without names, like GNU binutils. Reviewed by: kaiw@ Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8707
This commit is contained in:
parent
52b42f6287
commit
7dc45d65e3
@ -6557,13 +6557,14 @@ load_sections(struct readelf *re)
|
||||
}
|
||||
if ((name = elf_strptr(re->elf, shstrndx, sh.sh_name)) == NULL) {
|
||||
(void) elf_errno();
|
||||
name = "ERROR";
|
||||
name = "<no-name>";
|
||||
}
|
||||
if ((ndx = elf_ndxscn(scn)) == SHN_UNDEF) {
|
||||
if ((elferr = elf_errno()) != 0)
|
||||
if ((elferr = elf_errno()) != 0) {
|
||||
warnx("elf_ndxscn failed: %s",
|
||||
elf_errmsg(elferr));
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (ndx >= re->shnum) {
|
||||
warnx("section index of '%s' out of range", name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user