public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] ld: Just xfail riscv little endian targets for compressed1d.d test.
@ 2021-01-08 12:04 Nelson Chu
  2021-01-15 14:47 ` Nelson Chu
  0 siblings, 1 reply; 4+ messages in thread
From: Nelson Chu @ 2021-01-08 12:04 UTC (permalink / raw)
  To: binutils, amodra, nickc, jimw

The sizes of compressed and uncompressed .debug_aranges are the same
for the riscv big endian targets, but different for the little endian
targets.  The compress rule is fine and isn't broken by riscv, just the
original compressed1d.d fails by accident.  Ideally, we should fill the
R_RISCV_ADD/SUB relocations when disabling relaxations in the assembler.
But before that, Jim already had written an alternative test compressed1d-alt
to relpace compressed1d.d for riscv, so we can only xfail the riscv little
endian targets in the short-term.

ld/
    * testsuite/ld-elf/elf.exp (riscv_little_endian): Added.  Return true
    if target is riscv little endian.  Otherwise, return false.
    * testsuite/ld-elf/compressed1d.d: Only xfail the riscv little endian
    targets by [riscv_little_endian].
---
 ld/testsuite/ld-elf/compressed1d.d |  5 +++--
 ld/testsuite/ld-elf/elf.exp        | 13 +++++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/ld/testsuite/ld-elf/compressed1d.d b/ld/testsuite/ld-elf/compressed1d.d
index df7ce34..9d891c1 100644
--- a/ld/testsuite/ld-elf/compressed1d.d
+++ b/ld/testsuite/ld-elf/compressed1d.d
@@ -3,10 +3,11 @@
 #ld: -r --compress-debug-sections=zlib-gnu
 #readelf: -SW
 #xfail: [uses_genelf]
-#xfail: riscv*-*-*
+#xfail: [riscv_little_endian]
 # Not all ELF targets use the elf.em emulation...
 # RISC-V has linker relaxations that delete code, so text label subtractions
-# do not get resolved at assembly time, which results in a compressed section.
+# do not get resolved at assembly time, which results in a compressed section
+# for little endian targets; but it is uncompressed for big endian targets.
 
 #failif
 #...
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index 7179cec..e98bffc 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -25,6 +25,19 @@ if ![is_elf_format] {
     return
 }
 
+# Return true if target is riscv little endian.
+# xfail the riscv little endain targets for the compressed1d1 test;
+# The riscv big endian targets and others should pass.
+proc riscv_little_endian { } {
+    if { [istarget "riscv32-*-*"]
+	 || [istarget "riscv64-*-*"]
+	 || [istarget "riscv32le-*-*"]
+	 || [istarget "riscv64le-*-*"] } {
+	return 1
+    }
+    return 0
+}
+
 set old_ldflags $LDFLAGS
 if { [istarget spu*-*-*] } {
     set LDFLAGS "$LDFLAGS --local-store 0:0"
-- 
2.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ld: Just xfail riscv little endian targets for compressed1d.d test.
  2021-01-08 12:04 [PATCH] ld: Just xfail riscv little endian targets for compressed1d.d test Nelson Chu
@ 2021-01-15 14:47 ` Nelson Chu
  2021-01-18 12:38   ` Nick Clifton
  0 siblings, 1 reply; 4+ messages in thread
From: Nelson Chu @ 2021-01-15 14:47 UTC (permalink / raw)
  To: Binutils, Alan Modra, Nick Clifton, Jim Wilson

Ping!  :)

Thanks
Nelson

On Fri, Jan 8, 2021 at 8:04 PM Nelson Chu <nelson.chu@sifive.com> wrote:
>
> The sizes of compressed and uncompressed .debug_aranges are the same
> for the riscv big endian targets, but different for the little endian
> targets.  The compress rule is fine and isn't broken by riscv, just the
> original compressed1d.d fails by accident.  Ideally, we should fill the
> R_RISCV_ADD/SUB relocations when disabling relaxations in the assembler.
> But before that, Jim already had written an alternative test compressed1d-alt
> to relpace compressed1d.d for riscv, so we can only xfail the riscv little
> endian targets in the short-term.
>
> ld/
>     * testsuite/ld-elf/elf.exp (riscv_little_endian): Added.  Return true
>     if target is riscv little endian.  Otherwise, return false.
>     * testsuite/ld-elf/compressed1d.d: Only xfail the riscv little endian
>     targets by [riscv_little_endian].
> ---
>  ld/testsuite/ld-elf/compressed1d.d |  5 +++--
>  ld/testsuite/ld-elf/elf.exp        | 13 +++++++++++++
>  2 files changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/ld/testsuite/ld-elf/compressed1d.d b/ld/testsuite/ld-elf/compressed1d.d
> index df7ce34..9d891c1 100644
> --- a/ld/testsuite/ld-elf/compressed1d.d
> +++ b/ld/testsuite/ld-elf/compressed1d.d
> @@ -3,10 +3,11 @@
>  #ld: -r --compress-debug-sections=zlib-gnu
>  #readelf: -SW
>  #xfail: [uses_genelf]
> -#xfail: riscv*-*-*
> +#xfail: [riscv_little_endian]
>  # Not all ELF targets use the elf.em emulation...
>  # RISC-V has linker relaxations that delete code, so text label subtractions
> -# do not get resolved at assembly time, which results in a compressed section.
> +# do not get resolved at assembly time, which results in a compressed section
> +# for little endian targets; but it is uncompressed for big endian targets.
>
>  #failif
>  #...
> diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
> index 7179cec..e98bffc 100644
> --- a/ld/testsuite/ld-elf/elf.exp
> +++ b/ld/testsuite/ld-elf/elf.exp
> @@ -25,6 +25,19 @@ if ![is_elf_format] {
>      return
>  }
>
> +# Return true if target is riscv little endian.
> +# xfail the riscv little endain targets for the compressed1d1 test;
> +# The riscv big endian targets and others should pass.
> +proc riscv_little_endian { } {
> +    if { [istarget "riscv32-*-*"]
> +        || [istarget "riscv64-*-*"]
> +        || [istarget "riscv32le-*-*"]
> +        || [istarget "riscv64le-*-*"] } {
> +       return 1
> +    }
> +    return 0
> +}
> +
>  set old_ldflags $LDFLAGS
>  if { [istarget spu*-*-*] } {
>      set LDFLAGS "$LDFLAGS --local-store 0:0"
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ld: Just xfail riscv little endian targets for compressed1d.d test.
  2021-01-15 14:47 ` Nelson Chu
@ 2021-01-18 12:38   ` Nick Clifton
  2021-01-19  2:01     ` Nelson Chu
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2021-01-18 12:38 UTC (permalink / raw)
  To: Nelson Chu, Binutils, Alan Modra, Jim Wilson

Hi Nelson,

> Ping!  :)

Oops!

>> ld/
>>      * testsuite/ld-elf/elf.exp (riscv_little_endian): Added.  Return true
>>      if target is riscv little endian.  Otherwise, return false.
>>      * testsuite/ld-elf/compressed1d.d: Only xfail the riscv little endian
>>      targets by [riscv_little_endian].

Approved - please apply to mainline and 2.36 branch.

Cheers
   Nick



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ld: Just xfail riscv little endian targets for compressed1d.d test.
  2021-01-18 12:38   ` Nick Clifton
@ 2021-01-19  2:01     ` Nelson Chu
  0 siblings, 0 replies; 4+ messages in thread
From: Nelson Chu @ 2021-01-19  2:01 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Binutils, Alan Modra, Jim Wilson

Hi Nick,

On Mon, Jan 18, 2021 at 8:38 PM Nick Clifton <nickc@redhat.com> wrote:
> >> ld/
> >>      * testsuite/ld-elf/elf.exp (riscv_little_endian): Added.  Return true
> >>      if target is riscv little endian.  Otherwise, return false.
> >>      * testsuite/ld-elf/compressed1d.d: Only xfail the riscv little endian
> >>      targets by [riscv_little_endian].
>
> Approved - please apply to mainline and 2.36 branch.

Thanks!  Already applied to mainline and binutils-2_36-branch branch.

Nelson

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-19  2:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08 12:04 [PATCH] ld: Just xfail riscv little endian targets for compressed1d.d test Nelson Chu
2021-01-15 14:47 ` Nelson Chu
2021-01-18 12:38   ` Nick Clifton
2021-01-19  2:01     ` Nelson Chu

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).