This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [CR16] Problem with TC_LINKRELAX_FIXUP


Renamed the attachments and resending them again.
Hope they won't be quarantined this time.

-----Original Message-----
From: Jayant R. Sonar 
Sent: Thursday, June 28, 2012 5:38 PM
To: 'binutils@sourceware.org'
Cc: 'mr.swami.reddy@nsc.com'; 'amodra@bigpond.net.au'; 'amodra@gmail.com'
Subject: [CR16] Problem with TC_LINKRELAX_FIXUP

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]

Attachment: failure.txt
Description: failure.txt

Attachment: working.txt
Description: working.txt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]