[PATCH]: Set little endian flag when linking SH arch tests for little endian multilibs

Andrew STUBBS andrew.stubbs@st.com
Mon Jul 24 08:32:00 GMT 2006


Nick Clifton wrote:
> How about having a new board_info variable which, if defined, supplies 
> the name of the little- or big- endian switch to use ?  eg (untested):
[snip]
> Then we can just define bigendian_switch and littleendian_switch in 
> sh-hms.exp (or whatever dejagnu board file is being used).

The problem is that the sh linker continues to take -EB/-EL, but the sh 
assembler uses -big/-little. According to my examination of the code the 
pj assembler is the same.

Your solution looks good, but requires separate variables for assembler 
and linker, and then the the big_or_little_endian function needs to know 
which is needed.

BTW, Dejagnu 1.4.4 uses sh-sim, not sh-hms.

>> @@ -117,9 +119,11 @@ proc test_arch_error { file1 file2 resul
>>      set name2 [file tail $file2]
>>      set rootname2 [file rootname $name2]
>>  
>> +    set flags [big_or_little_endian]
>> +
>>      # This must use -r to prevent LD trying to relocate the 
>> (unrealistic) file
>> -    send_log "$LD -r -o ${rootname1}_${rootname2}.o $file1 $file2\n"
>> -    catch "exec $LD -r -o ${rootname1}_${rootname2}.o $file1 $file2" 
>> ld_output
>> +    send_log "$LD $flags -r -o ${rootname1}_${rootname2}.o $file1 
>> $file2\n"
>> +    catch "exec $LD $flags -r -o ${rootname1}_${rootname2}.o $file1 
>> $file2" ld_output
>>      send_log $ld_output
>>  
>>      if {[string equal $ld_output ""] == 1} then {
> 
> For reasons I do not understand I found that if I included the above 
> part of the patch to arch.exp I ended up with *more* SH linker testsuite 
> failures (for little endian multilibs) than without it.  This was 
> another thing that I was going to investigate when I had more time.  If 
> you can show that it does reduce the number of testsuite failures 
> however then I would be happy to accept it.

Hmmm, did you use both parts of the patch? You say that I have had time 
to test this, but actually the reason I had not submitted the patch was 
that I had not yet finished testing it. I suspect that a few more bits 
are needed. I also have a few more adjustments to the arch.exp script to 
submit. Also, this has got put on the back burner for the last few weeks 
so it isn't fresh in my mind any more.

I'll look into it. Not sure when though.

Andrew



More information about the Binutils mailing list