bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/20649] [MIPS] Can't find matching LO16 reloc


From: address@hidden
Subject: [Bug gas/20649] [MIPS] Can't find matching LO16 reloc
Date: Fri, 30 Sep 2016 03:20:04 +0000

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

Maciej W. Rozycki <address@hidden> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |address@hidden

--- Comment #2 from Maciej W. Rozycki <address@hidden> ---
Created attachment 9544
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9544&action=edit
Intended bug fix

Thank you for your bug report.

I have looked into this problem and it looks like a GAS regression to
me, albeit a very old one.  It was introduced with commit 8614eeee67f9,
which unfortunately was bundled with an unrelated change, made with no
discussion or justification posted, had no test case included, and only
a terse notification was sent afterwards ("Traditional MIPS patches"),
<https://sourceware.org/ml/binutils/2000-07/msg00018.html>.

It made symbols in linkonce or what is these days known as comdat
sections to be treated as external for the purpose of PIC relocation
generation even if their binding remains STB_LOCAL.  This in turn
disabled GOT16/LO16 relocation pairing as no complementing LO16
relocation is expected for external GOT16 references in the o32 ABI.

Please try the patch attached which seems to fix the issue for me and
causes no regressions in `mips-linux-gnu' binutils testing.  I'll be
committing it as soon as I have suitable test cases made and it has
passed full regression testing across the relevant targets.

NB GCC has done a pretty decent job here as in actual code execution
the GOT16 reference just below $L15 is actually paired with the
complementing LO16 reference at $L17 as it's in a delay slot of a
branch going to the latter location.  So the GOT16 reference is not
orphan even though it is duplicate from the ELF file's point of view.

        gas/
        * config/tc-mips.c (pic_need_relax): Don't check for linkonce
        symbols, remove the `segtype' parameter.
        (mips_frob_file, md_estimate_size_before_relax): Adjust
        accordingly.
        (s_is_linkonce): Add an explanatory comment.

-- 
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]