[CR16] Problem with TC_LINKRELAX_FIXUP

Jayant R. Sonar Jayant.Sonar@kpitcummins.com
Thu Jun 28 12:08:00 GMT 2012


Hello,

On CR16 platform I am using Dhrystone application with uClinux kernel. 
If I configure it as built-in driver it works fine. However, if in 
configure it as loadable module, I get an unexpected behavior.

-----------------------------------------------------------------------
WORKING: Built-in driver output:
[    0.570000] Starting SC1445x Dhrystone 'driver'
[    0.580000] rwsem->wait_list is empty
[    0.580000] head=0015e544 next=0015e544 prev=0015e544

FAILURE: Loadable module output:
[   13.960000] Starting SC1445x Dhrystone 'driver'
[   13.960000] rwsem->wait_list is NOT empty
[   13.970000] head=00fd50bc next=00fd50b8 prev=00fd50b8
-----------------------------------------------------------------------

Problem:
As shown in above dump, Wait_list is supposed to be empty and addresses 
of 'next' and 'prev' are expected to be same as 'head'. But in loadable 
module, they are lesser than 'head' by 4.

I compared the readelf dumps of object files of these 2 configurations 
(Dumps can be found attached with this mail). 
I found following differences: 

-----------------------------------------------------------------------
WORKING: Built-in driver output:
Relocation section '.rela.data' at offset 0x7fc contains 2 entries:
 Offset     Info    Type            Sym.Value  Sym. Name + Addend
00000004  00000703 R_CR16_NUM32      00000000   _rwsem + 4  
00000008  00000703 R_CR16_NUM32      00000000   _rwsem + 4  
                                              =================
FAILURE: Loadable module output:
Relocation section '.rela.data' at offset 0x7b8 contains 2 entries:
 Offset     Info    Type            Sym.Value  Sym. Name + Addend
00000004  00000703 R_CR16_NUM32      00000000   _rwsem + 0  
00000008  00000703 R_CR16_NUM32      00000000   _rwsem + 0  
----------------------------------------------==================------- 

Addend in case of non-working configuration is found to be zero where 
as it is 4 in working configuration. 

At following URL, I found a change in TC_LINKRELAX_FIXUP was made to 
resolve non-code section fixups at assembly time:
http://sourceware.org/ml/binutils/2009-07/msg00035.html

If I revert this change, my problem gets solved. But then I start 
getting same problem that Swami had reported earlier in the URL:
>> libstdc++.a(future.o)(.eh_frame); no .eh_frame_hdr table will be created.

(REF: http://sourceware.org/ml/binutils/2009-06/msg00463.html)

Can someone help me finding any other way by which this can be fixed?

Regards,
Jayant Sonar
[KPIT Cummins, Pune]

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: failure.txt
URL: <https://sourceware.org/pipermail/binutils/attachments/20120628/d3780aec/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: working.txt
URL: <https://sourceware.org/pipermail/binutils/attachments/20120628/d3780aec/attachment-0001.txt>


More information about the Binutils mailing list