From nobody Fri Nov 10 04:34:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SRQvY5Xlgz4yyy1; Fri, 10 Nov 2023 04:34:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SRQvY54Tvz4D4V; Fri, 10 Nov 2023 04:34:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699590857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vZOpSbNkFOMkwO3cLai/5p2uNhl9Eh3LBZcKs7ChZ0M=; b=CSCA8zdz8PJjn11SSeto4JIRYCXEXa15KvbB9WLP6MTAjPdVhF6rXZYad6z8oo3pA1Wn34 Gv66iBZdfXQnpI7Q9xBdOcCId6UhYuT/FmExxKxLPI4d5CsA60ml/Ip2xNN/9sY7L9d5dk AIKjouumAmx9KSgKTuD7UFRPBKOmXA8IxteXEW8G8wL9LonSELrJfnNTSuxj73Ts89b/9+ YKwY7iZuDd1wim7YfkHnzo/PMgtjQHiOMEh3SjmB1/xwMLXuKl3TkC02jbBlsT+7OeFwzr ODja5uqAEqRzdQKcAf+E9kAtfe/sRfHA6A6l4voXz3TCut14IFAtlhcAlEsV6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699590857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vZOpSbNkFOMkwO3cLai/5p2uNhl9Eh3LBZcKs7ChZ0M=; b=DYkO8s/sz7sknWEYUikktGerCYSy1Ei1nHI2l+1caBwmIkQ/tjnDSw15TPrfBIcHzRg34W SJdtXPcZWWvE1HzvibHltIAvISznrp/8xhVmhg21UUmkTZW1Ro8LpH5fQ5aBMeRqxHvWud ZPjhl/6dDN+f38+OXouox4xfC/kaRy6oyX6LK3Q6X4+V4TuyHOzg/4oNsAO/omeG6k8CSB bULmIlbxdSfdp1lTUFuripaJp3aRzTGlIgahSWGW065hFnChN/a9XkjfV7NZ18Y/M0XQCV FZISFG7jxJ0W7l4tFvAAOKNwZyhYJjN/f+yjfd/NRMb9HUbE3qLLOd1/RYvujA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699590857; a=rsa-sha256; cv=none; b=aHHNr9SBG+TAIVG8Va3AywpHjBec0cArfkE6WelBhtq7bwCFccD7ODW9IiMesMgRVlqaGz 2Xq1FBZhyG/eb/j+HENy24seAiGGooS9JcxoZc1o9m4qWJop18rBiiwIxrmOt4Lpsewxul 4fr6ZjQkDR/LR7vyK5i1g80WrkuNFH+y75TlDO26pJhmuPUChg+WZbVDRAGSyowsNuvkw4 lAKiShtF5XmpXqmj/uUg+/ka72YHbOs9s/VInLUY0v8LsQbIkz43sDvfeK/faC40bfBG/I 9ao9JItWaWbXgKfkNLoJvBEoHbt+2ELtzQQPoX0lk5SLV/hQqUzvbvmaAZ/DuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SRQvY49d6zkLM; Fri, 10 Nov 2023 04:34:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AA4YHe3067263; Fri, 10 Nov 2023 04:34:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AA4YHxC067260; Fri, 10 Nov 2023 04:34:17 GMT (envelope-from git) Date: Fri, 10 Nov 2023 04:34:17 GMT Message-Id: <202311100434.3AA4YHxC067260@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 8f2848eafa68 - main - crunchgen: fix "keep" for an ELF world, break it out List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f2848eafa682f1af629f8ee5e32fec607ab0ba1 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8f2848eafa682f1af629f8ee5e32fec607ab0ba1 commit 8f2848eafa682f1af629f8ee5e32fec607ab0ba1 Author: Kyle Evans AuthorDate: 2023-11-10 04:33:58 +0000 Commit: Kyle Evans CommitDate: 2023-11-10 04:33:58 +0000 crunchgen: fix "keep" for an ELF world, break it out "keep" currently adds a leading underscore, which hasn't been useful or accurate since a.out days. Preserve the symbol name as it's given rather than mangle it to match ELF-style symbol names. This was partially fixed back in 6cd35234a092d ("Assume ELF-style symbol names now.") for crunchgen, but the keeplist wasn't changed to match it. While we're here, break it out to bsd.crunchgen.mk for later use in bsdbox. Reviewed by: adrian, imp Differential Revision: https://reviews.freebsd.org/D42499 --- share/mk/bsd.crunchgen.mk | 4 ++++ usr.sbin/crunch/crunchgen/crunchgen.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/share/mk/bsd.crunchgen.mk b/share/mk/bsd.crunchgen.mk index 182ca387fe2b..bdbb6c5a22b0 100644 --- a/share/mk/bsd.crunchgen.mk +++ b/share/mk/bsd.crunchgen.mk @@ -18,6 +18,7 @@ # CRUNCH_SRCDIR_${P}: base source directory for program ${P} # CRUNCH_BUILDOPTS_${P}: additional build options for ${P} # CRUNCH_ALIAS_${P}: additional names to be used for ${P} +# CRUNCH_KEEP_${P}: additional symbols to keep for ${P} # # By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P} # will be used to generate a hard link to the resulting binary. @@ -101,6 +102,9 @@ ${CONF}: Makefile .ifdef CRUNCH_LIBS_${P} echo special ${P} lib ${CRUNCH_LIBS_${P}} >>${.TARGET} .endif +.ifdef CRUNCH_KEEP_${P} + echo special ${P} keep ${CRUNCH_KEEP_${P}} >>${.TARGET} +.endif .for A in ${CRUNCH_ALIAS_${P}} echo ln ${P} ${A} >>${.TARGET} .endfor diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c index dfde38ed0b70..7b5f892cffbe 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.c +++ b/usr.sbin/crunch/crunchgen/crunchgen.c @@ -1128,7 +1128,7 @@ prog_makefile_rules(FILE *outmk, prog_t *p) fprintf(outmk, "\n"); fprintf(outmk, "\tcrunchide -k _crunched_%s_stub ", p->ident); for (lst = p->keeplist; lst != NULL; lst = lst->next) - fprintf(outmk, "-k _%s ", lst->str); + fprintf(outmk, "-k %s ", lst->str); fprintf(outmk, "%s.lo\n", p->name); }