« Return to Thread: RE: PR 6848: Not all targets generate relocs against kept symbols.

Re: PR 6848: Not all targets generate relocs against kept symbols.

by Alan Modra :: Rate this Message:

Reply to Author | View in Thread

Another reason we had a rather lot of failures was a silly mistake on
my part when inverting some logic.

gas/
        * write.c (install_reloc): Correct EMIT_SECTION_SYMBOLS test.
gas/testsuite/
        * gas/all/gas.exp: Don't run redef tests on a bunch of targets.
        * gas/elf/elf.exp: Likewise.

Index: gas/write.c
===================================================================
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.118
diff -u -p -r1.118 write.c
--- gas/write.c 20 Aug 2008 13:43:32 -0000 1.118
+++ gas/write.c 15 Sep 2008 13:29:12 -0000
@@ -1090,8 +1090,8 @@ install_reloc (asection *sec, arelent *r
       && (sym = *reloc->sym_ptr_ptr) != NULL
       && (sym->flags & BSF_KEEP) == 0
       && ((sym->flags & BSF_SECTION_SYM) == 0
-  || !EMIT_SECTION_SYMBOLS
-  || !bfd_is_abs_section (sym->section)))
+  || (EMIT_SECTION_SYMBOLS
+      && !bfd_is_abs_section (sym->section))))
     as_bad_where (file, line, _("redefined symbol cannot be used on reloc"));
 
   s = bfd_install_relocation (stdoutput, reloc,
Index: gas/testsuite/gas/all/gas.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/all/gas.exp,v
retrieving revision 1.54
diff -u -p -r1.54 gas.exp
--- gas/testsuite/gas/all/gas.exp 20 Aug 2008 23:38:39 -0000 1.54
+++ gas/testsuite/gas/all/gas.exp 15 Sep 2008 13:24:19 -0000
@@ -81,30 +81,39 @@ case $target_triplet in {
 }
 
 # .set works differently on some targets.
+# most of the tests won't work on targets that set linkrelax.
+# 4 octet bytes confuse address matching on ti targets.
+# pdp11 gets unexpected reloc types.
 case $target_triplet in {
     { alpha*-*-* } { }
+    { cr16*-*-* } { }
+    { crx*-*-* } { }
+    { h8300-*-* } { }
     { mips*-*-* } { }
-    { *c54x*-*-* } { }
+    { mn10200-*-* } { }
+    { mn10300-*-* } { }
+    { pdp11-*-* } { }
+    { tic30*-*-* } { }
+    { tic4x*-*-* } { }
+    { tic54x*-*-* } { }
+    { xtensa*-*-* } { }
     { z80-*-* } { }
     default {
- setup_xfail "*c30*-*-*" "*c4x*-*-*" "pdp11-*-*" "xtensa*-*-*"
  run_dump_test redef
  # The next two tests can fail if the target does not convert fixups
  # against ordinary symbols into relocations against section symbols.
  # This is usually revealed by the error message:
  #  symbol `sym' required but not present
- setup_xfail "*c30*-*-*" "*c4x*-*-*" "*arm*-*-*aout*" "*arm*-*-*coff" \
-    "*arm*-*-pe" "crx*-*-*" "h8300*-*-*" "m68hc*-*-*" "maxq-*-*" \
-    "mn10300-*-*" "pdp11-*-*" "vax*-*-*" "z8k-*-*" "cr16-*-*"
+ setup_xfail "*arm*-*-*aout*" "*arm*-*-*coff" \
+    "*arm*-*-pe" "m68hc*-*-*" "maxq-*-*" \
+    "vax*-*-*" "z8k-*-*"
  run_dump_test redef2
  setup_xfail "*-*-aix*" "*-*-coff" "*-*-cygwin" "*-*-mingw*" "*-*-pe*" \
-    "bfin-*-*" "*c4x*-*-*" "crx*-*-*" "h8300*-*-*" "hppa*-*-hpux*" \
-    "m68hc*-*-*" "maxq-*-*" "mn10300-*-*" "or32-*-*" "pdp11-*-*" \
-    "vax*-*-*" "z8k-*-*" "cr16-*-*"
+    "bfin-*-*" "hppa*-*-hpux*" \
+    "m68hc*-*-*" "maxq-*-*" "or32-*-*" \
+    "vax*-*-*" "z8k-*-*"
  run_dump_test redef3
- setup_xfail "*c4x*-*-*"
  gas_test_error "redef4.s" "" ".set for symbol already used as label"
- setup_xfail "*c4x*-*-*"
  gas_test_error "redef5.s" "" ".set for symbol already defined through .comm"
     }
 }
Index: gas/testsuite/gas/elf/elf.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/elf/elf.exp,v
retrieving revision 1.46
diff -u -p -r1.46 elf.exp
--- gas/testsuite/gas/elf/elf.exp 1 Feb 2008 17:58:48 -0000 1.46
+++ gas/testsuite/gas/elf/elf.exp 15 Sep 2008 13:24:19 -0000
@@ -88,16 +88,20 @@ if { ([istarget "*-*-*elf*"]
     run_dump_test "group1b"
     case $target_triplet in {
  { alpha*-*-* } { }
+ { cr16*-*-* } { }
+ { crx*-*-* } { }
+ { h8300-*-* } { }
  { hppa*-*-* } { }
  { iq2000*-*-* } { }
  { mips*-*-* } { }
+ { mn10200-*-* } { }
+ { mn10300-*-* } { }
  { *c54x*-*-* } { }
  default {
     # The next test can fail if the target does not convert fixups
     # against ordinary symbols into relocations against section symbols.
     # This is usually revealed by the error message:
     #  symbol `sym' required but not present
-    setup_xfail "cr16-*-*" "h8300-*-*" "mn10300-*-*"
     run_dump_test redef
     run_dump_test equ-reloc
  }

--
Alan Modra
Australia Development Lab, IBM

 « Return to Thread: RE: PR 6848: Not all targets generate relocs against kept symbols.