svn commit: r317719 - stable/11/contrib/elftoolchain/readelf

Ed Maste emaste at FreeBSD.org
Wed May 3 02:19:46 UTC 2017


Author: emaste
Date: Wed May  3 02:19:45 2017
New Revision: 317719
URL: https://svnweb.freebsd.org/changeset/base/317719

Log:
  MFC r309679 (cem): readelf -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.

Modified:
  stable/11/contrib/elftoolchain/readelf/readelf.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/elftoolchain/readelf/readelf.c
==============================================================================
--- stable/11/contrib/elftoolchain/readelf/readelf.c	Wed May  3 02:12:45 2017	(r317718)
+++ stable/11/contrib/elftoolchain/readelf/readelf.c	Wed May  3 02:19:45 2017	(r317719)
@@ -6643,13 +6643,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);


More information about the svn-src-stable mailing list