Bug 435 (Frv-ld-RelocationBug) - The relocation bug
Summary: The relocation bug
Status: RESOLVED FIXED
Alias: Frv-ld-RelocationBug
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.13
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-09 02:27 UTC by Rongkai Zhan
Modified: 2004-12-06 21:26 UTC (History)
1 user (show)

See Also:
Host: i686 RH9-Linux
Target: frv-elf
Build: configure --prefix=/usr/local/frv-elf-toolch --target=frv-elf
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rongkai Zhan 2004-10-09 02:27:50 UTC
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 !!!
Comment 1 Rongkai Zhan 2004-10-09 05:08:20 UTC
My test case is too large to be attached.
Please goto this site 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
Comment 2 Nick Clifton 2004-10-09 06:42:01 UTC
Subject: Re:  New: The relocation bug

Hi zhanrk ,

> Here is my toolchains version:
>   - binutils-2.13
>   - gcc-core-3.4.0
> 

2.13 is an old version of binutils.  Can you check to see if the problem 
also occurs with the latest release (2.15), or even better, the current 
version in the CVS repository ?

Cheers
   Nick


Comment 3 Ben Elliston 2004-12-06 00:50:06 UTC
Hi Rongkai,

Any progress on reproducing this bug with a modern release of binutils?
Comment 4 Rongkai Zhan 2004-12-06 07:53:21 UTC
(In reply to comment #3)
> Hi Rongkai,
> 
> Any progress on reproducing this bug with a modern release of binutils?
> 

After i updated the binutils-2.13 to binutils-2.15, this bug disappeared.
Comment 5 Ben Elliston 2004-12-06 21:26:18 UTC
Closing: the user reports that binutils 2.15 fixes the problem.