[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug report] frv-elf-ld relocation error
From: |
zhan rongkai |
Subject: |
[bug report] frv-elf-ld relocation error |
Date: |
Sat, 9 Oct 2004 15:21:26 +0800 |
Hi:
Recently it seems that i encountered a linker bug during my work on a
FRV processor. Here is my toolchains version:
- binutils-2.13
- gcc-core-3.4.0
And i use the following commands to build my frv-elf toolchain from the source
packages:
- binutils-2.13:
configure --prefix=/usr/local/frv-elf-toolch --target=frv-elf
- gcc-core-3.4.0:
configure --prefix=/usr/local/frv-elf-toolch \
--target=frv-elf --without-headers --with-newlib \
--disable-shared --disable-threads --enable-languages=c
This relocation bug is a little hidden, it seems that it only appears when
linking a very large program. In my test case, there is a const string in
frv-linux-2.6.4/init/version.c:
const char *linux_banner = "Linux version 2.6.4 ...";
By disassembly analysis, we can kown the address in the '.rodata' section of the
string "Linux version 2.6.4 ..." is 0xd299c. While the value of the pointer
variable 'linux_banner' is 0xd29a0. So if i use the following function to print
this string:
printk(linux_banner);
i alway get the string "x version 2.6.4 ..." on my virtual terminal !!!
About my test case:
-------------------------
My test case is too large to be sent as an attachment. You can go to
this URL to download my test case:
http://jtager.sourceforge.net/frv-linux-2.6.4.tar.gz
Use the following command to unpack it:
tar zxvf frv-linux-2.6.4.tar.gz
Then use the following commands to compile the source codes:
cd frv-linux-2.6.4
make zImage
- [bug report] frv-elf-ld relocation error,
zhan rongkai <=