[ARM,testsuite] Fix address of sg stubs in CMSE tests

Message ID CAKdteObBVaKZ7Z+K97LzcFqO_RpJnBx93dF4-4JMiydQE+MioQ@mail.gmail.com
State New
Headers show
Series
  • [ARM,testsuite] Fix address of sg stubs in CMSE tests
Related show

Commit Message

Christophe Lyon July 2, 2019, 2:41 p.m.
Hi,

While running the GCC testsuite with an armv8-m target, I noticed that
a few tests where causing the BFD linker to crash. I opened  PR
ld/24709 for this [1], but fixing it properly is tricky and not worth
the headache.

I "fixed" the linker so that it emits a useful error message instead
of crashing, and on the GCC side the "fix" is simply to avoid placing
the sg stubs section too far from the destination.

This is what this patch does, by replacing
--section-start,.gnu.sgstubs=0x20400000
with
--section-start,.gnu.sgstubs=0x00400000

OK?

Thanks,

Christophe
gcc/testsuite/ChangeLog:

2019-07-02  Christophe Lyon  <christophe.lyon@linaro.org>

	* gcc.target/arm/cmse/bitfield-1.c: Fix address of .gnu.sgstubs
	section.
	* gcc.target/arm/cmse/bitfield-2.c: Likewise.
	* gcc.target/arm/cmse/bitfield-3.c: Likewise.
	* gcc.target/arm/cmse/struct-1.c: Likewise.

Comments

Christophe Lyon July 8, 2019, 2:27 p.m. | #1
ping?
I think that's almost obvious?
And maybe should be applied to release branches.

Christophe

On Tue, 2 Jul 2019 at 16:41, Christophe Lyon <christophe.lyon@linaro.org> wrote:
>

> Hi,

>

> While running the GCC testsuite with an armv8-m target, I noticed that

> a few tests where causing the BFD linker to crash. I opened  PR

> ld/24709 for this [1], but fixing it properly is tricky and not worth

> the headache.

>

> I "fixed" the linker so that it emits a useful error message instead

> of crashing, and on the GCC side the "fix" is simply to avoid placing

> the sg stubs section too far from the destination.

>

> This is what this patch does, by replacing

> --section-start,.gnu.sgstubs=0x20400000

> with

> --section-start,.gnu.sgstubs=0x00400000

>

> OK?

>

> Thanks,

>

> Christophe
Kyrill Tkachov July 9, 2019, 9:25 a.m. | #2
Hi Christophe,

On 7/2/19 3:41 PM, Christophe Lyon wrote:
> Hi,

>

> While running the GCC testsuite with an armv8-m target, I noticed that

> a few tests where causing the BFD linker to crash. I opened PR

> ld/24709 for this [1], but fixing it properly is tricky and not worth

> the headache.

>

> I "fixed" the linker so that it emits a useful error message instead

> of crashing, and on the GCC side the "fix" is simply to avoid placing

> the sg stubs section too far from the destination.

>

> This is what this patch does, by replacing

> --section-start,.gnu.sgstubs=0x20400000

> with

> --section-start,.gnu.sgstubs=0x00400000

>

> OK?



Ok.

Thanks,

Kyrill


>

> Thanks,

>

> Christophe

Patch

diff --git a/gcc/testsuite/gcc.target/arm/cmse/bitfield-1.c b/gcc/testsuite/gcc.target/arm/cmse/bitfield-1.c
index fccc51d..0fc191e 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/bitfield-1.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/bitfield-1.c
@@ -1,5 +1,5 @@ 
 /* { dg-do run } */
-/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x20400000" } */
+/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x00400000" } */
 
 typedef struct
 {
diff --git a/gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c b/gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c
index e6aee3c..f8327c8 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/bitfield-2.c
@@ -1,5 +1,5 @@ 
 /* { dg-do run } */
-/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x20400000" } */
+/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x00400000" } */
 
 typedef struct
 {
diff --git a/gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c b/gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c
index 285a2b9..d0550db 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/bitfield-3.c
@@ -1,5 +1,5 @@ 
 /* { dg-do run } */
-/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x20400000" } */
+/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x00400000" } */
 
 typedef struct
 {
diff --git a/gcc/testsuite/gcc.target/arm/cmse/struct-1.c b/gcc/testsuite/gcc.target/arm/cmse/struct-1.c
index 2d366a9..874da3c 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/struct-1.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/struct-1.c
@@ -1,5 +1,5 @@ 
 /* { dg-do run } */
-/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x20400000" } */
+/* { dg-options "--save-temps -mcmse -Wl,--section-start,.gnu.sgstubs=0x00400000" } */
 
 typedef struct
 {