public inbox for
help / color / mirror / Atom feed
From: Torbjorn Svensson <>
Subject: [gcc r13-3081] testsuite: 'b' instruction can't do long enough jumps
Date: Wed,  5 Oct 2022 09:58:19 +0000 (GMT)	[thread overview]
Message-ID: <> (raw)

commit r13-3081-g1a46a0a8b30405ea353a758971634dabeee89eaf
Author: Torbjörn SVENSSON <>
Date:   Mon Sep 19 18:18:58 2022 +0200

    testsuite: 'b' instruction can't do long enough jumps
    After moving the testglue in commit 9d503515cee, the jump to exit and
    abort is too far for the 'b' instruction on Cortex-M0. As most of the
    C code would generate a 'bl' instruction instead of a 'b'
    instruction, lets do the same for the inline assembler.
    The error seen without this patch:
    /tmp/cccCRiCl.o: in function `main':
    stack-protector-1.c:(.text+0x4e): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol `__wrap_exit' defined in .text section in gcc_tg.o
    stack-protector-1.c:(.text+0x50): relocation truncated to fit: R_ARM_THM_JUMP11 against symbol `__wrap_abort' defined in .text section in gcc_tg.o
    collect2: error: ld returned 1 exit status
            * Use 'bl' instead of 'b'
            * Likewise.
    Co-Authored-By: Yvan ROUX  <>
    Signed-off-by: Torbjörn SVENSSON  <>

 gcc/testsuite/ | 4 ++--
 gcc/testsuite/ | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/ b/gcc/testsuite/
index 8d28b0a847c..3f0ffc9c3f3 100644
--- a/gcc/testsuite/
+++ b/gcc/testsuite/
@@ -56,8 +56,8 @@ asm (
 "	ldr	r1, [sp, #4]\n"
 	CHECK (r1)
 "	mov	r0, #0\n"
-"	b	exit\n"
+"	bl	exit\n"
-"	b	abort\n"
+"	bl	abort\n"
 "	.size	main, .-main"
diff --git a/gcc/testsuite/ b/gcc/testsuite/
index b8f77fa2309..2f710529b8f 100644
--- a/gcc/testsuite/
+++ b/gcc/testsuite/
@@ -26,7 +26,7 @@ asm (
 "	.type	__stack_chk_fail, %function\n"
 "	movs	r0, #0\n"
-"	b	exit\n"
+"	bl	exit\n"
 "	.size	__stack_chk_fail, .-__stack_chk_fail"

                 reply	other threads:[~2022-10-05  9:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).