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

--- Comment #13 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Maciej W. Rozycki <[email protected]>:

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

commit 3492c9a216580892d7f601a0310f517c2be03149
Author: Maciej W. Rozycki <[email protected]>
Date:   Wed Jan 14 22:28:44 2026 +0000

    MIPS/GAS: Warn about unmatched REL HI16 relocations

    Ever since commit 749b8d9d455c ("PATCH: ld/4208: `final link failed: Bad
    value' when building Linux MIPS kernels."), which went in back in 2007,
    <https://inbox.sourceware.org/binutils/[email protected]/>,
    we've been warning about unmatched HI16 REL relocations in the linker,
    as it has been concluded in the discussion on PR ld/4208 that we have no
    need to be forgiving about compiler bugs that lead to object files to be
    made that are not compliant with the psABI.

    However no corresponding update has ever been made to GAS, despite that
    it's always helpful to issue a warning as early as possible in the build
    process.  In this particular case GAS also has more information to hand
    as it always has the full original addend available that has been used
    for both the high-part and the low-part relocation, while the linker has
    to rely on the in-place value stored in the relocatable field by earlier
    processing, which has necessarily been truncated.  Therefore the linker
    may miss cases where unrelated high-part and low-part relocations have
    been put next to each other that had significantly different addends at
    assembly time (small differences are deliberately permitted where they
    are known not to affect any borrow from the high part).

    Additionally GAS is able to point at the exact place in sources where
    any offending orphan relocations have been used.

    Update GAS to issue the warning then where applicable and remove an old
    comment referring to GCC producing orphan HI16 relocations.

    Test cases will be added with a separate change.

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

Reply via email to