V4 [PATCH] elf: Allow mixed ordered/unordered inputs for non-relocatable link

H.J. Lu hjl.tools@gmail.com
Mon Jan 4 16:40:20 GMT 2021


On Mon, Jan 4, 2021 at 5:32 AM Nick Clifton <nickc@redhat.com> wrote:
>
> Hi H.J.
>
> >>>> 1. Add pattern to bfd_section for the matching section name pattern in
> >>>> linker script and update BFD_FAKE_SECTION.
> >>>> 2. Sort the consecutive bfd_indirect_link_order sections with the same
> >>>> pattern to allow linker script to overdide input section order.
> >>>> 3. Place unordered sections before ordered sections.
> >>>> 4. Change the offsets of the indirect input sections only.
>
> The patch looks good to me, but the new tests do cause problems for
> a variety of targets.  For example:
>
>   fido-elf ...         LD REGRESSION: ld-elf/pr26256-3a  ld-elf/pr26256-3b
>   fr30-elf ...         LD REGRESSION: ld-elf/pr26256-2b
>   mipsel-linux-gnu ... LD REGRESSION: ld-elf/pr26256-3a  ld-elf/pr26256-3b
>   riscv32-elf ...      LD REGRESSION: ld-elf/pr26256-3a  ld-elf/pr26256-3b
>   s390-linux ...       LD REGRESSION: ld-elf/pr26256-3a  ld-elf/pr26256-3b
>   score-elf ...        LD REGRESSION: ld-elf/pr26256-3a  ld-elf/pr26256-3b
>
> (This is just a selection).
>
> The cause appears to be an incorrect assumption about the start address of
> the text section:
>
>    regexp_diff match failure
>    regexp "^  0x[a-f0-9]+ +020103 +.+$"
>    line   "  0x00000020 02010000 03000000                   ........"
>    FAIL: ld-elf/pr26256-3a
>
>    regexp_diff match failure
>    regexp "^  0x[a-f0-9]+ +020103 +.+$"
>    aline   "  0x00000020 02010000 03000000                   ........"
>    FAIL: ld-elf/pr26256-3b
>
> Could you fix these please ?
>

Here is the updated patch with testcases fixed.   OK for master?

Thanks.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-elf-Allow-mixed-ordered-unordered-inputs-for-non-rel.patch
Type: application/x-patch
Size: 19631 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20210104/5d534af4/attachment-0001.bin>


More information about the Binutils mailing list