* 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. Index: ld/testsuite/config/default.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/config/default.exp,v retrieving revision 1.15 diff -c -p -r1.15 default.exp *** ld/testsuite/config/default.exp 2 Sep 2009 07:25:37 -0000 1.15 --- ld/testsuite/config/default.exp 11 May 2011 12:26:58 -0000 *************** proc ld_compile { cc source object } { *** 205,211 **** # assemble a file # proc ld_assemble { as source object } { ! default_ld_assemble $as $source $object } # --- 205,219 ---- # assemble a file # proc 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: ld/testsuite/ld-elf/exclude.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-elf/exclude.exp,v retrieving revision 1.7 diff -c -p -r1.7 exclude.exp *** ld/testsuite/ld-elf/exclude.exp 2 Sep 2009 07:25:39 -0000 1.7 --- ld/testsuite/ld-elf/exclude.exp 11 May 2011 12:26:58 -0000 *************** if { [istarget "mcore-*-*"] } { *** 31,36 **** --- 31,44 ---- 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 *************** set test7 "ld exclude symbols from archi *** 47,54 **** 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] } { unresolved $test1 return } --- 55,62 ---- 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_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: ld/testsuite/ld-elf/frame.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-elf/frame.exp,v retrieving revision 1.8 diff -c -p -r1.8 frame.exp *** ld/testsuite/ld-elf/frame.exp 2 Sep 2009 07:25:39 -0000 1.8 --- ld/testsuite/ld-elf/frame.exp 11 May 2011 12:26:58 -0000 *************** if { [istarget "hppa64-*-*"] || [istarge *** 44,57 **** return } 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] } { unresolved "$test1" return } --- 44,65 ---- 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_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 } *************** if { [ld_simple_link $ld tmpdir/frame.so *** 66,72 **** } } ! if ![ld_assemble $as $srcdir/$subdir/table.s tmpdir/table.o ] { unresolved "$test2" return } --- 74,80 ---- } } ! if ![ld_assemble_flags $as $as_opt $srcdir/$subdir/table.s tmpdir/table.o ] { unresolved "$test2" return } Index: ld/testsuite/lib/ld-lib.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/lib/ld-lib.exp,v retrieving revision 1.80 diff -c -p -r1.80 ld-lib.exp *** ld/testsuite/lib/ld-lib.exp 6 Apr 2011 17:09:56 -0000 1.80 --- ld/testsuite/lib/ld-lib.exp 11 May 2011 12:26:59 -0000 *************** proc default_ld_compile { cc source obje *** 295,308 **** # Assemble a file. # ! proc default_ld_assemble { as 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 [prune_warnings $exec_output] if [string match "" $exec_output] then { return 1 --- 295,308 ---- # Assemble a file. # ! 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 $in_flags $ASFLAGS -o $object $source"] set exec_output [prune_warnings $exec_output] if [string match "" $exec_output] then { return 1