From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id v6/3Mw5Ui2oVRToAWB0awg (envelope-from ) for ; Sun, 23 Aug 2026 16:11:58 -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=YyqWbm8T; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B60511E033; Sun, 23 Aug 2026 16:11: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=-5.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 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 044A51E033 for ; Sun, 23 Aug 2026 16:11:56 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2C6AD4BA23F7 for ; Sun, 23 Aug 2026 20:11:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C6AD4BA23F7 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=YyqWbm8T Received: from mx-out.tlen.pl (mx-out.tlen.pl [193.222.135.145]) by sourceware.org (Postfix) with ESMTPS id 1C2AE4BA2E35 for ; Sun, 23 Aug 2026 20:11:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1C2AE4BA2E35 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 1C2AE4BA2E35 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=1787515878; cv=none; b=G9iOTpHuJSsXtRd+eK/8FPGhHOOUg1HSzdY2Wrew7DgmL40w2zcnpPFH1SKD1UcjuALzi6ypwv77j+N4g2XwbmXgCsBQwYw+k4XhKiK3JyPgZusvYp+O5ZEokCakm2+knqtq2Kugwrm2J7csmxbl4RY++6WB2SUiP/9RMnWUSgA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787515878; c=relaxed/simple; bh=7bmscTejhhqvNnePqqj6LqaETUpYy5e5KW7TE84tyw4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=uH8hbsZc1FrH+iHzUsury22h5VanE8sJlyq8pOI7X6PIW9NldZjvuaI6l3CtCa83VfLrh9uUIXgMnyODK2GX4MYHtuTmK0vqCQwuV1WSfWL6Z0zg6AAA40lIImpPd6kmjyjSsWHi2XKRF60bQR1udelzgQGRu8DYoDKksBQAMNA= 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=YyqWbm8T DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C2AE4BA2E35 Received: (wp-smtpd smtp.tlen.pl 26979 invoked from network); 23 Aug 2026 22:11:15 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=20241105; t=1787515875; bh=/jWBcGYf1dTPr53e7pdwTrYgekvVpcPPRBFILX4cTDk=; h=From:To:Cc:Subject; b=YyqWbm8TtBKKEwYvGHG9YvhVHXY5q6LZdRbDj1wRsySDja9H/g0CPcFtlcmvOL/dv ZRa43Gn5wVTDkvH7EQVNdsyGT8txiu+FF1OYCJyrP4MrcU+L9RurujCc6Q+rv/z0sb ytMyGLf5SoQM3SibnXo82aHwAgEfRYvDzTOtQnDAKeDkEEgUwc9+xdIHdRzBiluaNG aaN1GFXViN0jVQEF4q14GnrGTJT2RR/QkOOh5gvn17old5b19MbyPYd4LtmncGovqn jGq+IR+FdyDkD9CdzikLQw/PeWUC4leOXtXBJrVqmd0SOm3GngfgVLZIiOubD57rFv /IXIwhXhCxRmQ== Received: from jdxpc (ip-94-42-230-181.multimo.pl [94.42.230.181]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with TLS_AES_256_GCM_SHA384 encrypted SMTP for ; 23 Aug 2026 22:11:14 +0200 From: Jan Dubiec To: Alan Modra Cc: Jan Dubiec , Jan Beulich , binutils@sourceware.org, gdb-patches@sourceware.org Subject: [PATCH v3] h8300-elf: ld: Use USER_LABEL_PREFIX when generating linker scripts [REPOST] Date: Sun, 23 Aug 2026 22:10:24 +0200 Message-ID: <20260823201052.1569259-1-jdx@o2.pl> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-WP-MailID: cb5e23b4a02702c944e20ce86f7dfb22 X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000002 [4bE9] 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 This version does not explicitly set the entry symbol; the default one is used instead. The patch also changes one file in the H8/300 simulator testsuite, as it is affected by the change to the entry symbol. The patch has therefore also been posted to the gdb-patches mailing list for approval. The corresponding newlib patch has already been posted: https://inbox.sourceware.org/newlib/20260822001114.1564261-1-jdx@o2.pl/T/#u. Signed-off-by: Jan Dubiec --- ld/emulparams/h8300elf.sh | 1 + ld/testsuite/ld-h8300/gcsection.d | 2 +- ld/testsuite/ld-h8300/gcsection.s | 5 +++-- ld/testsuite/ld-h8300/relax-2.d | 2 +- ld/testsuite/ld-h8300/relax-2.s | 3 ++- ld/testsuite/ld-h8300/relax-3.d | 2 +- ld/testsuite/ld-h8300/relax-3.s | 3 ++- ld/testsuite/ld-h8300/relax-4.d | 2 +- ld/testsuite/ld-h8300/relax-4.s | 3 ++- ld/testsuite/ld-h8300/relax-5.d | 2 +- ld/testsuite/ld-h8300/relax-5.s | 3 ++- ld/testsuite/ld-h8300/relax-6.d | 2 +- ld/testsuite/ld-h8300/relax-6.s | 3 ++- ld/testsuite/ld-h8300/relax-7.d | 2 +- ld/testsuite/ld-h8300/relax-7a.s | 3 ++- ld/testsuite/ld-h8300/relax.d | 2 +- ld/testsuite/ld-h8300/relax.s | 3 ++- sim/testsuite/h8300/testutils.inc | 3 ++- 18 files changed, 28 insertions(+), 18 deletions(-) diff --git a/ld/emulparams/h8300elf.sh b/ld/emulparams/h8300elf.sh index 45b3458d1ce..dd007fcd0ff 100644 --- a/ld/emulparams/h8300elf.sh +++ b/ld/emulparams/h8300elf.sh @@ -9,6 +9,7 @@ MAXPAGESIZE=2 TARGET_PAGE_SIZE=128 ARCH=h8300 TEMPLATE_NAME=elf +USER_LABEL_PREFIX=_ EMBEDDED=yes STACK_ADDR=0xfefc TINY_READONLY_SECTION=".tinyrodata : diff --git a/ld/testsuite/ld-h8300/gcsection.d b/ld/testsuite/ld-h8300/gcsection.d index acf39be8d7f..bc6c5bb7677 100644 --- a/ld/testsuite/ld-h8300/gcsection.d +++ b/ld/testsuite/ld-h8300/gcsection.d @@ -17,7 +17,7 @@ Disassembly of section .text: 114: mov.l @er7\+,er6 118: rts -0000011a <_start>: +0000011a <__?start>: 11a: mov.l er6,@-er7 11e: mov.l er7,er6 120: mov.w #0x4b,r0 diff --git a/ld/testsuite/ld-h8300/gcsection.s b/ld/testsuite/ld-h8300/gcsection.s index 2149ee99cb4..5574af0f331 100644 --- a/ld/testsuite/ld-h8300/gcsection.s +++ b/ld/testsuite/ld-h8300/gcsection.s @@ -29,8 +29,9 @@ _functionWeDontUse: .size _functionWeDontUse, .-_functionWeDontUse .section .text.start,"ax",@progbits .align 1 - .global _start + .global _start, __start _start: +__start: mov.l er6,@-er7 mov.l er7,er6 mov.w #75,r0 @@ -39,5 +40,5 @@ _start: mov.w r2,r0 mov.l @er7+,er6 rts - .size _start, .-_start + .size __start, .-__start .end diff --git a/ld/testsuite/ld-h8300/relax-2.d b/ld/testsuite/ld-h8300/relax-2.d index 7e7964b5c81..c6af620d828 100644 --- a/ld/testsuite/ld-h8300/relax-2.d +++ b/ld/testsuite/ld-h8300/relax-2.d @@ -6,7 +6,7 @@ Disassembly of section .text: -00000100 <_start>: +00000100 <__?start>: 100: mov.b @0x64:8,r0l 102: mov.b r0l,@0x64:8 104: mov.b @0x4320:16,r0l diff --git a/ld/testsuite/ld-h8300/relax-2.s b/ld/testsuite/ld-h8300/relax-2.s index 8e096b83863..300362cc1ab 100644 --- a/ld/testsuite/ld-h8300/relax-2.s +++ b/ld/testsuite/ld-h8300/relax-2.s @@ -1,6 +1,7 @@ .h8300h - .globl _start + .global _start, __start _start: +__start: mov.b @foo:16,r0l mov.b r0l,@foo:16 mov.b @bar:32,r0l diff --git a/ld/testsuite/ld-h8300/relax-3.d b/ld/testsuite/ld-h8300/relax-3.d index f5a9390b785..e537704567b 100644 --- a/ld/testsuite/ld-h8300/relax-3.d +++ b/ld/testsuite/ld-h8300/relax-3.d @@ -6,7 +6,7 @@ Disassembly of section .text: -00000100 <_start>: +00000100 <__?start>: # # Relaxation of aa:16 # diff --git a/ld/testsuite/ld-h8300/relax-3.s b/ld/testsuite/ld-h8300/relax-3.s index f4a2346ab9c..ae94d6c20a1 100644 --- a/ld/testsuite/ld-h8300/relax-3.s +++ b/ld/testsuite/ld-h8300/relax-3.s @@ -1,6 +1,7 @@ .h8300s - .globl _start + .global _start, __start _start: +__start: # s3-s6 aren't valid 16-bit addresses. mov.b @s1:16,r0l mov.b @s2:16,r0l diff --git a/ld/testsuite/ld-h8300/relax-4.d b/ld/testsuite/ld-h8300/relax-4.d index ee80bc39644..001af3b892a 100644 --- a/ld/testsuite/ld-h8300/relax-4.d +++ b/ld/testsuite/ld-h8300/relax-4.d @@ -6,7 +6,7 @@ Disassembly of section .text: -00000100 <_start>: +00000100 <__?start>: 100: mov.b #0x3,r0l 102: mov.b #0x5,r2l 104: bset r0l,@0xff:8 diff --git a/ld/testsuite/ld-h8300/relax-4.s b/ld/testsuite/ld-h8300/relax-4.s index 7d6296da230..bde86590388 100644 --- a/ld/testsuite/ld-h8300/relax-4.s +++ b/ld/testsuite/ld-h8300/relax-4.s @@ -1,8 +1,9 @@ ; Relaxation is possible for following bit manipulation instructions ; BAND, BCLR, BIAND, BILD, BIOR, BIST, BIXOR, BLD, BNOT, BOR, BSET, BST, BTST, BXOR .h8300s - .globl _start + .global _start, __start _start: +__start: # s3-s6 aren't valid 16-bit addresses. mov.b #0x3,r0l mov.b #0x5,r2l diff --git a/ld/testsuite/ld-h8300/relax-5.d b/ld/testsuite/ld-h8300/relax-5.d index 00c4fa89ee4..21ae11ec267 100644 --- a/ld/testsuite/ld-h8300/relax-5.d +++ b/ld/testsuite/ld-h8300/relax-5.d @@ -7,7 +7,7 @@ Disassembly of section .text: -00000100 <_start>: +00000100 <__?start>: 100: ldc @0x0:16,ccr 106: ldc @0x7fff:16,ccr 10c: ldc @0x8000:32,ccr diff --git a/ld/testsuite/ld-h8300/relax-5.s b/ld/testsuite/ld-h8300/relax-5.s index b5afedbfcca..5a1848732bf 100644 --- a/ld/testsuite/ld-h8300/relax-5.s +++ b/ld/testsuite/ld-h8300/relax-5.s @@ -4,11 +4,12 @@ ; ldc.w @aa:32,exr ; stc.w exr,@aa:32 .h8300s - .globl _start + .global _start, __start ; ; Relaxation of aa:32 ; _start: + __start: ldc @s1:32,ccr ldc @s2:32,ccr ldc @s3:32,ccr diff --git a/ld/testsuite/ld-h8300/relax-6.d b/ld/testsuite/ld-h8300/relax-6.d index 54853ef6dbc..77868a3d078 100644 --- a/ld/testsuite/ld-h8300/relax-6.d +++ b/ld/testsuite/ld-h8300/relax-6.d @@ -6,6 +6,6 @@ .*: file format .* Disassembly of section .text: -00000100 <_start>: +00000100 <__?start>: 100: mov.b r2l,@0xbd:8 102: rts diff --git a/ld/testsuite/ld-h8300/relax-6.s b/ld/testsuite/ld-h8300/relax-6.s index fb44b54cb1d..dfc9e1c2199 100644 --- a/ld/testsuite/ld-h8300/relax-6.s +++ b/ld/testsuite/ld-h8300/relax-6.s @@ -1,5 +1,6 @@ .h8300s - .global _start + .global _start, __start _start: +__start: mov.b r2l,@0xFFFFFFBD:32 rts diff --git a/ld/testsuite/ld-h8300/relax-7.d b/ld/testsuite/ld-h8300/relax-7.d index f45787c75ce..f674bfd0906 100644 --- a/ld/testsuite/ld-h8300/relax-7.d +++ b/ld/testsuite/ld-h8300/relax-7.d @@ -27,7 +27,7 @@ Contents of section .rodata: Disassembly of section .text: -00000100 <_start>: +00000100 <__?start>: 100: sub.l er0,er0 102: sub.l er2,er2 104: mov.l #0xffff8000,er1 diff --git a/ld/testsuite/ld-h8300/relax-7a.s b/ld/testsuite/ld-h8300/relax-7a.s index 915fb79caed..73e3b2bdc77 100644 --- a/ld/testsuite/ld-h8300/relax-7a.s +++ b/ld/testsuite/ld-h8300/relax-7a.s @@ -1,9 +1,10 @@ .h8300s # relax expected - .global _start + .global _start, __start .section .text.func1,"ax",@progbits .align 1 _start: +__start: sub.l er0,er0 sub.l er2,er2 mov.l #var3,er1 diff --git a/ld/testsuite/ld-h8300/relax.d b/ld/testsuite/ld-h8300/relax.d index fb863586bfb..7b60728e88d 100644 --- a/ld/testsuite/ld-h8300/relax.d +++ b/ld/testsuite/ld-h8300/relax.d @@ -9,7 +9,7 @@ Disassembly of section .text: -00000100 <_start>: +00000100 <__?start>: 100: 0d 00.*mov.w r0,r0 102: 47 02.*beq .+2 \(0x106\) 104: 55 02.*bsr .+2 \(0x108\) diff --git a/ld/testsuite/ld-h8300/relax.s b/ld/testsuite/ld-h8300/relax.s index b06f3a921c6..eb4e89df64b 100644 --- a/ld/testsuite/ld-h8300/relax.s +++ b/ld/testsuite/ld-h8300/relax.s @@ -1,6 +1,7 @@ .text - .global _start + .global _start, __start _start: +__start: mov.w r0,r0 beq .L1 jsr @_bar diff --git a/sim/testsuite/h8300/testutils.inc b/sim/testsuite/h8300/testutils.inc index 63d27d45c14..75f318c4d4a 100644 --- a/sim/testsuite/h8300/testutils.inc +++ b/sim/testsuite/h8300/testutils.inc @@ -20,8 +20,9 @@ .text .align 2 - .global _start + .global _start, __start _start: +__start: jmp _main .data -- 2.55.0