diff options
author | Jiong Wang <jiong.wang@arm.com> | 2017-01-23 09:59:10 +0000 |
---|---|---|
committer | Jiong Wang <jiong.wang@arm.com> | 2017-01-23 09:59:10 +0000 |
commit | 9966f7eece39ced8a09c190616b5b328bf97bfe5 (patch) | |
tree | 1b0f298f3af6a9e35d8e794d21d6578c5bfc7fd0 /ld/testsuite/ld-unique | |
parent | dcd310a08c9ab601b9dc883e706371f1232cdfef (diff) | |
download | fsf-binutils-gdb-9966f7eece39ced8a09c190616b5b328bf97bfe5.zip fsf-binutils-gdb-9966f7eece39ced8a09c190616b5b328bf97bfe5.tar.gz fsf-binutils-gdb-9966f7eece39ced8a09c190616b5b328bf97bfe5.tar.bz2 |
[ld, testsuite] Honor cflags when GCC used as linker driver
ld/
* testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Append
board_cflags as gcc is used as linker driver.
* testsuite/ld-unique/unique.exp: Likewise
Diffstat (limited to 'ld/testsuite/ld-unique')
-rw-r--r-- | ld/testsuite/ld-unique/unique.exp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ld/testsuite/ld-unique/unique.exp b/ld/testsuite/ld-unique/unique.exp index 0aecf01..f06622f 100644 --- a/ld/testsuite/ld-unique/unique.exp +++ b/ld/testsuite/ld-unique/unique.exp @@ -108,8 +108,17 @@ if ![ld_compile "$CC -c" "$srcdir/$subdir/unique_empty.s" "tmpdir/unique_empty.o set fails [expr $fails + 1] } +# When using GCC as the linker driver, we need to specify board cflags when +# linking because cflags may contain linker options. For example when linker +# options are included in GCC spec files then we need the -specs option. +if [board_info [target_info name] exists cflags] { + set board_cflags " [board_info [target_info name] cflags]" +} else { + set board_cflags "" +} + # Create executable containing unique symbol. -if ![ld_link $CC "tmpdir/unique_prog" "tmpdir/unique.o"] { +if ![ld_link "$CC $board_cflags" "tmpdir/unique_prog" "tmpdir/unique.o"] { fail "Could not link a unique executable" set fails [expr $fails + 1] } |