From owner-svn-src-all@freebsd.org Wed Apr 20 19:13:01 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 F05FEB16E63; Wed, 20 Apr 2016 19:13:01 +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 C0FE716F5; Wed, 20 Apr 2016 19:13:01 +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 u3KJD0P1052590; Wed, 20 Apr 2016 19:13:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3KJD0rr052589; Wed, 20 Apr 2016 19:13:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604201913.u3KJD0rr052589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 Apr 2016 19:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298361 - head/contrib/elftoolchain/elfcopy 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.21 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: Wed, 20 Apr 2016 19:13:02 -0000 Author: emaste Date: Wed Apr 20 19:13:00 2016 New Revision: 298361 URL: https://svnweb.freebsd.org/changeset/base/298361 Log: elfcopy: map all !alnum characters to '_' in binary input symbol names This matches bfd and gold. Obtained from: ELF Tool Chain r3445 Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/elfcopy/binary.c Modified: head/contrib/elftoolchain/elfcopy/binary.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/binary.c Wed Apr 20 18:48:39 2016 (r298360) +++ head/contrib/elftoolchain/elfcopy/binary.c Wed Apr 20 19:13:00 2016 (r298361) @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -213,9 +214,9 @@ create_elf_from_binary(struct elfcopy *e if ((sym_basename = strdup(ifn)) == NULL) err(1, "strdup"); - p = sym_basename; - while ((p = strchr(p, '.')) != NULL) - *p++ = '_'; + for (p = sym_basename; *p != '\0'; p++) + if (!isalnum(*p)) + *p = '_'; #define _GEN_SYMNAME(S) do { \ snprintf(name, sizeof(name), "%s%s%s", "_binary_", sym_basename, S); \ } while (0)