public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Andrew STUBBS <andrew.stubbs@st.com>
To: Nick Clifton <nickc@redhat.com>
Cc: binutils@sourceware.org
Subject: Re: [PATCH]: Set little endian flag when linking SH arch tests for  little endian multilibs
Date: Fri, 21 Jul 2006 13:25:00 -0000	[thread overview]
Message-ID: <44C0D59D.70306@st.com> (raw)
In-Reply-To: <m3y7unxowp.fsf@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 840 bytes --]

Nick Clifton wrote:
>   I am applying the small patch below to make the SH specific linker
>   tests set the appropriate endian flag when linking the arch tests.
>   Without this, testing little endian SH multilibs was producing lots
>   of unexpected failures and untested tests because the linker and
>   assembler disagreed about endianness.

As it happens I was just in the process of preparing that exact same 
patch (right down to the character - spooky).

I also had an issue with default_ld_assemble in lib/ld-lib.exp. It tries 
to apply linker endian flags to the assembler. I have attached the patch 
I was using. Did you not see this issue?

There is also an issue because not all SH architectures have a little 
endian variant, and therefore not all instructions and relocations are 
implemented in both endians.

Andrew Stubbs

[-- Attachment #2: testsuite-flags.patch --]
[-- Type: text/plain, Size: 2183 bytes --]

Index: src/ld/testsuite/lib/ld-lib.exp
===================================================================
--- src.orig/ld/testsuite/lib/ld-lib.exp	2006-07-05 12:28:54.000000000 +0100
+++ src/ld/testsuite/lib/ld-lib.exp	2006-07-05 14:24:10.000000000 +0100
@@ -276,6 +276,10 @@ proc default_ld_assemble { as source obj
     if ![info exists ASFLAGS] { set ASFLAGS "" }
 
     set flags [big_or_little_endian]
+    if {[istarget sh*-*-*] || [istarget pj*-*-*]} {
+	regsub -- {-EB} $flags {-big} flags
+	regsub -- {-EL} $flags {-little} flags
+    }
 
     verbose -log "$as $flags $ASFLAGS -o $object $source"
 
Index: src/ld/testsuite/ld-sh/arch/arch.exp
===================================================================
--- src.orig/ld/testsuite/ld-sh/arch/arch.exp	2005-05-12 08:32:08.000000000 +0100
+++ src/ld/testsuite/ld-sh/arch/arch.exp	2006-07-05 16:25:05.000000000 +0100
@@ -76,9 +76,11 @@ proc test_arch { file1 file2 arch result
     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 {
@@ -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 {

  reply	other threads:[~2006-07-21 13:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-21  9:55 Nick Clifton
2006-07-21 13:25 ` Andrew STUBBS [this message]
2006-07-23 14:25   ` Nick Clifton
2006-07-24  8:32     ` Andrew STUBBS
2006-07-24 10:42       ` Andrew STUBBS
2006-07-24 13:55         ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44C0D59D.70306@st.com \
    --to=andrew.stubbs@st.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).