[PATCH, binutils] Fix implib test failures

Thomas Preudhomme thomas.preudhomme@foss.arm.com
Tue Jul 19 14:12:00 GMT 2016


Hi,

The tests added for the ELF import library feature (commit 
76359541825cf36ecd14ab6b5974ee56e1c59eff) fail on most targets for various 
reasons:

(1) use of non generic .bss directive
(2) varying number of spaces in output between targets
(3) restriction on where a section can start due to default linker scripts
(4) code for the feature segfault when dealing with local symbols
(5) assert failure in swap_out_syms when ELF output section cannot be found

This patch aims at fixing all these issues by:

(a) using equivalent .section target independent directive instead of .bss 
(fixes (1))
(b) making regex matching more flexible and not setting a specific .data start 
address (fixes (2) and (3))
(c) skipping local symbols when filtering symbols to output in import library 
(fixes (4))
(d) errorring out instead of using an assert when ELF output section cannot be 
found (fixes (5)).

Many thanks to Alan Modra and Nick Clifton for spotting the issues and 
providing with fixes.

ChangeLog entries are as follow:

*** bfd/ChangeLog ***

2016-07-18  Nick Clifton  <nickc@redhat.com>

        * elf.c (_bfd_elf_filter_global_symbols): Skip local symbols.
        (swap_out_syms): Error out when not finding ELF output section instead
        of asserting we find one.
        * elflink.c (elf_output_implib): Call bfd_set_error before displaying
        error message.


*** ld/ChangeLog ***

2016-07-18  Alan Modra  <amodra@gmail.com>
            Thomas Preud'homme  <thomas.preudhomme@arm.com>

        * testsuite/ld-elf/elf.exp: Xfail targets using 
        _bfd_generic_final_link instead of bfd_elf_final_link when running
        import library tests.
        (Generate import library): Stop setting .data section start address.
        * testsuite/ld-elf/implib.s: Remove first .bss directive and replace
        second one with equivalent .section directive.
        * testsuite/ld-elf/implib.rd: Escape dot in filename, stop testing
        addresses of symbols and be more flexible on the number of spaces in
        output.


The changes have been tested on arm-none-eabi, i386-linux-gnu, x86_64-linux-
gnu, avr-elf, bfin-elf, mipstx39-elf and d30v-elf. They pass successfully on 
all these targets except on d30v-elf where they xfail as expected (target does 
not use bfd_elf_final_link).

Is this ok for trunk?

Best regards,

Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_implib_test_failures.patch
Type: text/x-patch
Size: 4480 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160719/037c619f/attachment.bin>


More information about the Binutils mailing list