[llvm-bugs] [Bug 24286] relocation R_MIPS_26 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 10 06:32:27 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=24286

David Chisnall <csdavec at swan.ac.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from David Chisnall <csdavec at swan.ac.uk> ---
This looks like a bug in the input code.  The relocation is caused by this
inline assembly:

jal   __do_global_dtors_aux

This is wrong for PIC, it should be:

    dla  $t9, __do_global_dtors_aux
    jalr $t9

The assembly is instantiated from the macro CRT_CALL_STATIC_FUNCTION.  This
appears to come from contrib/gcc/config/mips/mips.h, which contains some
wonderful things like '/* Switch to #elif when we're no longer limited by K&R
C.  */' and, though it does have O32 and N64 / N32 variants, it doesn't appear
to be have a PIC variant.

This code is sufficiently horrible that the correct fix probably involves
napalm.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150810/0c517785/attachment.html>


More information about the llvm-bugs mailing list