Questions about runtime linking...

David Daney ddaney@avtrex.com
Tue May 18 17:33:00 GMT 2004


Background:

I am running a program on mipsel-linux linked against glibc, libgcj and 
other shared libraries.  In this program there are several places where 
tolower(3) is called.  This is converted by gcc into a lookup against a 
symbol called "__ctype_tolower" that is in libc.so.6.  Since this is 
mips, the symbol is accessed via the GOT, also this is a very large 
program so we are in a multi-got situation.  Some of the GOT entries 
point to the proper place (__ctype_tolower) others point to the wrong 
place (causing a SIGSEGV when accessed).

On a version of this program that does not exhibit these problems, If I 
run objdump -R on the program I get a bunch of relocations against 
libgcj, but there are none against libc.so.6.

If I run "objdump -T testapp | grep UND" I get :
00520c10      DF *UND*  00000000              _ZN4java4lang4Byte9byteValueEv
00000000  w   D  *UND*  00000000              __gmon_start__
00520c00      DF *UND*  00000000              _Jv_NewObjectArray
00000000      DF *UND*  00000000  GLIBC_2.0   shmat
00520bf0      DF *UND*  00000000              
_ZN4java4util6Arrays6equalsEP6JArrayIcES4_
00000000      DO *UND*  00000068              
_ZN4java5beans21PropertyChangeSupport6class$E
00520be0      DF *UND*  00000000              
_ZN4java4lang12StringBuffer6appendEPNS0_6ObjectE
00000000      DF *UND*  00000000              _ZN4java4lang6Thread5startEv
00520bd0      DF *UND*  00000000              
_ZN4java4lang6System6setErrEPNS_2io11PrintStreamE
00000000      DO *UND*  00000068              _ZN4java4util5Stack6class$E
00000000      DF *UND*  00000000  GLIBC_2.0   read
.
.
.
Where there are symbols from glibc that are undefined and need fixups.

Questions:

What property of a symbol make it appear as a dynamic relocation entry?

Why don't symbols from glibc appear in the dynamic relocation entries?

How do I find where the relocations are for the undefined symbols from 
an objdump -T testapp listing?

And for bonus points:  What would cause glibc's "__ctype_tolower" symbol 
to appear as a dynamic relocation entry (thus seeming to cause my 
problems), when normally it does not?

I apologize in advance if this is covered in some ELF FAQ somewhere that 
I have not found.

David Daney.




More information about the Binutils mailing list