This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

how to use newlib to link (mips)


I have installed the newlib for mips-elf in the directory 
/usr/local/mips-mips-elf.But I failed to link the program with the 
newlib.Take the simple hello.c as an example:
       mips_41xx_le-gcc  -c hello.c -o hello.o
       mips_41xx_le-gcc  -nostdlib -L/usr/local/mips-mips-elf/lib -lc 
-nostdinc -I/usr/local/mips-mips-elf/include hello.o 
/usr/local/mips-mips-elf/lib/crt0.o -o hello

The following is  the error message:
/usr/local/mips-mips-elf/lib/crt0.o(.got+0x0): multiple definition of 
`_GLOBAL_OFFSET_TABLE_'
/opt/hardhat/devkit/mips/41xx_le/mipsel-hardhat-linux/bin/ld: warning: 
cannot find entry symbol __start; defaulting to 0000000000400910
/usr/local/mips-mips-elf/lib/crt0.o: In function `zerobss':
../../../../libgloss/mips/crt0.S(.text+0x5c): undefined reference to 
`get_mem_info'
../../../../libgloss/mips/crt0.S(.text+0x6c): undefined reference to 
`__stack'
/usr/local/mips-mips-elf/lib/crt0.o: In function `init':
../../../../libgloss/mips/crt0.S(.text+0x98): undefined reference to 
`hardware_init_hook'
../../../../libgloss/mips/crt0.S(.text+0xac): undefined reference to 
`software_init_hook'
../../../../libgloss/mips/crt0.S(.text+0xc0): undefined reference to 
`__do_global_dtors'
../../../../libgloss/mips/crt0.S(.text+0xc4): undefined reference to 
`atexit'
../../../../libgloss/mips/crt0.S(.text+0xe8): undefined reference to `exit'
mips_41xx_le-gcc: file path prefix `/usr/local/mips-mips-elf/lib' never 
used

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]