From owner-svn-src-all@freebsd.org Thu Nov 17 18:12:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB980C4712F; Thu, 17 Nov 2016 18:12:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7793DDB; Thu, 17 Nov 2016 18:12:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAHICHdH044674; Thu, 17 Nov 2016 18:12:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAHICHnZ044673; Thu, 17 Nov 2016 18:12:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201611171812.uAHICHnZ044673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 17 Nov 2016 18:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308772 - head/usr.sbin/crunch/crunchide 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.23 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: Thu, 17 Nov 2016 18:12:18 -0000 Author: emaste Date: Thu Nov 17 18:12:17 2016 New Revision: 308772 URL: https://svnweb.freebsd.org/changeset/base/308772 Log: crunchide: report explicit error for combined string table Some tools produce objects with a combined strtab and shstrtab. These objects are not supported by crunchide since it rewrites the symtab and strtab to "hide" symbols. This invalidates section header offsets into a combined strtab/shstrtab. In the future we could support these objects (by ensuring that we retain unmodified section name strings in the output .strtab, and then rewriting each section header's sh_name). MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- head/usr.sbin/crunch/crunchide/exec_elf32.c Thu Nov 17 18:10:08 2016 (r308771) +++ head/usr.sbin/crunch/crunchide/exec_elf32.c Thu Nov 17 18:12:17 2016 (r308772) @@ -279,6 +279,10 @@ ELFNAMEEND(hide)(int fd, const char *fn) weird = 1; weirdreason = "section header string table does not exist"; } + if (strtabshdr == shstrtabshdr) { + weird = 1; + weirdreason = "combined strtab and shstrtab not supported"; + } if (weirdreason == NULL) weirdreason = "unsupported"; if (weird) {