Bug 435 (Frv-ld-RelocationBug)

Summary: The relocation bug
Product: binutils Reporter: Rongkai Zhan <zhanrk>
Component: ldAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: bug-binutils
Priority: P2    
Version: pre-2.15   
Target Milestone: ---   
Host: i686 RH9-Linux Target: frv-elf
Build: configure --prefix=/usr/local/frv-elf-toolch --target=frv-elf Last reconfirmed:

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.