Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

link time reference error

2 views
Skip to first unread message
Message has been deleted

Paul Pluzhnikov

unread,
Jun 10, 2003, 12:05:39 AM6/10/03
to
gary <ga...@grobe.net> writes:

> I just compiled a c++ extension to TCL w/ the 'gcc296' compiler. I'm on
> RH 9.0. All built fine and then I tried to run it and got the following
> error.
>
> libAnotherDependentLib.so.7: symbol __pthread_atfork, version GLIBC_2.0
> not defined in file libpthread.so.0 with link time reference
>
> Anyone help out w/ what this means?

This appears to be a bug in the RH-9 (and possibly others) glibc
compilation. The details are as follows:

glibc 2.2.5 and below define and export

00008600 g DF .text 00000097 GLIBC_2.0 __pthread_atfork
00008600 g DF .text 00000097 GLIBC_2.0 pthread_atfork

Note that they are aliased, and that the __pthread_atfork is
considered 'internal', i.e. programs are not supposed to reference it.

In glibc 2.3.2 (as shipped with RH-9) libpthread.so only defines a
"hidden" (GLIBC_2.0) pthread_atfork (for compatibility), but does
not define __pthread_atfork.

Unfortunately, this breaks backward compatibility: any C++ shared
library, built on an earlier system, will have __pthread_atfork
reference *if* it was linked with 'g++ -pthread' or with 'g++
... -lpthread' *and* used libstdc++.a *and* iostream facilities,
even if the code for the library itself does not reference this
function (the reference comes from libstdc++.a).

Workarounds:

- relink libAnotherDependent.so.7 on the RH-9 system, or
- relink it wherever it was built originally, but link against libstdc++.so, or
- relink it *without* specifying -pthread or -lpthread on the link line, or
- hex-edit libAnother...so and replace string "__pthread_atfork" with
"pthread_atfork" in the .dynstr section.

(The last 2 options are *ugly* hacks).

Cheers,
--
In order to understand recursion you must first understand recursion.

0 new messages