linker question, silent duplicate symbol problem

xorbe xorbe@yahoo.com
Mon Mar 7 17:26:00 GMT 2011


Oh yah, just for the record since Google returns little about this topic,
glibc symbol _r_debug seems special -- there really are two copies at
different addresses.  One for static programs, and one for dynamically
linked programs.

The issue with the application at hand is that a pthread structure is
initialized before the dynamic copy of _r_debug.  Pthread init uses memset
-- which has been overridden.  The custom memset attempts to check _r_debug,
but the loader points it at the dynamic version which is still pending to
be initialized (but the static copy is already initialized).

Removing the _r_debug symbol from the application causes the special memset
to suddenly use the static version initialized earlier instead -- so that
was a bit misleading.

Jason


      



More information about the Gcc-help mailing list