http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57260
--- Comment #9 from Lee Duhem <lee.duhem at gmail dot com> --- (In reply to Andrew Pinski from comment #8) > No they are both the same case: If glxdri.c is compiled by gcc with -O2, gcc 4.9.0 will generate four relocations for DRIBlockHandler, two R_MIPS_JALR, one R_MIPS_CALL16 and one R_MIPS_GOT_DISP; and gcc 4.4.6 will generate three relocations for DRIBlockHandler, two R_MIPS_CALL16 and one R_MIPS_GOT_DISP. According to "64-bit ELF Object File Specification"[1], the difference between R_MIPS_CALL16 and R_MIPS_GOT_DISP is that the former could be resolved to a lazy stub by the dynamic linker, "whereas the latter must be resolved to the ultimate address at initialization." In other words, lazy binding would not work for R_MIPS_GOT_DISP. My question is: 1. Why does gcc generate R_MIPS_GOT_DISP for the calls to DRIBlockHandler or DRIWakeupHandler? 2. Is it possible to modify glxdir.c so that in the final libglx.so, which is generated by using glxdri.o and other object files, the calls to DRIBlockHandler and DRIWakeupHandler could be resolved to a lazy stub, therefore dlopen can open it correctly? Thank you for your time. [1] http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf