This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

[MIPS] R_MIPS_GOT_DISP interferes with lazy binding


Hi,

On a MIPS N64 machine, when Xorg try to load libglx.so by using
dlopen() with lazy binding,
Xorg failed and gave the following message

[ 23361.062] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
[ 23361.063] (EE) Failed to load
/usr/lib64/xorg/modules/extensions/libglx.so:
/usr/lib64/xorg/modules/extensions/libglx.so: undefined symbol:
DRIBlockHandler

Here is the symbol information of this failing symbol:

Symbol table '.symtab' contains 1622 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
    47: 00000000000530a0     0 FUNC    GLOBAL DEFAULT  UND DRIDestroyContext
    83: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND DRIBlockHandler
   102: 0000000000052da0     0 FUNC    GLOBAL DEFAULT  UND DRIDestroyDrawable
   134: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND DRIWakeupHandler
  1492: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND DRIWakeupHandler
  1531: 0000000000052da0     0 FUNC    GLOBAL DEFAULT  UND DRIDestroyDrawable
  1553: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND DRIBlockHandler
  1597: 00000000000530a0     0 FUNC    GLOBAL DEFAULT  UND DRIDestroyContext

This is the build command of libglx.so:

gcc -std=gnu99 -shared  .libs/glxmodule.o  -Wl,--whole-archive
../../../glx/.libs/libglx.a ../../../glx/.libs/libglxdri.a
-Wl,--no-whole-archive  -ldl -laudit -lm -lrt  -Wl,-z -Wl,relro
-Wl,-soname -Wl,libglx.so -o .libs/libglx.so

The places that refer to DRIBlockHandler are in libglxdri.a, and the
related symbol information
in this file is

Relocation section '.rela.text' at offset 0x1cd38 contains 336 entries:
    Offset             Info             Type               Symbol's
Value  Symbol's Name + Addend
0000000000001234  000000640000000b R_MIPS_CALL16
0000000000000000 DRIBlockHandler + 0
                    Type2: R_MIPS_NONE
                    Type3: R_MIPS_NONE
00000000000012c4  000000640000000b R_MIPS_CALL16
0000000000000000 DRIBlockHandler + 0
                    Type2: R_MIPS_NONE
                    Type3: R_MIPS_NONE
00000000000013b4  0000006400000013 R_MIPS_GOT_DISP
0000000000000000 DRIBlockHandler + 0
                    Type2: R_MIPS_NONE
                    Type3: R_MIPS_NONE

0000000000001448  0000006500000013 R_MIPS_GOT_DISP
0000000000000000 DRIWakeupHandler + 0
                    Type2: R_MIPS_NONE
                    Type3: R_MIPS_NONE
000000000000148c  0000006500000013 R_MIPS_GOT_DISP
0000000000000000 DRIWakeupHandler + 0
                    Type2: R_MIPS_NONE
                    Type3: R_MIPS_NONE

0000000000001614  0000006a0000000b R_MIPS_CALL16
0000000000000000 DRIDestroyDrawable + 0
                    Type2: R_MIPS_NONE
                    Type3: R_MIPS_NONE
0000000000001720  0000006a0000000b R_MIPS_CALL16
0000000000000000 DRIDestroyDrawable + 0
                    Type2: R_MIPS_NONE
                    Type3: R_MIPS_NONE

Symbol table '.symtab' contains 122 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
   100: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND DRIBlockHandler
   101: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND DRIWakeupHandler
   105: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND DRICreateDrawable
   106: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND DRIDestroyDrawable

My questions are:
1. Are the relocation types of DRIBlockHandler and DRIWakeupHandler correct?
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?

Any suggestion about the reason of this problem or how to fix it will
be most welcomed.
If you need and additional information, pleas let me know, I will
reply as soon as possible.

Sincerely,
lee


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