[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with SH5 linker?
From: |
Stephen Thomas |
Subject: |
Problem with SH5 linker? |
Date: |
Thu, 16 May 2002 15:36:31 +0100 |
Hi,
I have just built the latest binutils (2.12.1) and gcc (3.1) for SH5 bare
machine, & I am having trouble linking simple programs. The problem is
illustrated by compiling & linking a single simple C source module:
static int xxx = 42;
int fff (void)
{
xxx++;
return 0;
}
address@hidden(1087)% sh64-superh-elf-gcc -ml -c y.c
address@hidden(1088)% sh64-superh-elf-ld -r y.o
sh64-superh-elf-ld: Relocatable linking with relocations from format
elf32-sh64l (y.o) to format elf32-sh (a.out) is not supported
address@hidden(1089)% sh64-superh-elf-ld -m shlelf32 -r y.o
sh64-superh-elf-ld: Relocatable linking with relocations from format
elf32-sh64l (y.o) to format elf32-sh64l (a.out) is not supported
An odd thing to do, but surely it ought to work? Trying a non-relocateable
link gives different result:
address@hidden(1091)% sh64-superh-elf-ld y.o
sh64-superh-elf-ld: warning: sh5 architecture of input file `y.o' is
incompatible with sh output
sh64-superh-elf-ld: warning: cannot find entry symbol start; defaulting to
0000000000001000
sh64-superh-elf-ld: final link failed: Bad value
address@hidden(1092)% sh64-superh-elf-ld -m shlelf32 y.o
sh64-superh-elf-ld: warning: sh5 architecture of input file `y.o' is
incompatible with sh output
sh64-superh-elf-ld: warning: cannot find entry symbol start; defaulting to
0000000000001000
An objdump of the resulting a.out shows the file format as 'elf32-shl', not
'elf32-sh64l' as expected.
It looks like something is getting confused about the file formats. I don't
think the problem lies in the compiler. For a start, the assembler generated
looks OK. And also, our own internally generated SH5 binutils does not show
the problem.
Joern Rennecke here thinks there may be a fix for this which was added too
late for the 2.12 branch, but we are not sure about this. Any ideas?
----------------------------------------------------------------------
Stephen R Thomas Email: address@hidden
SuperH (UK) Ltd Tel: 01454 462340
2430 Aztec West Mobile: 07973 867598
Almondsbury
Bristol BS32 4AQ
- Problem with SH5 linker?,
Stephen Thomas <=