Subject: Re: bad libc from build on netbsd-1-5 branch on sparc - SOLVED
To: None <netbsd-users@netbsd.org>
From: Greg Troxel <gdt@ir.bbn.com>
List: netbsd-users
Date: 06/06/2003 13:46:06
My problem was that somehow a bad /usr/lib/crt{begin,end}.o got built,
and shlibs linked with this were broken.  The bad crtbegin was missing
some symbols:

00000000 l     O .ctors 00000004 __CTOR_LIST__
00000000 l     O .data  00000004 initialized.6
00000000 l     O .eh_frame      00000000 __EH_FRAME_BEGIN__
00000000 l     O .bss   00000000 object.7
00000000 l     O .dtors 00000004 __DTOR_LIST__

I have no idea how a crtbegin.o got built without these.  Just 'make
clean && make && make install', followed by rebuilding all the libs,
seems to have resulted in a good build.

full objdump --syms of the good version, followed by bad:

/usr/lib/crtbegin.o:     file format elf32-sparc

SYMBOL TABLE:
00000000 l    d  .init  00000000 
00000000 l    d  *ABS*  00000000 
00000000 l    d  .text  00000000 
00000000 l    d  .fini  00000000 
00000000 l    d  *ABS*  00000000 
00000000 l    d  .data  00000000 
00000000 l    d  .eh_frame      00000000 
00000000 l    d  .ctors 00000000 
00000000 l    d  .dtors 00000000 
00000000 l    d  .bss   00000000 
00000000 l    d  .comment       00000000 
00000000 l    d  .note.netbsd.ident     00000000 
00000000 l    d  *ABS*  00000000 
00000000 l    d  *ABS*  00000000 
00000000 l    d  *ABS*  00000000 
00000000 l     O .ctors 00000004 __CTOR_LIST__
00000000 l     O .data  00000004 initialized.6
00000000 l     O .eh_frame      00000000 __EH_FRAME_BEGIN__
00000000 l     O .bss   00000000 object.7
00000000 l     O .dtors 00000004 __DTOR_LIST__
00000098 g     F .init  00000078 _init
00000000  w      *UND*  00000000 __deregister_frame_info
00000050 g     F .fini  0000004c _fini
00000000         *UND*  00000000 _GLOBAL_OFFSET_TABLE_
00000000  w      *UND*  00000000 __register_frame_info

~ > objdump --syms crtbegin.o 

crtbegin.o:     file format elf32-sparc

SYMBOL TABLE:
00000000 l    d  .init  00000000 
00000000 l    d  *ABS*  00000000 
00000000 l    d  .text  00000000 
00000000 l    d  .fini  00000000 
00000000 l    d  *ABS*  00000000 
00000000 l    d  .data  00000000 
00000000 l    d  .eh_frame      00000000 
00000000 l    d  .ctors 00000000 
00000000 l    d  .dtors 00000000 
00000000 l    d  .bss   00000000 
00000000 l    d  .comment       00000000 
00000000 l    d  .note.netbsd.ident     00000000 
00000000 l    d  *ABS*  00000000 
00000000 l    d  *ABS*  00000000 
00000000 l    d  *ABS*  00000000 
00000080 g     F .init  00000058 _init
00000000  w      *UND*  00000000 __deregister_frame_info
0000003c g     F .fini  00000038 _fini
00000000  w      *UND*  00000000 __register_frame_info