From patchwork Fri Jan 26 15:21:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Busch-George X-Patchwork-Id: 1891466 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=RAZxhhM2; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=georgemail.eu header.i=@georgemail.eu header.a=rsa-sha256 header.s=DKIM001 header.b=ETnk6Kvx; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=198.137.202.133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TM1dj31q1z23gC for ; Sat, 27 Jan 2024 02:22:17 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6g4UWcIrX5TJr96AC+OrZXcBqt1XPPEC0eg7X47/EEs=; b=RAZxhhM2TsoKzI jrXM7t4JZUSbv367xagfaNTyO1CZ4F16x/2JhGdfNGYQTBXVrw+OiGYNWh+lDH7b6rJ/++98ylVxH ReUKq/1mrWokye8g/y7wOFOhnq2gNOfSc162CpmVd+nyeDFX35D8v/dh7xFmVYjYR2HgegPVzxm2E fGk7XaM2DVkbxOWXKzK47D8Hdy7Iz5zZoQgKABXjKz1ZKJZQYf2BpJMJhwPlnYqM/BhUtgryZ8j5o tSAsTPr3UxNUnY5OUuaPY570v6Ew24lE3wP8ZlZ9nSLRl2zqNEWtmYy0xLeUbIB9cSTzXGOs20TyL nmZPlPGKBzzRjHSj9UFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTO1v-00000004Vft-2ppQ; Fri, 26 Jan 2024 15:22:07 +0000 Received: from smtp5.goneo.de ([2001:1640:5::8:30] helo=smtp052.goneo.de) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTO1s-00000004Veu-0eAD for opensbi@lists.infradead.org; Fri, 26 Jan 2024 15:22:06 +0000 Received: from hub2.goneo.de (hub2.goneo.de [IPv6:2001:1640:5::8:53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp5.goneo.de (Postfix) with ESMTPS id 4EF87240C6D; Fri, 26 Jan 2024 16:21:55 +0100 (CET) Received: from hub2.goneo.de (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPS id B54A8240CEC; Fri, 26 Jan 2024 16:21:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=georgemail.eu; s=DKIM001; t=1706282513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=3r85lAeD39qT/FvinzZ5794zEbJYkyoko8mu93VaJ+A=; b=ETnk6KvxejId5VOZkTkwOwm03iUIXGzhfEQVRI2XivFIducpKZtDuRLryCKQcLNVUILUDe 3hVnqxtJC+sPLfLnh9L67/x6NyHwAljFXsUKoIfwgz4eooW6yVDyZND42OOnI7rPvfsWSc cUV7U70kYPFyI0J2UYCHqpjWam8/HFLKWP5Qm4jTozB0F4vbGmHlixNp33BWm5xlnr4uPt j/lIlmEjTMwmggDyTrBw4558Wzgt9jppY8onwXF23i0hrbTr5pjtK6++qMDEPIZXpEu0p9 Pr6PGfgN4/j5+rlpH8YHlwekTZZrAIdh1qXpCCzUn1GOpDjQthVTWffgZs8RjQ== Received: from ludix.fritz.box (unknown [IPv6:2a02:8071:5250:1240:fb21:488b:1549:7f9c]) (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) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPSA id 7A9F02403AA; Fri, 26 Jan 2024 16:21:53 +0100 (CET) From: "Leon M. Busch-George" To: opensbi@lists.infradead.org Cc: "Leon M. Busch-George" Subject: [PATCH 1/2] check for --exclude-libs Date: Fri, 26 Jan 2024 16:21:24 +0100 Message-ID: <20240126152145.60488-1-leon@georgemail.eu> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Rspamd-UID: ce5348 X-Rspamd-UID: e71387 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240126_072204_934689_D3703ECC X-CRM114-Status: UNSURE ( 7.56 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: While writing to the dynsym is futile, the --exclude-libs options is not recognized by all linkers (e.g. riscv64-elf-ld.bfd) --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index de4e73a..630e35f 100644 --- a/Makefile +++ b/Makefile @@ -167,6 +167,9 @@ endif # Check whether the linker supports creating PIEs OPENSBI_LD_PIE := $(shell $(CC) [...] Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2001:1640:5:0:0:0:8:30 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org While writing to the dynsym is futile, the --exclude-libs options is not recognized by all linkers (e.g. riscv64-elf-ld.bfd) Reviewed-by: Anup Patel --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index de4e73a..630e35f 100644 --- a/Makefile +++ b/Makefile @@ -167,6 +167,9 @@ endif # Check whether the linker supports creating PIEs OPENSBI_LD_PIE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) $(USE_LD_FLAG) -fPIE -nostdlib -Wl,-pie -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo y || echo n) +# Check whether the linker supports --exclude-libs +OPENSBI_LD_EXCLUDE_LIBS := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) $(USE_LD_FLAG) "-Wl,--exclude-libs,ALL" -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo y || echo n) + # Check whether the compiler supports -m(no-)save-restore CC_SUPPORT_SAVE_RESTORE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -mno-save-restore -x c /dev/null -o /dev/null 2>&1 | grep -e "-save-restore" >/dev/null && echo n || echo y) @@ -375,7 +378,9 @@ ASFLAGS += $(firmware-asflags-y) ARFLAGS = rcs ELFFLAGS += $(USE_LD_FLAG) +ifeq ($(OPENSBI_LD_EXCLUDE_LIBS),y) ELFFLAGS += -Wl,--exclude-libs,ALL +endif ELFFLAGS += -Wl,--build-id=none ELFFLAGS += $(platform-ldflags-y) ELFFLAGS += $(firmware-ldflags-y)