Subject: Re: Startup code of NetBSD
To: NetBSD tech-kern <tech-kern@netbsd.org>
From: Anand Lalgondar <solarflares@fastmail.fm>
List: tech-kern
Date: 12/12/2003 16:41:58
Hello,
Think I made a mistake, would like to mention that:
Compilation mistake:
1. first *.o should be generated with the following command:
# mipsel--netbsd-gcc -c txsio.c
INSTEAD OF mipsel--netbsd-gcc -o txsio.o txsio.c
So next I did the following
coded a crt0.S file with the following contents:
------------------------------------------------
#include "txsio.h" /* includes declaration of main() */
.globl start
start:
jal (_main)
nop
------------------------------------------------
and assembled it with the following command:
# mipsel--netbsd-as -o crt0.o crt0.S
Then I tried to link with following command which poped this error
message:
# mipsel--netbsd-ld -T ld.ldscript crt0.o txsio.o
mipsel--netbsd-ld: txsio.o: linking PIC files with non-PIC files
Bad value: failed to merge target specific data of file txsio.o
crt0.o(.text+0x0): undefined reference to `_main'
txsio.o: In function `main':
txsio.c(.text+0x48): relocation truncated to fit: R_MIPS_GOT16 no symbol
txsio.c(.text+0x54): relocation truncated to fit: R_MIPS_GOT16 no symbol
txsio.o: In function `print':
txsio.c(.text+0x120): relocation truncated to fit: R_MIPS_GOT16 no symbol
#
Can anyone please provide some input.
Thanks anyways.
- Anand
--
http://www.fastmail.fm - Send your email first class