This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
[Linux Binutils] 2.11.90.0.27 fails to link eCos program
- To: binutils at sources dot redhat dot com
- Subject: [ECOS] [Linux Binutils] 2.11.90.0.27 fails to link eCos program
- From: Richard Shih-Ping Chan <cshihpin at dso dot org dot sg>
- Date: Wed, 22 Aug 2001 17:04:26 +0800
- Cc: ecos-discuss at sources dot redhat dot com
Hello,
This is a linker failure for linux 2.11.90.0.25 and 2.11.90.0.27.
The following succeeds with binutils 2.11.2.
I am trying to build the eCos OS and test programs for
linux synthetic target (builds linux elf binaries).
I am using
gcc 3.0.1
binutils 2.11.90.0.27
eCos - a fairly recent CVS
Here is the error message
gcc -g -nostdlib -Wl,--gc-sections -Wl,-static -L/d2/home/cshihpin/build/ecos-linux/install/lib -Ttarget.ld -o
/d2/home/cshihpin/build/ecos-linux/install/tests/hal/common/current/tests/cache tests/cache.o
/usr/bin/ld: warning: no memory region specified for section `.rel.data.cyg_io_serial_devio'
/usr/bin/ld: warning: no memory region specified for section `.rel.data.tty_devio'
/usr/bin/ld: address 0x0 of /d2/home/cshihpin/build/ecos-linux/install/tests/hal/common/current/tests/cache section .fixup
is not within region rom
/usr/bin/ld: address 0x0 of /d2/home/cshihpin/build/ecos-linux/install/tests/hal/common/current/tests/cache section .gcc_except_table is not within region rom
collect2: ld returned 1 exit status
make[1]: *** [/d2/home/cshihpin/build/ecos-linux/install/tests/hal/common/current/tests/cache] Error 1
make[1]: Leaving directory `/d2/home/cshihpin/build/ecos-linux/hal/common/current'
make: *** [tests] Error 2
Here's the eCos linker script
STARTUP(vectors.o)
ENTRY(_start)
INPUT(extras.o)
GROUP(libtarget.a libgcc.a)
MEMORY
{
rom : ORIGIN = 0x1000000, LENGTH = 0x800000
ram : ORIGIN = 0x2000000, LENGTH = 0x800000
}
SECTIONS
{
.vectors 0x1000000 : { . = .; KEEP(*(.vectors)) } > rom
.text ALIGN (0x4) : { _stext = .; *(.text*) *(.gnu.warning) *(.gnu.linkonce*) *(.init) } > rom _etext = .; PROVIDE (etext = .);
.fini ALIGN (0x4) : { . = .; *(.fini) } > rom
.rodata1 ALIGN (0x8) : { . = .; *(.rodata1) } > rom
.rodata ALIGN (0x8) : { . = .; *(.rodata*) } > rom
.fixup ALIGN (0x4) : { _FIXUP_START_ = ABSOLUTE(.); *(.fixup) _FIXUP_END_ = ABSOLUTE(.);} > rom
.rel.got ALIGN (0x1) : { *(.rel.got) } > rom
.gcc_except_table ALIGN (0x1) : { _EXCEPT_START_ = ABSOLUTE(.); *(.gcc_except_table) _EXCEPT_END_ = ABSOLUTE(.);} > rom
.data 0x2000000 : { __ram_data_start = ABSOLUTE(.); *(.data*) _GOT1_START_ = ABSOLUTE(.); *(.got1) _GOT1_END_ = ABSOLUTE(.); . = ALIGN(8); __CTOR_LIST__ = ABSOLUTE(.); KEEP(*(SORT(.ctors*))) __CTOR_END__ = ABSOLUTE(.); __DTOR_LIST__ = ABSOLUTE(.); KEEP(*(SORT(.dtors*))) __DTOR_END__ = ABSOLUTE(.); . = ALIGN(32); KEEP(*( SORT (.ecos.table.*))); _GOT2_START_ = ABSOLUTE(.); *(.got2) _GOT2_END_ = ABSOLUTE(.); _GOT_START_ = ABSOLUTE(.); _GLOBAL_OFFSET_TABLE_ = ABSOLUTE(. + 32768); _SDA_BASE_ = ABSOLUTE(.); *(.got.plt) *(.got) _GOT_END_ = ABSOLUTE(.); *(.dynamic) *(.eh_frame) _SDATA_START_ = ABSOLUTE(.); *(.sdata*) } > ram __rom_data_start = LOADADDR(.data); __ram_data_end = .; PROVIDE(__ram_data_end = .); _edata = .; PROVIDE (edata = .);
.sbss ALIGN (0x4) : { __bss_start = ABSOLUTE (.); _SBSS_START_ = ABSOLUTE(.); *(.sbss*) _SBSS_END_ = ABSOLUTE(.); *(.scommon*) } > ram
.bss ALIGN (0x10) : { . = .; *(.dynbss*) *(.bss*) *(COMMON) } > ram __bss_end = .;
__heap1 = ALIGN (0x10);
. = ALIGN(4); _end = .; PROVIDE (end = .);
}
Here's readelf -S on the offending object file
There are 14 section headers, starting at offset 0x2d1c:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .text PROGBITS 00000000 000034 000000 00 AX 0 0 4
[ 2] .data PROGBITS 00000000 000034 000000 00 WA 0 0 4
[ 3] .bss NOBITS 00000000 000034 000000 00 WA 0 0 4
[ 4] .stab PROGBITS 00000000 000034 000924 0c 6 0 4
[ 5] .rel.stab REL 00000000 00306c 000020 08 12 4 4
[ 6] .stabstr STRTAB 00000000 000958 00229b 00 0 0 1
[ 7] .rodata PROGBITS 00000000 002c00 000060 00 A 0 0 32
[ 8] .text.cyg_start PROGBITS 00000000 002c60 000030 00 AX 0 0 16
[ 9] .rel.text.cyg_sta REL 00000000 00308c 000028 08 12 8 4
[10] .comment PROGBITS 00000000 002c90 000012 00 0 0 1
[11] .shstrtab STRTAB 00000000 002ca2 00007a 00 0 0 1
[12] .symtab SYMTAB 00000000 002f4c 0000e0 10 13 a 4
[13] .strtab STRTAB 00000000 00302c 00003f 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)