[PATCH] elf/x86-64: Adjust relocation for PE/x86-64 inputs

H.J. Lu hjl.tools@gmail.com
Wed Sep 16 13:44:23 GMT 2020


On Tue, Sep 15, 2020 at 12:19 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> PE linker calls _bfd_relocate_contents to resolve relocation, instead of
> bfd_perform_relocation.  But ELF linker calls bfd_perform_relocation, not
> _bfd_relocate_contents.  When linking PE/x86-64 inputs to generate ELF
> output, we need to adjust PE/x86-64 relocations in bfd_perform_relocation.
>
> Update run_ld_link_tests to handle bzip2 binary inputs.
>
> bfd/
>
>         PR ld/26583
>         * reloc.c: Include "coff/internal.h".
>         (bfd_perform_relocation): Adjust relocation for PE/x86-64 inputs.
>
> ld/
>
>         PR ld/26583
>         * testsuite/ld-x86-64/pe-x86-64-1.od: New file.
>         * testsuite/ld-x86-64/pe-x86-64-1a.obj.bz2: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-1b.obj.bz2: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-1c.obj.bz2: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-2.od: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-2a.obj.bz2: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-2b.obj.bz2: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-2c.obj.bz2: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-3.od: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-3a.obj.bz2: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-3b.obj.bz2: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-3c.obj.bz2: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-3d.obj.bz2: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-4.od: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-4a.obj.bz2: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-4b.obj.bz2: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-4c.obj.bz2: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64-4d.obj.bz2: Likewise.
>         * testsuite/ld-x86-64/pe-x86-64.exp: Likewise.
>         * testsuite/lib/ld-lib.exp (run_ld_link_tests): Handle bz2 binary
>         inputs.

This is the patch I am checking in.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-elf-x86-64-Adjust-relocation-for-PE-x86-64-inputs.patch
Type: text/x-patch
Size: 36217 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20200916/daefc3f1/attachment-0001.bin>


More information about the Binutils mailing list