Rod Evans wrote: > Alan Coopersmith wrote: >> Specifically, when building the Xorg loadable driver modules, >> in order to use -z defs, I've been including a mapfile listing >> all the exported symbols from the Xorg binary like this: >> >> AbortDDX = FUNCTION extern; >> AbortServer = FUNCTION extern; >> Acc = DATA extern; >> >> should those specify parent instead of extern? Would that >> cause direct bindings for those symbols if building with -B direct ? > > When combined with direct bindings, "parent" instructs ld.so.1 to look > for the reference symbol in the parent of the object that makes the > reference. ld.so.1 will look nowhere else.
So I tried an Xorg build using "parent" instead of "extern" - and while it built, at runtime it couldn't find a number of symbols in dlopen()ed modules with direct bindings to parent until I started Xorg with LD_NODIRECT=1. For instance: dlopen: ld.so.1: Xorg: fatal: relocation error: file /usr/X11/lib/modules/input/ amd64//kbd_drv.so: symbol noXkbExtension: referenced symbol not found Running with various LD_DEBUG flags: 25777: BASE: 1: file=/usr/X11/lib/modules/input/amd64//kbd_drv.so; dlopen() cal led from file=/usr/X11/bin/amd64/Xorg [ RTLD_LAZY RTLD_GLOBAL RTLD_GROUP RTLD_W ORLD ] 25777: BASE: 1: in R_AMD64_GLOB_DATA 0x140c0 0x0 noXkbExtension 25777: BASE: 1: ld.so.1: Xorg: fatal: relocation error: file /usr/X11/lib/module s/input/amd64//kbd_drv.so: symbol noXkbExtension: referenced symbol not found % elfdump /usr/X11/lib/modules/input/amd64//kbd_drv.so | grep noXkbExtension [2] 0x0000000000000000 0x0000000000000000 OBJT GLOB D 0 UNDEF noXkbExtension [117] 0x0000000000000000 0x0000000000000000 OBJT GLOB D 0 UNDEF noXkbExtension [2] noXkbExtension [24] 0x00000000000140c0 0x0000000000000000 R_AMD64_GLOB_DATA noXkbExtension [2] DB <parent> noXkbExtension R_AMD64_GLOB_DATA 0x140c0 0 .SUNW_reloc noXkbExtension % elfdump /usr/X11/bin/amd64/Xorg | grep noXkbExtension [1360] 0x0000000000815f48 0x0000000000000004 OBJT GLOB D 0 .bss noXkbExtension [5602] 0x0000000000815f48 0x0000000000000004 OBJT GLOB D 0 .bss noXkbExtension [2767] 0x0000000000815f48 0x0000000000000004 OBJT GLOB D 0 .bss noXkbExtension [1360] noXkbExtension [1360] DB <self> noXkbExtension (The test system is running nv_64 if that matters.) Any idea what I've done wrong here? -- -Alan Coopersmith- alan.coopersmith at sun.com Sun Microsystems, Inc. - X Window System Engineering