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]
Other format: [Raw text]

'relocation truncated to fit' errors while compiling mallocr.c


Hello,

I am trying to use newlib with our custom SH2E hardware, using the KPIT
Cummins Infosystems's SH-ELF toolchain under cygwin (sh-elf-gcc.exe
(GCC) 3.3-GNUSH_v0304). I have successfully compiled and linked my test
app with libc, but the processor executes a CPU address error exception
while I have called malloc().

To debug, I tried to compile mallocr.c with my project, but the linker
generates lots of errors:

d:/melo/kisorzo/shdevel/v0304/sh-elf/bin/sh-elf-ld
-Ld:/melo/kisorzo/shdevel/v0304/sh-elf/sh-elf/lib/m2
-Ld:/melo/kisorzo/shdevel/v0304/sh-elf/lib/gcc-lib/sh-elf/3.3-GNUSH_v0304/m2
-Map main.map -Tplatform/kisorzo.ld -o main.elf main.o blink.o sci.o
mallocr.o platform/__main.o platform/hwinit.o platform/vect.o
platform/trap34_handler.o platform/trap34_handler_c.o  -lc -lgcc
platform/start.o(.text+0x64): In function `edata':
: relocation truncated to fit: R_SH_DIR32 edata
platform/start.o(.text+0x68): In function `bss':
: relocation truncated to fit: R_SH_DIR32 bss
platform/start.o(.text+0x6c): In function `ebss':
: relocation truncated to fit: R_SH_DIR32 ebss
platform/start.o(.text+0x70): In function `vect_table':
: relocation truncated to fit: R_SH_DIR32 vect_table
blink.o(.text+0x18): In function `blink':
: relocation truncated to fit: R_SH_DIR32 .bss
blink.o(.text+0x38): In function `ledon':
: relocation truncated to fit: R_SH_DIR32 .bss
blink.o(.text+0x58): In function `ledoff':
: relocation truncated to fit: R_SH_DIR32 .bss
mallocr.o(.text+0x168): In function `malloc_extend_top':
: relocation truncated to fit: R_SH_DIR32 .bss
mallocr.o(.text+0x16c): In function `malloc_extend_top':
: undefined reference to `sysconf'
mallocr.o(.text+0x178): In function `malloc_extend_top':
: relocation truncated to fit: R_SH_DIR32 .bss
mallocr.o(.text+0x17c): In function `malloc_extend_top':
: relocation truncated to fit: R_SH_DIR32 .bss
mallocr.o(.text+0x180): In function `malloc_extend_top':
: relocation truncated to fit: R_SH_DIR32 .bss
[...]

Am I doing something wrong? What can I do? (As I have read some vague
things about, I tried to use -mrelax, but mallocr.c didn't compile with
it.)

Thank you:
Circum


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