From owner-svn-src-all@FreeBSD.ORG Fri Jan 2 20:49:44 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E671A9B; Fri, 2 Jan 2015 20:49:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51442119B; Fri, 2 Jan 2015 20:49:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t02KniF3036851; Fri, 2 Jan 2015 20:49:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t02Kni1P036850; Fri, 2 Jan 2015 20:49:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201501022049.t02Kni1P036850@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 2 Jan 2015 20:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r276567 - head/contrib/elftoolchain/readelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2015 20:49:44 -0000 Author: emaste Date: Fri Jan 2 20:49:43 2015 New Revision: 276567 URL: https://svnweb.freebsd.org/changeset/base/276567 Log: 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 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri Jan 2 20:47:52 2015 (r276566) +++ head/contrib/elftoolchain/readelf/readelf.c Fri Jan 2 20:49:43 2015 (r276567) @@ -1492,6 +1492,7 @@ note_type(unsigned int osabi, unsigned i 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 i 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), "", 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 i 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), "", nt); return (s_nt); } } + (void)osabi; } static struct { @@ -3592,13 +3597,8 @@ dump_notes_content(struct readelf *re, c (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); } }