From nobody Sun Nov 26 04:07:51 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 4SdFYh1Q61z52kBC; Sun, 26 Nov 2023 04:07:52 +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 4SdFYh0pdLz3Fqc; Sun, 26 Nov 2023 04:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700971672; 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=yM7wOK9WrJ57RSdf91HebvuH5Vv4lDinIKGtuWezsHo=; b=gy6mUujRaAr1RXtz1rcQPKDmBkPncCuwCKUQ0j3v70RcsjQXZx/x5XlMfRlL+xfDtm7M8d IuBw90hAQVMWVl/at1+M/esY/wT30L5IsxSob4eeR0C3NYReZNTfcw5r0JshCiWXj6kEfr AhuL02RPxyeeJfNORSDPKHOLZl2W1C6wPRGkHsAjbSjKuR9Hpmxe4HpvBDFeAZfphZkLUM /guMEGZTk1iGdx/mAALROPd2aZxyl2PljSr3bxDypjXgLNFF7xiu0wD4B9dv4Dr7TIHCIM 48uy0nBGteC/WduYQQCjotmomsFCF11S+W3H9+8OnRxnmbeW1SBsA7gafh1fnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700971672; 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=yM7wOK9WrJ57RSdf91HebvuH5Vv4lDinIKGtuWezsHo=; b=D4KR3EmTWT+6AL4DGvY3voD83MPzBe/F6P6K1QETwC05OQk4L1gSKEbhu8mH9kQwSBTkBq 5f6YMjlTLU1j4bvZrF5Q2DFpafslHzTTTa5rPQZxKEdjd1tk9B+MXuvEo7rgGO7lKGJIja Zo5Mp6eRYiOZdTGlL7wn9Yw6W+vLtdiV+pWOrHin/YGvKf8v/ixyxj0dxSnDGUvU7clWPM EovL4Z1f5QirezZ8kMP70cEXxtMI4sE2qkXGvppCp1WPKPhNSQ6WThMjeSIkTFec0pgqyn 8zGKF7wUj8+hAJ+HDjuIEQ+9bA2VPUk1A5xLUNfnVrXGHHU/3b0N48W+sNm0tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700971672; a=rsa-sha256; cv=none; b=NqtmgnuuH+IBJFSMAFIGTsMJYa8jCmpahVCvYg1A0fbVMMLImx3tcDcfi9mthFsyIu+P6a dqZ6Hd7QLOo3A7Xpv42PYNR4QzOe+ugJCWmRq0oatK8MS6voxW3Aqoae6zfH5M+LuAE6qG YcZo4FdOXD0kPwnhF8OVT5z7a7TdzwlBgV0S8IwVN8f889ym06o2fEplQxxQ3cy2/T7XK3 V927oA5DqB70/rWzq4BeoAefo7LqTc2L+o6vnNjnGHmfqaHHs/PzKuKuLLmj2L/nWtlotV 1dca6XQfGPFcboo/V6QNshXpwWk3kFke0M+O1ArqqYT0nP4fp/xBAHWl9wB1SA== 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 4SdFYg6rngzh44; Sun, 26 Nov 2023 04:07:51 +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 3AQ47pBJ028545; Sun, 26 Nov 2023 04:07:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AQ47p8F028542; Sun, 26 Nov 2023 04:07:51 GMT (envelope-from git) Date: Sun, 26 Nov 2023 04:07:51 GMT Message-Id: <202311260407.3AQ47p8F028542@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: aaa3d65392f6 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: aaa3d65392f6844b9c6ed0a9692c715aaec32adf Auto-Submitted: auto-generated The branch stable/14 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=aaa3d65392f6844b9c6ed0a9692c715aaec32adf commit aaa3d65392f6844b9c6ed0a9692c715aaec32adf Author: Kyle Evans AuthorDate: 2023-11-10 04:33:58 +0000 Commit: Kyle Evans CommitDate: 2023-11-26 04:07:12 +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 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); }