]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* config/default.exp (ld_assemble): Pass flags parameter to
authorBernd Schmidt <bernds@codesourcery.com>
Thu, 12 May 2011 10:00:06 +0000 (10:00 +0000)
committerBernd Schmidt <bernds@codesourcery.com>
Thu, 12 May 2011 10:00:06 +0000 (10:00 +0000)
default_ld_assemble.
(ld_assemble_flags): New function.
* ld-elf/frame.exp: Pass -mpic and -mpid flags to the assembler on
tic6x.
* ld-elf/exclude.exp: Likewise.
* lib/ld-lib.exp (default_ld_assemble): Take extra argument in_flags
and pass it to the assembler.

ld/testsuite/ChangeLog
ld/testsuite/config/default.exp
ld/testsuite/ld-elf/exclude.exp
ld/testsuite/ld-elf/frame.exp
ld/testsuite/lib/ld-lib.exp

index 2cbe74cbeaa38cc4c021566f02110bc435e9ebe4..1bb19fea550f5ffe74cbcec022551b92f4f2a208 100644 (file)
@@ -1,3 +1,14 @@
+2011-05-12  Bernd Schmidt  <bernds@codesourcery.com>
+
+       * config/default.exp (ld_assemble): Pass flags parameter to
+       default_ld_assemble.
+       (ld_assemble_flags): New function.
+       * ld-elf/frame.exp: Pass -mpic and -mpid flags to the assembler on
+       tic6x.
+       * ld-elf/exclude.exp: Likewise.
+       * lib/ld-lib.exp (default_ld_assemble): Take extra argument in_flags
+       and pass it to the assembler.
+
 2011-05-11  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * ld-mips-elf/mips-elf.exp: Add missing $has_newabi tests.
index 043a88569879d6121f867cfde40f2b39c5ef9df5..26a7a0c35336c486306d51bf419b575a7daf5409 100644 (file)
@@ -205,7 +205,15 @@ proc ld_compile { cc source object } {
 #      assemble a file
 #
 proc ld_assemble { as source object } {
-       default_ld_assemble $as $source $object 
+       default_ld_assemble $as "" $source $object 
+}
+
+#
+# ld_assemble_flags
+#      assemble a file with extra flags
+#
+proc ld_assemble_flags { as flags source object } {
+       default_ld_assemble $as $flags $source $object 
 }
 
 #
index 124549f735cd0d96521c6d2bcc3892958b395b6d..28a34ab543b0c44517b4615a3ba18451d9b99690 100644 (file)
@@ -31,6 +31,14 @@ if { [istarget "mcore-*-*"] } {
     return
 }
 
+set as_opt ""
+
+# This target requires extra as options when building code for shared
+# libraries.
+if { [istarget "tic6x-*-*"] } {
+    set as_opt "-mpic -mpid=near"
+}
+
 global ar
 global as
 global ld
@@ -47,8 +55,8 @@ set test7 "ld exclude symbols from archive - --exclude-libs foo:libexclude.a"
 set test8 "ld exclude symbols from archive - --exclude-libs foo,libexclude.a"
 set test9 "ld don't exclude symbols from archive - --exclude-libs foo:bar"
 
-if { ![ld_assemble $as $srcdir/$subdir/exclude1.s tmpdir/exclude1.o ]
-     || ![ld_assemble $as $srcdir/$subdir/exclude2.s tmpdir/exclude2.o] } {
+if { ![ld_assemble_flags $as $as_opt $srcdir/$subdir/exclude1.s tmpdir/exclude1.o ]
+     || ![ld_assemble_flags $as $as_opt $srcdir/$subdir/exclude2.s tmpdir/exclude2.o] } {
     unresolved $test1
     return
 }
index 0a69024a8269e25695c7e81ba15a639212a31bfb..66e6ac5313c65bfdd006d60bb312489097563bce 100644 (file)
@@ -44,14 +44,22 @@ if { [istarget "hppa64-*-*"] || [istarget "v850-*-*"] } {
     return
 }
 
+set as_opt ""
+
+# This target requires extra as options when building code for shared
+# libraries.
+if { [istarget "tic6x-*-*"] } {
+    set as_opt "-mpic -mpid=near"
+}
+
 set test1      "read-only .eh_frame section"
 set test2      "read-only .gcc_except_table section"
 
 global as
 global ld
 
-if { ![ld_assemble $as $srcdir/$subdir/tbss.s tmpdir/tbss.o ]
-     || ![ld_assemble $as $srcdir/$subdir/frame.s tmpdir/frame.o] } {
+if { ![ld_assemble_flags $as $as_opt $srcdir/$subdir/tbss.s tmpdir/tbss.o ]
+     || ![ld_assemble_flags $as $as_opt $srcdir/$subdir/frame.s tmpdir/frame.o] } {
     unresolved "$test1"
     return
 }
@@ -66,7 +74,7 @@ if { [ld_simple_link $ld tmpdir/frame.so "--shared tmpdir/frame.o tmpdir/tbss.o"
     }
 }
 
-if ![ld_assemble $as $srcdir/$subdir/table.s tmpdir/table.o ] {
+if ![ld_assemble_flags $as $as_opt $srcdir/$subdir/table.s tmpdir/table.o ] {
     unresolved "$test2"
     return
 }
index 0591e8b6eb5d4eab4fddef427f2e4e4f6e68c53d..2fb8c4a7060aebe3af62e6f04465f775438be0cf 100644 (file)
@@ -295,14 +295,14 @@ proc default_ld_compile { cc source object } {
 
 # Assemble a file.
 #
-proc default_ld_assemble { as source object } {
+proc default_ld_assemble { as in_flags source object } {
     global ASFLAGS
     global host_triplet
 
     if ![info exists ASFLAGS] { set ASFLAGS "" }
 
     set flags [big_or_little_endian]
-    set exec_output [run_host_cmd "$as" "$flags $ASFLAGS -o $object $source"]
+    set exec_output [run_host_cmd "$as" "$flags $in_flags $ASFLAGS -o $object $source"]
     set exec_output [prune_warnings $exec_output]
     if [string match "" $exec_output] then {
        return 1