Subject: toolchain/16529: link time error of MIPS crunched binary with -Wa,-xgot
To: None <gnats-bugs@gnats.netbsd.org>
From: None <shin@sm.sony.co.jp>
List: netbsd-bugs
Date: 04/28/2002 17:59:16
>Number:         16529
>Category:       toolchain
>Synopsis:       link time error of MIPS crunched binary with -Wa,-xgot
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 28 02:00:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Takao Shinohara
>Release:        NetBSD 1.5.2
>Organization:
	
>Environment:
	
System: NetBSD narnia.sm.sony.co.jp 1.5.2 NetBSD 1.5.2 (GENERIC) #0: Mon Sep 10 17:24:30 JST 2001 shin@narnia.sm.sony.co.jp:/u/home/shin/release/src/sys/arch/i386/compile/GENERIC i386

>Description:

MIPS crunched binary which was compiled with -Wa,-xgot option may get
relocation error at link time.

[excerpt of pmax cross-build log]

/u/home/shin/netbsd/tools/bin/mipsel--netbsd-gcc -Os -Wa,-xgot  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized  -Werror  -I. -I/u/home/shin/netbsd/src/distrib/utils/sysinst/arch/pmax/../.. -I/u/home/shin/netbsd/src/distrib/utils/sysinst/arch/pmax  -DREL=\"1.5ZC\" -DMACH=\"pmax\" -nostdinc -isystem /u/home/shin/netbsd/pmax/root/usr/include  -c /u/home/shin/netbsd/src/distrib/utils/sysinst/arch/pmax/md.c
/u/home/shin/netbsd/tools/bin/mipsel--netbsd-ld -dc -r -o sysinst.cro sysinst_stub.o sysinst/menu_defs.o sysinst/msg_defs.o sysinst/main.o sysinst/install.o sysinst/upgrade.o sysinst/txtwalk.o sysinst/run.o sysinst/factor.o sysinst/net.o sysinst/disks.o sysinst/disks_lfs.o sysinst/util.o sysinst/geom.o sysinst/label.o sysinst/target.o sysinst/md.o
/u/home/shin/netbsd/tools/bin/mipsel--netbsd-objcopy --keep-global-symbol _crunched_sysinst_stub sysinst.cro
/u/home/shin/netbsd/tools/bin/mipsel--netbsd-gcc  -static -o instbin -nostdlib  /u/home/shin/netbsd/pmax/root/usr/lib/crt0.o /u/home/shin/netbsd/pmax/root/usr/lib/crtbegin.o instbin.o cat.cro chmod.cro cp.cro dd.cro df.cro ed.cro expr.cro hostname.cro ln.cro ls.cro kill.cro mkdir.cro mt.cro mv.cro pwd.cro pax.cro rm.cro sh.cro stty.cro sleep.cro sync.cro fsck_ffs.cro reboot.cro ifconfig.cro init.cro mknod.cro mount.cro mount_cd9660.cro mount_ffs.cro mount_nfs.cro newfs.cro ping.cro route.cro shutdown.cro slattach.cro umount.cro chflags.cro ftp.cro gzip.cro sed.cro sort.cro tip.cro chown.cro chroot.cro csh.cro date.cro rcp.cro rcmd.cro disklabel.cro fsck_ext2fs.cro mount_ext2fs.cro mount_kernfs.cro netstat.cro rsh.cro tset.cro vi.cro installboot.cro sysinst.cro  -lrmt -ledit -lutil -lcurses -ltermcap -lbz2 -lcrypt -lintl -ll -lm -lkvm -L/u/home/shin/netbsd/pmax/root/usr/lib  -lgcc -lc -lgcc /u/home/shin/netbsd/pmax/root/usr/lib/crtend.o
/u/home/shin/netbsd/pmax/root/usr/lib/crtbegin.o: In function `_init':
/u/home/shin/netbsd/src/lib/csu/mips/../common_elf/crtbegin.c(.init+0x12c): relocation truncated to fit: R_MIPS_GOT16 __register_frame_info
/u/home/shin/netbsd/src/lib/csu/mips/../common_elf/crtbegin.c(.init+0x154): relocation truncated to fit: R_MIPS_CALL16 __register_frame_info
/u/home/shin/netbsd/src/lib/csu/mips/../common_elf/crtbegin.c(.init+0x18c): relocation truncated to fit: R_MIPS_GOT16 _Jv_RegisterClasses
/u/home/shin/netbsd/src/lib/csu/mips/../common_elf/crtbegin.c(.init+0x19c): relocation truncated to fit: R_MIPS_CALL16 _Jv_RegisterClasses

	(many lines are deleted)

>How-To-Repeat:

build miniroot for pmax. (distrib/miniroot)
	
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted: