powerpc garbage collect test

Message ID 20200709132735.GC25751@bubble.grove.modra.org
State New
Headers show
Series
  • powerpc garbage collect test
Related show

Commit Message

David Faust via Binutils July 9, 2020, 1:27 p.m.
ld's garbage collection test on powerpc64 catered for old compilers
(pre -mcmodel=medium support), setting options that caused the test to
fail.  Which meant the test wasn't really testing anything.  Get rid
of that old compiler support, and avoid -fPIE fails on ppc32.

	* testsuite/ld-gc/gc.exp: Don't set -mminimal-toc for powerpc64,
	and remove powerpc64 xfail.  Use -fno-PIE for ppc32.


-- 
Alan Modra
Australia Development Lab, IBM

Comments

Matthias Klose July 13, 2020, 1:19 p.m. | #1
On 7/9/20 3:27 PM, Alan Modra wrote:
> ld's garbage collection test on powerpc64 catered for old compilers

> (pre -mcmodel=medium support), setting options that caused the test to

> fail.  Which meant the test wasn't really testing anything.  Get rid

> of that old compiler support, and avoid -fPIE fails on ppc32.

> 

> 	* testsuite/ld-gc/gc.exp: Don't set -mminimal-toc for powerpc64,

> 	and remove powerpc64 xfail.  Use -fno-PIE for ppc32.


please could you commit this to the 2.35 branch as well?

Thanks, Matthias
David Faust via Binutils July 13, 2020, 2:26 p.m. | #2
On Mon, Jul 13, 2020 at 03:19:53PM +0200, Matthias Klose wrote:
> On 7/9/20 3:27 PM, Alan Modra wrote:

> > ld's garbage collection test on powerpc64 catered for old compilers

> > (pre -mcmodel=medium support), setting options that caused the test to

> > fail.  Which meant the test wasn't really testing anything.  Get rid

> > of that old compiler support, and avoid -fPIE fails on ppc32.

> > 

> > 	* testsuite/ld-gc/gc.exp: Don't set -mminimal-toc for powerpc64,

> > 	and remove powerpc64 xfail.  Use -fno-PIE for ppc32.

> 

> please could you commit this to the 2.35 branch as well?


Done.

-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/ld/testsuite/ld-gc/gc.exp b/ld/testsuite/ld-gc/gc.exp
index ea3316887e..285e7d1cb5 100644
--- a/ld/testsuite/ld-gc/gc.exp
+++ b/ld/testsuite/ld-gc/gc.exp
@@ -26,9 +26,9 @@  if ![check_gc_sections_available] {
 set cflags "-ffunction-sections -fdata-sections $NOSANTIZE_CFLAGS"
 set objfile "tmpdir/gc.o"
 
-if [istarget powerpc64*-*-*] {
-    # otherwise with -mcmodel=medium gcc we get XPASSes.
-    set cflags "$cflags -mminimal-toc"
+if { [istarget powerpc*-*-*] && ![istarget powerpc64*-*-*] } {
+    # Avoid using .got2 for powerpc -m32
+    set cflags "$cflags $NOPIE_CFLAGS"
 }
 
 if { [istarget m681*-*-*] || [istarget m68hc1*-*-*] } {
@@ -71,9 +71,6 @@  proc test_gc { testname filename linker ldflags} {
 	fail $testname
 	return
     }
-    #ppc64_elf_gc_mark_hook needs to be taught how to look through
-    #the .toc section to properly mark variable sections for gc.
-    setup_xfail "powerpc64*-*-*"
     if {[info exists nm_output(unused_func)] \
 	    || [info exists nm_output(unused_var)]} {
 	send_log "unused section still here\n"