From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Koundinya.K" To: ian@cygnus.com Cc: bfd@cygnus.com, gas2@cygnus.com Subject: GNU Linker and mips... Date: Thu, 11 Feb 1999 06:48:00 -0000 Message-id: <199902111430.UAA16259@bombay.ddeorg.soft.net> X-SW-Source: 1999/msg00018.html Hi, Here is some info on my debugging the GNU linker with gdb as suggested. I just took the small test program of "hello" to avoid those thousands of assembly instructions. As you know the output that I get is hello dynamic linker: ./tt: unidentifiable procedure reference (address = 0x40062cd8) Killed Now what is there at this location and from where is this message coming... O.K From the assembly I could see the following... 0x40062cd8 [_exithandle+0x6c]: lw %t0,0(%s) This message is coming from the function _binder when a call to this function is made as ... _binder(0x23,0x40062cd8,0x400bf2fo,0x40052fd0) I do have access to DDE-MIPS SVR4.2 Sources here and that is how I could locate where this message is coming from. I am attaching the file binder.c which is part of the libc and rtld for mipsr4000. The base for the mips-dde-sysv4.2MP port seems to have mainly come from i386 as base. - ---- Some clip from that (although I am attaching that file at end ) ----- unsigned long _binder( unsigned long sym_index, unsigned long pc) { struct rt_private_map *nlm, *first_lm, *lm; char *symname; - - - - - - - - - - - - Some line go here ..... /* Note that since the MIPS ABI doesn't provide a means for passing * lm from the stub routines, so we must get this information * someplace else. Here we just start with the head of the list * which is stored in the global variable _ld_loaded. This may * not be correct for objects which have DT_SYMBOLIC set. * FIXME! */ lm = _rt_address_to_lm(_ld_loaded,pc); if (!lm) { _rtfprintf(2, "%s: %s: unidentifiable procedure reference (addre ss = 0x%x)\n",(char*) _rt_name,_proc_name,pc); (void)_rtkill(_rtgetpid(), SIGKILL); } - ------------------ End of the clip .. later stuff not here - ------------------- So here is the message that I am getting . But how and why is it happening , I could not think. Any pointers on this.... Could there be any problems with the start up file like crti, crt1 and crtn used. This is how the linking is done ... -------------------------------------------------------------------------- /usr/local/mips-dde-sysv4.2MP/bin/ld /usr/lib/ld.so.1 /usr/local/mips-dde-sysv4.2MP/lib/crt1.o /usr/local/mips-dde-sysv4.2MP/lib/crti.o /usr/local/mips-dde-sysv4.2MP/lib/values-Xa.o -L/usr/local/lib/gcc-lib/mips-dde-sysv4.2MP/egcs-2.91.57 -L/usr/local/mips-dde-sysv4.2MP/lib -L/usr/local/lib /var/tmp/ccrLBNAM.o -lgcc -L/usr/lib -lc -lgcc /usr/local/mips-dde-sysv4.2MP/lib/crtn.o GNU ld version 2.9.4 (with BFD 990118) Supported emulations: elf32bsmip -------------------------------------------------------------------------- Could using the crtbegin and crtend help. Why don't the MIPS targets use them.. Thanks for any help and information in advance. With best regards Koundinya Here is the file binder.c (which is a part of the native libc source )that I am attaching... Thanks for any help in advance. Koundinya