--target=v850-unknown-elf, linker problem

Torsten Mohr tmohr@s.netic.de
Sun Aug 14 20:50:00 GMT 2005


i configured and installed a toolchain for a NEC V850
as described in detail at the end of this mail.

When i link a function marked as __attribute__((interrupt))
somewhere in the sources, i get an error:

void irq_nmi(void) __attribute__((signal));
void __attribute__((signal)) irq_nmi(void) {
  // just empty

int main(int argc, char** argv) {
  return 0;

v850-unknown-elf-gcc -mv850e -o main.o -c main.c
v850-unknown-elf-gcc -mv850e -o hw2.elf \
/opt/v850-unknown-elf/lib/gcc/v850-unknown-elf/3.4.4/v850e/libgcc.a \
(_callt_save_interrupt.o): In function `__callt_return_interrupt':
../../gcc-3.4.4/gcc/config/v850/lib1funcs.asm:(.call_table_data+0x2): \
relocation truncated to fit: R_V850_CALLT_16_16_OFFSET against `.text'
collect2: ld gab 1 als Ende-Status zurück

When i don't use -mv850e, but use -mv850, all works fine.

v850-unknown-elf-nm says about the -mv850e compiled object file:
tmohr@schleim:~/p/v850/hw2> v850-unknown-elf-nm main.o
         U __callt_return_interrupt
         U __callt_save_interrupt
00000000 T _irq_nmi
0000002c T _main

For the -mv850 i get:
tmohr@schleim:~/p/v850/hw2> v850-unknown-elf-nm main.o
         U __ep
         U __gp
00000000 T _irq_nmi
0000004a T _main

Is this a linker script problem?  I think the undefined symbols
are set / should be set in a linker script.

Can anybody tell me how i can use interrupt functions on
a V850E?

Best regards,

# Set up the tool chain:
in /rest/tmp/bbin:
../binutils-2.16/configure --target=v850-unknown-elf \
make install

Patch gcc-3.4.4: gcc/gcc/config/v850/t-v850:
Remove -mwarn-[un]signed-overflow from TCFLAGS

in /rest/tmp/bgcc:
../gcc-3.4.4/configure --target=v850-unknown-elf \
  --prefix=/opt/v850-unknown-elf \
make install

in /rest/tmp/bnl:
../newlib-1.13.0/configure  --target=v850-unknown-elf \
make install

gcc-4.0.1 and gcc-4.1-20050806 did not compile clean.

More information about the Binutils mailing list