[PATCH] libdl.c: static link fail for mips

Gregory Fong gregory.0xf0 at gmail.com
Mon Jun 3 20:29:24 UTC 2013


> Bernhard Reutner-Fischer wrote:
> On 23 February 2013 10:48, Bernhard Reutner-Fischer
> <rep.dot.nop at gmail.com> wrote:
>> On Fri, Feb 22, 2013 at 02:06:43PM -0800, Vincent Wen wrote:
>>>When build statically linked applications for MIPS platform,
>>>sometimes the linker fails with following errors:
>>>undefined reference to TLS_DTPREL_VALUE
>>>undefined reference to TLS_TPREL_VALUE
>>
>> I still suspect that these uses may need a SHARED guard, no?
>
> Would any static linkage legitimately use DTPREL?

Yes, on MIPS, it would use DTPREL: "R_MIPS_TLS_DTPREL32 and
R_MIPS_TLS_DTPREL64, originally only resolved by the dynamic linker,
were reused as static relocations as well for use in debug
information." (see http://www.linux-mips.org/wiki/NPTL )  From what I
can tell this also applies to TPREL.

As far as I can tell, this is MIPS-specific but also shouldn't break
other archs, so the patch previously submitted by Vincent Wen
adequately solves this problem (see
http://lists.uclibc.org/pipermail/uclibc/2013-March/047701.html ).
However, the commit comment doesn't explain why it solves the problem,
so I'll submitting a patch shortly with an improved explanation.

Best regards,

Gregory


More information about the uClibc mailing list