bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/30787] DT_JMPREL/DT_PLTRELSZ incorrect when PLT and REL/RELA rel


From: cvs-commit at gcc dot gnu.org
Subject: [Bug ld/30787] DT_JMPREL/DT_PLTRELSZ incorrect when PLT and REL/RELA relocations share an ELF output section
Date: Wed, 23 Aug 2023 16:30:32 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=30787

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot 
gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fa4f2d46f95a1c673b025fab7f292cb864a99020

commit fa4f2d46f95a1c673b025fab7f292cb864a99020
Author: Peter Edwards <peadar@arista.com>
Date:   Tue Aug 22 19:57:28 2023 +0100

    x86: Fix DT_JMPREL/DT_PLTRELSZ when relocs share a section

    If a linker script does not place the PLT relocations and "normal"
    relocations in separate ELF sections, `ld` will currently output incorrect
    values for DT_JMPREL and DT_PLTRELSZ - they cover the entire ELF section,
    rather than just the PLT relocations

    Don't ignore the extent of the BFD section - use the size of the srelplt
    BFD section and its offset from the output_secttion

    bfd/

            PR ld/30787
            * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): Use input
            section for DT_JMPREL and DT_PLTRELSZ.

    ld/

            PR ld/30787
            * testsuite/ld-i386/i386.exp: Run pr30787.
            * testsuite/ld-x86-64/x86-64.exp: Likewise.
            * testsuite/ld-i386/pr30787.d: New file.
            * testsuite/ld-i386/pr30787.s: Likewise.
            * testsuite/ld-i386/pr30787.t: Likewise.
            * testsuite/ld-x86-64/pr30787.d: Likewise.
            * testsuite/ld-x86-64/pr30787.s: Likewise.
            * testsuite/ld-x86-64/pr30787.t: Likewise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]