From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +Qj/DhmXq2rSkBUAWB0awg (envelope-from ) for ; Thu, 17 Sep 2026 03:30:33 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.a=rsa-sha256 header.s=20241105 header.b=YmtgH6yq; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 21F1A1E06B; Thu, 17 Sep 2026 03:30:33 -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.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 DD9101E01F for ; Thu, 17 Sep 2026 03:30:30 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 724B24B9DB4E for ; Thu, 17 Sep 2026 07:30:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 724B24B9DB4E Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=o2.pl header.i=@o2.pl header.a=rsa-sha256 header.s=20241105 header.b=YmtgH6yq Received: from mx-out.tlen.pl (mx-out.tlen.pl [193.222.135.145]) by sourceware.org (Postfix) with ESMTPS id EFF564BA23C3 for ; Thu, 17 Sep 2026 07:28:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EFF564BA23C3 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=o2.pl Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=o2.pl ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EFF564BA23C3 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=193.222.135.145 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789630124; cv=none; b=QhUv8HxjQkTadawT3beJU14cOZ7Fc9rd2YaildsrYwEBGKfOLqe3XzZKmZPtWex2a41ovjGz/09ImVQHFVayZJsJmQiGM+5SHx9OgKQ/7gDagu5uzLapAWuYvSQvotwemNza3FR3zlLDN19l445vOOus7m4ZGL6YlWZH4Bx7Hv0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789630124; c=relaxed/simple; bh=/2gonTulHOdozUxiQfKGLC7m4Rwl7sKRl/Grq1YZQ+U=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=cjpfG8986/N4dIe4u+lbMEPQV9gbYtq79iNV087qtRNoOtgx7zgeX9CS5dVKpL6urNkhwkCTij3cXxIXxdq50AxylXUHbgVI6kYBqdCBxZHAGNb0ozwa9xowhjueUTeZalkjZDrIwe1Sx0AOgOxtnykZYibKID+40YHf4ChzLnE= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=o2.pl header.i=@o2.pl header.a=rsa-sha256 header.s=20241105 header.b=YmtgH6yq DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EFF564BA23C3 Received: (wp-smtpd smtp.tlen.pl 29894 invoked from network); 17 Sep 2026 09:28:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=20241105; t=1789630116; bh=JMLrhg+9LOVA+ZvzyMd6/wz49cbzdeuCBBGaaGAUJN8=; h=Subject:To:Cc:From; b=YmtgH6yqs+nGTiTZmAqfC7+fxaycggnIJmQTayBReNmD+EfEM0EAFHGS6rzSulzLv d5Xsm0zEwZQQjZCjIjZR3IPL4FQrNPt/oxca9/pqAG3tihaNX6Q5+TXWfOFd057Y4i /YUTADUixj5kbUJqgGoPEHyl3Dnl4xCveHE2Qacj2bPprNVT6kC9hTgRRK2GbjqIKv wMeiFAvurSPVVpOFLdLu2jgK08R0fm3mu/amfdpMFuEADUfRZWBCcqFsCpGQe4UsOo S4Zh2wnzQ+jO3oXq1bI7evQ9O8KP5hIYh6jP32BF9nOFKHA723lfun2b0polvz7iEa 6pDjSM6/e9Hpg== Received: from [192.168.0.1] (ip-94-42-231-202.multimo.pl [94.42.231.202]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with TLS_AES_256_GCM_SHA384 encrypted SMTP for ; 17 Sep 2026 09:28:36 +0200 Message-ID: <7329cb3c-d8a4-40db-bb7e-745f8ea9d95e@o2.pl> Date: Thu, 17 Sep 2026 09:28:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] h8300-elf: ld: Use USER_LABEL_PREFIX when generating linker scripts [REPOST] To: Simon Marchi Cc: Jan Beulich , binutils@sourceware.org, gdb-patches@sourceware.org, Hans-Peter Nilsson , Alan Modra References: <20260823201052.1569259-1-jdx@o2.pl> <78e8d2e7-7ed5-4b56-af05-28177f85d63d@simark.ca> Content-Language: pl From: Jan Dubiec In-Reply-To: <78e8d2e7-7ed5-4b56-af05-28177f85d63d@simark.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-WP-MailID: 9c92714fd8fbc6d8048b0c27a6f43446 X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000003 [kUAD] 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 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. I hope it will not be a problem for whoever commits the patch to copy and paste the message below. /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 ----------------------------------