Subject: what does "relocation truncated to fit: ELF_LITERAL winstr" from 'ld' mean?
To: NetBSD/alpha Discussion List <port-alpha@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: port-alpha
Date: 08/03/2003 02:12:03
I'm trying to build netbsd-1-6 on alpha, for alpha (using build.sh of
course), and I'm trying to build a fully static-linked system with '-g'
for debugging.  All went well until:

/home/proven/woods/NetBSD-1.6.x-alpha-tools/bin/alpha--netbsd-gcc  -static -o sushi -nostdlib  /home/proven/woods/NetBSD-1.6.x-alpha-destdir/usr/lib/crt0.o /home/proven/woods/NetBSD-1.6.x-alpha-destdir/usr/lib/crtbegin.o sushi.o scandir.o menutree.o scanform.o run.o functions.o handlers.o blabel.o -lutil -lcdk -lform -lcurses -lm -L/home/proven/woods/NetBSD-1.6.x-alpha-obj/proven/work/woods/m-NetBSD-1.6/usr.sbin/pkg_install/lib -linstall -L/home/proven/woods/NetBSD-1.6.x-alpha-destdir/usr/lib  -lgcc -lc -lgcc /home/proven/woods/NetBSD-1.6.x-alpha-destdir/usr/lib/crtend.o
/home/proven/woods/NetBSD-1.6.x-alpha-destdir/usr/lib/libcurses.a(instr.o): In function `instr':
/proven/work/woods/m-NetBSD-1.6/lib/libcurses/instr.c:57: relocation truncated to fit: ELF_LITERAL winstr
/home/proven/woods/NetBSD-1.6.x-alpha-destdir/usr/lib/libcurses.a(instr.o): In function `mvinstr':
/proven/work/woods/m-NetBSD-1.6/lib/libcurses/instr.c:76: relocation truncated to fit: ELF_LITERAL mvwinstr
/home/proven/woods/NetBSD-1.6.x-alpha-destdir/usr/lib/libcurses.a(instr.o): In function `mvwinstr':
/proven/work/woods/m-NetBSD-1.6/lib/libcurses/instr.c:98: relocation truncated to fit: ELF_LITERAL winstr
collect2: ld returned 1 exit status
*** Error code 1

Stop.
nbmake: stopped in /proven/work/woods/m-NetBSD-1.6/usr.sbin/sushi
*** Error code 1


I've built this same source tree fine on i386 for both i386 and sparc
targets, both fully static-linked, and both with '-g'.

Note that I'm already well past the build of 'vi', which I'm assuming
makes nearly as extensive use of libcurses as 'sushi' does, and though
'vi' doesn't make use of libcdk or libform the errors above seem to be
specific to libcurses.....

$ cd ~/NetBSD-1.6.x-alpha-obj/usr/src/usr.bin/vi
$ file build/vi
build/vi: ELF 64-bit LSB executable, Alpha (unofficial), version 1 (SYSV), for NetBSD, statically linked, not stripped
$ size build/vi
text    data    bss     dec     hex     filename
691064  22984   24140   738188  b438c   build/vi
$ ls -l build/vi
-rwxr-xr-x  1 woods  users  3401070 Aug  2 21:57 build/vi

It doesn't seem to make use of the functions mentioned in the errors
above though:

$ nm build/vi | fgrep instr
ksh: exit code: 1

FYI:

$ cd ../../lib/libcurses/ 
$ nm instr.o
0000000000000000 a *ABS*
0000000000000040 T innstr
0000000000000000 T instr
00000000000000e0 T mvinnstr
0000000000000080 T mvinstr
00000000000001c0 T mvwinnstr
0000000000000140 T mvwinstr
                 U stdscr
0000000000000280 T winnstr
0000000000000240 T winstr
                 U wmove

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>