[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ld relocate symbols(in small common section) to a unaligned address.(on
From: |
zhigang gong |
Subject: |
ld relocate symbols(in small common section) to a unaligned address.(on mips r3000 target) |
Date: |
Wed, 7 Sep 2005 16:53:36 +0800 |
Dears,
I have a problem when building my ecos test pattern. My platform is based on mips r3000. I use the latest gcc and binutils. The configuration is as belows:
gcc4:
../gcc-4.0-20050901/configure --target=mipsel-elf --prefix=/home/zhigang/gnutools --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-gxx-include-dir=/home/zhigang/gnutools/mipsel-elf/include --with-float=soft --prefix=/home/zhigang/gnutools --enable-languages=c,c++
Thread model: single
gcc version 4.0.2 20050901 (prerelease)
binutils-2.16.1:
../binutils-2.16.1/configure --target=mipsel-elf --prefix=/home/zhigang/gnutools
the build command as belows:
mipsel-elf-gcc -L/home/zhigang/0808/pattern_install/lib -Ttarget.ld -o /home/zhigang/0808/pattern_install/tests/kernel/current/tests/thread_gdb tests/thread_gdb.o -msoft-float -nostdlib -Wl,--gc-sections -Wl,-static -Wl,-Map,
ii.map
Here is the fragment of the map file.
*(.scommon)
.scommon 0x000000008090bc44 0x9 tests/thread_gdb.o
0x000000008090bc44 worker_cv
0x000000008090bc4c worker_state
.scommon 0x000000008090bc4d 0xc /home/zhigang/0808/pattern_install/lib/extras.o
0x000000008090bc4d piofree_handle ------Please see here, the address is not correct aligned
0x000000008090bc51 flag_int_reason -------as above, the address is misaligned
*fill* 0x000000008090bc59 0x3 00
.scommon 0x000000008090bc5c 0x4 /home/zhigang/0808/pattern_install/lib/libtarget.a(hal_mips_arch3000_hal_misc.o)
0x000000008090bc5c cyg_hal_clock_period
.scommon 0x000000008090bc60 0x4 /home/zhigang/0808/pattern_install/lib/libtarget.a(hal_mips_sphe1001_plf_misc.o)
0x000000008090bc60 regs0
.scommon 0x000000008090bc64 0x4 /home/zhigang/0808/pattern_install/lib/libtarget.a(hal_common_hal_misc.o)
0x000000008090bc64 _cyg_hal_compiler_dummy
Here is the definition of the variable:
typedef unsigned int cyg_handle_t;
cyg_handle_t piofree_handle;
The fragment of the objfile containing the varible is here(generate by gas):
$LFE47:
.size ide_disk_set_config, .-ide_disk_set_config
.comm ide_disk_channel_0_disk_info,460,4
.comm piofree_intr,28,4
.comm piofree_handle,4,4 (the alignment is right)
.comm flag_int_reason,8,4 (the alignment is right)
Here is the fragment of the ld script:
__bss_start = .;
_fbss = .;
.sbss ALIGN (0x8) : { . = .; *(.dynsbss) *(.sbss) *(.sbss.*) *(.scommon) } > ram
.bss ALIGN (0x8) : { *(.dynbss) *(.bss) *(.bss.*) *(COMMON) } > ram __bss_end = .;
As the input files are too big , I don't attach them here. If somebody want to get them please let me know .I will send you all the input files(objfile), and you could re generate the bug.
When i build it with gcc-3.4.4 and binutils-2.16.1, there are no any error. So I really can't determine it's a compiler bug or binutils's. Counld anybody give me some glue.
- ld relocate symbols(in small common section) to a unaligned address.(on mips r3000 target),
zhigang gong <=