From b6dfdfde8864d2b6d45b58f8a0cbb9b6caa3939b Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 28 Jul 2023 13:06:17 +0930 Subject: [PATCH] ldscripts/empty-address vs. xcoff The empty-address tests check that if a section is removed by ld due to being empty then properties of that section don't affect following addresses. The xcoff backend doesn't remove the empty .data section created by empty-address-2* and empty-address-3* for some reason, and therefore fails the test. * testsuite/ld-scripts/empty-address-1.d: Accept more symbols. * testsuite/ld-scripts/empty-address-2a.d: xfail for xcoff. * testsuite/ld-scripts/empty-address-2b.d: Likewise. * testsuite/ld-scripts/empty-address-3a.d: Likewise. * testsuite/ld-scripts/empty-address-3b.d: Likewise. --- ld/testsuite/ld-scripts/empty-address-1.d | 1 + ld/testsuite/ld-scripts/empty-address-2a.d | 2 +- ld/testsuite/ld-scripts/empty-address-2b.d | 2 +- ld/testsuite/ld-scripts/empty-address-3a.d | 1 + ld/testsuite/ld-scripts/empty-address-3b.d | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ld/testsuite/ld-scripts/empty-address-1.d b/ld/testsuite/ld-scripts/empty-address-1.d index dbaf778024e..210b70f7097 100644 --- a/ld/testsuite/ld-scripts/empty-address-1.d +++ b/ld/testsuite/ld-scripts/empty-address-1.d @@ -5,5 +5,6 @@ 0+0 [AT] _start #... 0+200 [ADT] __data_end +#... 0+200 [ADT] __data_start #pass diff --git a/ld/testsuite/ld-scripts/empty-address-2a.d b/ld/testsuite/ld-scripts/empty-address-2a.d index 4471a1be6a3..a619ea19a07 100644 --- a/ld/testsuite/ld-scripts/empty-address-2a.d +++ b/ld/testsuite/ld-scripts/empty-address-2a.d @@ -1,7 +1,7 @@ #source: empty-address-2.s #ld: -Ttext 0x0000000 -Tdata 0x200 -T empty-address-2a.t #nm: -n -#xfail: bfin-*-linux* frv-*-*linux* riscv64*-*-* tic54x-*-* +#xfail: bfin-*-linux* frv-*-*linux* riscv64*-*-* tic54x-*-* [is_xcoff_format] #... 0+0 T _start #... diff --git a/ld/testsuite/ld-scripts/empty-address-2b.d b/ld/testsuite/ld-scripts/empty-address-2b.d index 8dfe888b63d..c9b97b8b809 100644 --- a/ld/testsuite/ld-scripts/empty-address-2b.d +++ b/ld/testsuite/ld-scripts/empty-address-2b.d @@ -1,7 +1,7 @@ #source: empty-address-2.s #ld: -Ttext 0x0000000 -Tdata 0x200 -T empty-address-2b.t #nm: -n -#xfail: bfin-*-linux* frv-*-*linux* riscv64*-*-* tic54x-*-* +#xfail: bfin-*-linux* frv-*-*linux* riscv64*-*-* tic54x-*-* [is_xcoff_format] #... 0+0 T _start #... diff --git a/ld/testsuite/ld-scripts/empty-address-3a.d b/ld/testsuite/ld-scripts/empty-address-3a.d index b3135bf9231..fe87ebc34ac 100644 --- a/ld/testsuite/ld-scripts/empty-address-3a.d +++ b/ld/testsuite/ld-scripts/empty-address-3a.d @@ -1,6 +1,7 @@ #source: empty-address-3.s #ld: -T empty-address-3a.t #nm: -n +#xfail: [is_xcoff_format] #... 0+0 T _start diff --git a/ld/testsuite/ld-scripts/empty-address-3b.d b/ld/testsuite/ld-scripts/empty-address-3b.d index 1e68e29b428..0d9babef6f7 100644 --- a/ld/testsuite/ld-scripts/empty-address-3b.d +++ b/ld/testsuite/ld-scripts/empty-address-3b.d @@ -1,6 +1,7 @@ #source: empty-address-3.s #ld: -T empty-address-3b.t #nm: -n +#xfail: [is_xcoff_format] #... 0+0 T _start -- 2.30.2