Subject: ld.elf_so bug in 1.4.x on pmax?
To: None <port-pmax@netbsd.org, tech-toolchain@netbsd.org, tech-kern@netbsd.org>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: tech-toolchain
Date: 10/20/1999 01:55:34
Emacs on X displays on pmaxes has been crashing since 1.4 came out.
Turns out that some file-scope structures in the main program (emacs)
are initialized to point to data in other libraries (e.g., Xt)
via
	
	struct foo foo = {.... , &widgetClassRec}

but with the 1.4 code, when main starts, instead of the address of
widgetClassRec, that slot has exactly twice that value.


I tried building ld.elf_so with -DRTLD_RELOC_DEBUG and sure enough,
the main-program references are twice what the inter-library
references are:

% emacs >& /var/tmp/EMACS-RELOC
% grep -i widgetclassrec /var/tmp/EMACS-RELOC

REL32 widgetClassRec in main program --> 0x406f2c80 in /usr/X11R6/lib/libXt.so.6
REL32 widgetClassRec in main program --> 0x406f2c80 in /usr/X11R6/lib/libXt.so.6
REL32 widgetClassRec in /usr/X11R6/lib/libXaw.so.6 --> 0x20368640 in /usr/X11R6/lib/libXt.so.6
REL32 widgetClassRec in /usr/X11R6/lib/libXt.so.6 --> 0x20368640 in /usr/X11R6/lib/libXt.so.6

where of course 0x20368640  + 0x20368640 =  0x406d0c80

static linking against libXt masks this immediate problem, but emacs
runs straight into a another occurence. Anyone got a clue what's going
wrong, or how we can fix it?