[MIPS] R_MIPS_GOT_DISP interferes with lazy binding

Richard Sandiford rdsandiford@googlemail.com
Tue May 7 10:32:00 GMT 2013


Lee Duhem <lee.duhem@gmail.com> writes:
> My questions are:
> 1. Are the relocation types of DRIBlockHandler and DRIWakeupHandler correct?

It depends on what the source code is doing.  The two DRIBlockHandler
R_MIPS_CALL16s sites are obviously direct calls to the function, but is
the R_MIPS_GOT_DISP site too?  Or is the code taking the address of
DRIBlockHandler, e.g. to use it as a callback?

It's a bug if the compiler is generating a R_MIPS_GOT_DISP for
a direct call.  (This might happen, e.g., due to overly aggressive
hoisting or CSE.)  On the other hand, R_MIPS_GOT_DISP is the correct
choice if something is taking the address of the function.

> 2. If they are correct, is the information of these symbols in
> libglx.so correct, in other words,
> did ld handle them correctly?
> 3. If the answers to the first two questions are both true, does this
> mean that the dlopen failure
> is a dynamic linker (ld.so) bug?

The static and dynamic linkers are doing the right thing;
R_MIPS_GOT_DISP is supposed to disable lazy resolution.

Thanks,
Richard



More information about the Binutils mailing list