This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch] XFAIL srec tests for avr


Hi,

  This patch sets the status of tests in srec.exp as XFAIL for the
  avr target.

  The tests have been failing for quite a while (years IIRC).
  Turns out that the code path for srec output does not call
  elf32_avr_relocate_section - that function calls
  avr_final_link_relocate to do custom reloc handling outside of
  what's expressed in the reloc howto table. The srec code path
  calls bfd_perfom_relocation instead, and that function, which only
  looks at howto table information, generates junk values, causing
  the tests to fail.

  Just calling that function from
  elf32_avr_get_relocated_section_contents didn't work - there's some
  state set up through elf32_avr_link_hash_table_create (which
  implements bfd_elf32_bfd_link_hash_table_create hook), and that's
  missing in the srec generation code path. I gave up at this point :)

  An easy and well-known workaround exists - linking to ELF and then
  using objcopy to convert to srec.

  If ok, could someone commit please? I don't have commit access. The
  formatting looks weird - I went by neighboring code's formatting.

Regards
Senthil

ld/ChangeLog

2016-05-05  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
	* ld/testsuite/ld-srec/srec.exp: Mark test as
  XFAIL for avr.


diff --git a/ld/testsuite/ld-srec/srec.exp b/ld/testsuite/ld-srec/srec.exp
index 9832af8..d26b3da 100644
--- a/ld/testsuite/ld-srec/srec.exp
+++ b/ld/testsuite/ld-srec/srec.exp
@@ -249,6 +249,12 @@ proc run_srec_test { test objs } {
 	setup_xfail "sh64*-*-*"
     }
 
+    # The AVR target does not correctly process relocs
+    # when output format is not ELF.
+    if [istarget avr-*-*] {
+	setup_xfail "avr-*-*"
+    }
+
     if {[istarget aarch64*-*-*]   || \
         [istarget arm*-*-*]} {
         # ARM targets cannot convert format in the linker


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]