From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29172 invoked by alias); 5 May 2016 11:31:04 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 29137 invoked by uid 89); 5 May 2016 11:31:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=howto, H*M:atmel, H*r:10.161.101, H*RU:sk:eusmtp0 X-HELO: eusmtp01.atmel.com Received: from eusmtp01.atmel.com (HELO eusmtp01.atmel.com) (212.144.249.243) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 05 May 2016 11:30:53 +0000 Received: from HNOCHT01.corp.atmel.com (10.161.30.161) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server (TLS) id 14.3.235.1; Thu, 5 May 2016 13:30:44 +0200 Received: from jaguar.atmel.com (10.161.30.18) by HNOCHT01.corp.atmel.com (10.161.30.161) with Microsoft SMTP Server (TLS) id 14.3.235.1; Thu, 5 May 2016 13:30:48 +0200 User-agent: mu4e 0.9.17; emacs 24.5.1 From: Senthil Kumar Selvaraj To: "binutils@sourceware.org" , Nick Clifton , Denis Chertykov Subject: [Patch] XFAIL srec tests for avr Date: Thu, 05 May 2016 11:31:00 -0000 Message-ID: <877ff8lp1p.fsf@atmel.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00046.txt.bz2 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 * 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