From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QSM0E9K6q2rKHBYAWB0awg (envelope-from ) for ; Thu, 17 Sep 2026 06:02:58 -0400 Received: by simark.ca (Postfix, from userid 112) id 426331E06B; Thu, 17 Sep 2026 06:02:58 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4CFDB1E01F for ; Thu, 17 Sep 2026 06:02:56 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 483004BA23FD for ; Thu, 17 Sep 2026 10:02:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 483004BA23FD Received: from arjuna.pair.com (arjuna.pair.com [209.68.5.131]) by sourceware.org (Postfix) with ESMTPS id 1417D4B9DB56; Thu, 17 Sep 2026 10:02:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1417D4B9DB56 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bitrange.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bitrange.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1417D4B9DB56 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.68.5.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789639350; cv=none; b=jdDDrmyRE1qPCPSEinEhJyJ79bZmdKvGJiQoJMM7bRLbqC2dE7V93gd8U7EJwNrIH/JXNE3XETpJ3InwkBkV38h9qRkNovS3vdx33LEDJI8RsWtFWOQTbMkKpYQK1L2ORq9/PEgtr7btU5h0AdIe/qjXwphe8DjoCHCwBMb4998= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789639350; c=relaxed/simple; bh=cQ1Sjo4o1OjsRNKOhCdZ7uqka9q3caryz3rTgVYM5e0=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=HRuoxQCh2dJiTL7NnMEcXwOYZVCzacwuYDJPlhzYxVq7PTvsrqxDAMQXTMIypcsgQ6bu13l0yvDUa0cWkejo+2p8MWYh6RzaBc5u7QIejrVJUvdKT6s9Vcy9MPE31nm54rzPzdSYH3Mey82XnWk3PxEuca6OK9EtiGjUj8yZ+Zk= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1417D4B9DB56 Received: by arjuna.pair.com (Postfix, from userid 3006) id AFFC11A12E1; Thu, 17 Sep 2026 06:02:25 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by arjuna.pair.com (Postfix) with ESMTP id AA6CC19C1A0; Thu, 17 Sep 2026 06:02:25 -0400 (EDT) Date: Thu, 17 Sep 2026 06:02:25 -0400 (EDT) From: Hans-Peter Nilsson X-X-Sender: hp@arjuna.pair.com To: Jan Dubiec cc: Simon Marchi , Jan Beulich , binutils@sourceware.org, gdb-patches@sourceware.org, Alan Modra Subject: Re: [PATCH v3] h8300-elf: ld: Use USER_LABEL_PREFIX when generating linker scripts [REPOST] In-Reply-To: <7329cb3c-d8a4-40db-bb7e-745f8ea9d95e@o2.pl> Message-ID: References: <20260823201052.1569259-1-jdx@o2.pl> <78e8d2e7-7ed5-4b56-af05-28177f85d63d@simark.ca> <7329cb3c-d8a4-40db-bb7e-745f8ea9d95e@o2.pl> User-Agent: Alpine 2.20.16 (BSF 172 2016-09-29) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Scanned-By: mailmunge 3.09 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On Thu, 17 Sep 2026, Jan Dubiec wrote: > On 16.09.2026 16:58, Simon Marchi wrote: > [...]> Looks like the change was OK'ed by the relevant people. However, could > > you please make the commit message actually describe the change? > > > > Thanks, > > > > Simon > > I am not sure how the commit message should be posted, so here it is. The usual way is that you, after editing the commit message and amending the commit, send it together with the rest of the patch, in form of an in-line copy of the file generated by "git format-patch [...]". But the below works and LGTM, so ok. > I hope > it will not be a problem for whoever commits the patch to copy and paste the > message below. Oh, you don't have commit rights. I'll do it, if no-one beats me to it. brgds, H-P > > /J.D. > > -------------------------- CUT HERE ---------------------------------- > This patch is a spin-off from the following thread: > https://inbox.sourceware.org/newlib/CAOox84s_SjpbEZsAx9EprDrTxB-bT0pgbavt8NXY7iiph8h6Vg@mail.gmail.com/T/#t > . > > Bare-metal h8300-elf-gcc sets USER_LABEL_PREFIX: > https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/h8300/elf.h;hb=HEAD. > Strangely, ld does not. As a result, ld exports symbols without > a leading underscore, while GCC expects them to have one. For example: > > linker scirpt: > [...] > PROVIDE_HIDDEN (__preinit_array_start = .); > [...] > > C source code (the compiler adds 3rd underscore): > [...] > extern void (*__preinit_array_start []) (void) __attribute__((weak)); > [...] > > This can lead to sneaky bugs when the symbol is declared as weak. It > also creates maintenance issues when the C code is intended to be > portable across multiple platforms. > > The patch defines USER_LABEL_PREFIX accordingly and updates the linker > and H8/300 simulator test cases to reflect this change. > > The corresponding newlib patch has already been posted and accepted: > https://inbox.sourceware.org/newlib/20260822001114.1564261-1-jdx@o2.pl/T/#u. > > Signed-off-by: Jan Dubiec > -------------------------- CUT HERE ---------------------------------- > >