# Expect script for various ELF tests.
-# Copyright (C) 2006-2017 Free Software Foundation, Inc.
+# Copyright (C) 2006-2018 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# Add $NOPIE_CFLAGS and $NOPIE_LDFLAGS if non-PIE is required.
global NOPIE_CFLAGS NOPIE_LDFLAGS
+set old_ASFLAGS $ASFLAGS
+
# This target requires extra GAS options when building code for shared
# libraries.
set AFLAGS_PIC ""
append LFLAGS " -melf32_tic6x_le"
}
+if [is_underscore_target] {
+ set ASFLAGS "$ASFLAGS --defsym UNDERSCORE=1"
+}
+
+run_ld_link_tests [list \
+ [list \
+ "Build pr22471a.so" \
+ "$LFLAGS -shared" \
+ "" \
+ "$AFLAGS_PIC" \
+ {pr22471a.s} \
+ {} \
+ "pr22471a.so" \
+ ] \
+ [list \
+ "Build pr22471b.so" \
+ "$LFLAGS -shared --version-script pr22471.t" \
+ "tmpdir/pr22471a.so" \
+ "$AFLAGS_PIC" \
+ {pr22471a.s} \
+ {} \
+ "pr22471b.so" \
+ ] \
+ [list \
+ "Build pr22471" \
+ "$LFLAGS -rpath-link ." \
+ "tmpdir/pr22471b.so" \
+ "" \
+ {pr22471b.s} \
+ {} \
+ "pr22471" \
+ ] \
+]
+
+run_ld_link_tests [list \
+ [list \
+ "DT_TEXTREL in shared lib" \
+ "$LFLAGS -shared --warn-shared-textrel" \
+ "" \
+ "$AFLAGS_PIC" \
+ {textrel.s} \
+ {{ld textrel.warn} \
+ {readelf {-d --wide} textrel.rd}} \
+ "textrel.so" \
+ ] \
+] "xtensa-*-*"
+
+run_ld_link_tests [list \
+ [list \
+ "DT_TEXTREL map file warning" \
+ "$LFLAGS -shared -M" \
+ "" \
+ "$AFLAGS_PIC" \
+ {textrel.s} \
+ {{ld textrel.map}} \
+ "textrel.so" \
+ ] \
+] "cris*-*-*"
+
# PR ld/20828 check for correct dynamic symbol table entries where:
# - symbols have been defined with a linker script,
# - the same symbols have been seen in shared library used in the link,
]
}
+set ASFLAGS $old_ASFLAGS
+
# Check to see if the C compiler works
if { [which $CC] == 0 } {
return