This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

linker question, silent duplicate symbol problem


If this isn't the right mailing list, please just point me in the right direction.

GLIBC has an allocated structure called _r_debug, of type B (bss) in ld-linux-x86-64.so.2, according to nm.

The application's object file also seems to allocate _r_debug, of type C (common), according to nm.

After the link, nm claims there is one symbol.  However, in gdb, I can clearly see that there are two vastly different addresses both labeled as the _r_debug symbol.  I got this from stepping into dl_main() / dl_debug_initialize(), and stepping into the application space where it attempts to access _r_debug.  The application sees a blank structure naturally, as glibc initialized at the other location.

(1) Why didn't the linker complain, and did it do something wrong here?
(2) Or is the fault squarely on the provided application's object file?

I altered the provided object file to rename the symbol as a short-term solution, but it would be nice to know the answer for sure, so I can file a proper application bug report knowing that I'm correct.  ie, if they blame the linker, it would be helpful to clearly know why the linker isn't at fault here, because I'm pretty sure the answer is #2.

(This is with x86_64 binutils-2.18 and gcc-4.2.2 tool chain.)

Thanks!
Jason Mancini



      


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]