First time configuring/linking with newlib...

Dan Fowell dfowell@intelligentline.com
Mon Mar 10 16:07:00 GMT 2003


Hi,

I'm trying to link in libc.a that was configured for a powerpc-elf target,
and I must be doing something wrong.  Everything seemed to configure/make
correctly for the powerpc-elf target, but when I link in the library as
follows:

powerpc-elf-ld.exe -g -t -Tram.lnk -o main.elf crt0.o main.o -L. -lc


I get the following Linking errors:

---------------------------LINKING OBJS--------------------------
powerpc-elf-ld: warning: no memory region specified for section `.fixup'
powerpc-elf-ld: warning: no memory region specified for section `.got2'
powerpc-elf-ld: address 0x848 of main.elf section .bss is not within region
mem
./libc.a(makebuf.o): In function `__smakebuf':
/home/DanFowell/build-newlib/powerpc-elf/newlib/libc/stdio/../../../../../ne
wlib-1.10.0/newlib/libc/stdio/makebuf.c:93: undefined reference to `isatty'
./libc.a(sbrkr.o): In function `_sbrk_r':
/home/DanFowell/build-newlib/powerpc-elf/newlib/libc/reent/../../../../../ne
wlib-1.10.0/newlib/libc/reent/sbrkr.c:60: undefined reference to `sbrk'
./libc.a(writer.o): In function `_write_r':
/home/DanFowell/build-newlib/powerpc-elf/newlib/libc/reent/../../../../../ne
wlib-1.10.0/newlib/libc/reent/writer.c:58: undefined reference to `write'
./libc.a(closer.o): In function `_close_r':
/home/DanFowell/build-newlib/powerpc-elf/newlib/libc/reent/../../../../../ne
wlib-1.10.0/newlib/libc/reent/closer.c:53: undefined reference to `close'
./libc.a(fstatr.o): In function `_fstat_r':
/home/DanFowell/build-newlib/powerpc-elf/newlib/libc/reent/../../../../../ne
wlib-1.10.0/newlib/libc/reent/fstatr.c:62: undefined reference to `fstat'
./libc.a(lseekr.o): In function `_lseek_r':
/home/DanFowell/build-newlib/powerpc-elf/newlib/libc/reent/../../../../../ne
wlib-1.10.0/newlib/libc/reent/lseekr.c:58: undefined reference to `lseek'
./libc.a(readr.o): In function `_read_r':
/home/DanFowell/build-newlib/powerpc-elf/newlib/libc/reent/../../../../../ne
wlib-1.10.0/newlib/libc/reent/readr.c:58: undefined reference to `read'
powerpc-elf-ld: link errors found, deleting executable `main.elf'
----------------------------------------------------------------------------


what are the "fixup" and "got2" sections for?  I don't have those sections
defined in my linker script, but I don't think I want/need them, do I?

My linker script assigns where the .bss section should be put into region
mem.  Is the .bss section of the library fixed?

The undefined reference notifications seem to be related to file handling
related functions, which I don't want/need anyway. Any ideas on how to get
libc.a linking in correctly?  All I really want is the sprintf function
(part of stdio.h).

thanks for any help,
Dan







More information about the Newlib mailing list