From nobody Sun Nov 26 04:08:00 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 4SdFYr6BXcz52kVL; Sun, 26 Nov 2023 04:08:00 +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 4SdFYr5Z3Cz3GMV; Sun, 26 Nov 2023 04:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700971680; 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=c3l5EdLJ6o3ld7qvNkN4InLGlGXEI7SyArcT7R6Toyg=; b=gj1ogVUaQisEzwkCTkLul9AFSrr2A9LXvPKf7Z58neVhIrXpXEMF+o2gUUVP6Ffkhoe2gc 7hCa7FEO2gSm2WSx3VTTVziYSlQGhPG8nyMWzdSdw7ItLBNeFAuI+l//vp3RuXhYZ/xwlt r5niapMynlWK7uvivdjpo9/sJrvynu55yKkg+LIL8DPsLUhDZUgg/nYl12ALUub3af1ZDq X9ambOz6Ev7x0Q3HiaY2ME3woe/rfJJNxiQEs+iVmpvE4PNHtUKlAd0t8Dtb59q3cBNQuT mWxcPlIVoBG44IonoBWdU02G3DN3CwM7JadENov0sBTcLfA2uoBYJg7xAURptg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700971680; 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=c3l5EdLJ6o3ld7qvNkN4InLGlGXEI7SyArcT7R6Toyg=; b=MjRslXwAk7sPk8tQmfV8okWcs5rWrGOW3/g52sakuo4Frw6Nz9JDxvtdLyj5kiXlhDYI8L zkM3gO43p92OBOD1F1YmWDFdmFq5gpd0UD38NEBu7YRVcJROd1YQ+J/zNtir26dcpPKc01 XosMxxb9emppnvBrKeDtoKiD85t/tgUKgc3v0QemsjSlG0Qx73v80zfZ4qmBr2Cf7fyZop ObuG7y6AbukBjowP/qDLXvJU1DIW5Wzn8Sxz1dOARGGf5gnqdjlIc/FlO2MWYPWkwH6hmr /RA8E8DEssYebeqk2Ur465JUEUUeUn6EiIWf0zNcPe6DTRHDWuok/2DhfrMxDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700971680; a=rsa-sha256; cv=none; b=vGzR1zSP9xySoICCBDBy7oEg599x/wkUn+qQE6sptgXcW1hl8g5X1vU/YVHo8y1N8WDKcc kndprHDycmL0Nx1G1uTRs0RxjdHHFmBJysX1WMxIfSei32LXvu66AVja+VD3enVSDZOk62 CNsbQvK4y4R/qyRvTfzZJfxQVatyBICSfixjMbpcFjNv7Cf/j/sVE/zHLc3iFc5/OytTKw Qk9G7GKQsjp4m0+mauhal6/zn3pL5/T/s5jqK8iPn0rnOAcPdmjTJUzLjWR0qRP6CJ3VqY gHaQJ1lmcmv6BGU3++c845kTRU+0Gh81tIue+pPo0VnIpQ2r1qIlbyy4WCCw0A== 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 4SdFYr4J1Pzh45; Sun, 26 Nov 2023 04:08:00 +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 3AQ480F4028970; Sun, 26 Nov 2023 04:08:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AQ480tR028967; Sun, 26 Nov 2023 04:08:00 GMT (envelope-from git) Date: Sun, 26 Nov 2023 04:08:00 GMT Message-Id: <202311260408.3AQ480tR028967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: faf527b73013 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: faf527b73013b6505144cba9d8fc1a64ff1f3e81 Auto-Submitted: auto-generated The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=faf527b73013b6505144cba9d8fc1a64ff1f3e81 commit faf527b73013b6505144cba9d8fc1a64ff1f3e81 Author: Kyle Evans AuthorDate: 2023-11-10 04:33:58 +0000 Commit: Kyle Evans CommitDate: 2023-11-26 04:07:17 +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 (cherry picked from commit 8f2848eafa682f1af629f8ee5e32fec607ab0ba1) --- 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 2065541b354c..2315b139b8b6 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.c +++ b/usr.sbin/crunch/crunchgen/crunchgen.c @@ -1142,7 +1142,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); }