+2011-05-18 Nick Clifton <nickc@redhat.com>
+
+ PR ld/12761
+ * elflink.c (elf_link_add_object_symbols): Process .gnu.warning
+ sections when building shared libraries.
+
2011-05-18 RafaĆ Krypa <r.krypa@samsung.com>
PR ld/12778
.gnu.warning.SYMBOL are treated as warning symbols for the given
symbol. This differs from .gnu.warning sections, which generate
warnings when they are included in an output file. */
- if (info->executable)
+ /* PR 12761: Also generate this warning when building shared libraries. */
+ if (info->executable || info->shared)
{
asection *s;
+2011-05-18 Nick Clifton <nickc@redhat.com>
+
+ PR ld/12761
+ * lib/ld-lib.exp (run_cc_link_tests): Add an optional 8th
+ parameter - an expected warning message from the linker.
+ * ld-elf/shared.exp (build_tests): Expect a warning message when
+ building the libbarw.so library.
+
+ * ld-elf/shared.exp: Run library building tests even when not
+ building a native toolchain.
+
2011-05-16 H.J. Lu <hongjiu.lu@intel.com>
* ld-scripts/phdrs.exp: Replace --private with
return
}
-# The following tests require running the executable generated by ld.
-if ![isnative] {
- return
-}
-
-# Check if compiler works
+# Check to see if the C compiler works
if { [which $CC] == 0 } {
return
}
{begin.c end.c} {} "libbar.so"}
{"Build warn libbar.so"
"-shared" "-fPIC"
- {beginwarn.c end.c} {} "libbarw.so"}
+ {beginwarn.c end.c} {} "libbarw.so"
+ "C" "^.*\\\): warning: function foo is deprecated$"}
{"Build hidden libbar.so"
"-shared" "-fPIC"
{begin.c endhidden.c} {} "libbarh.so"}
{pr11138-2.c} {} "libpr11138-2.o"}
}
+run_cc_link_tests $build_tests
+
+# The following tests require running the executable generated by ld.
+if ![isnative] {
+ return
+}
+
set run_tests {
{"Run normal with libfoo.so"
"tmpdir/begin.o tmpdir/libfoo.so tmpdir/end.o" ""
{dummy.c} "pr11138b" "pr11138.out"}
}
-run_cc_link_tests $build_tests
# NetBSD ELF systems do not currently support the .*_array sections.
run_ld_link_exec_tests [list "*-*-netbsdelf*"] $run_tests
-# Check if compiler works
+# Check to see if the C++ compiler works
if { [which $CXX] == 0 } {
return
}
# 4:action and options.
# 5:name of output file
# 6:language (optional)
+# 7:linker warnings (optional)
#
# Actions:
# objdump: Apply objdump options on result. Compare with regex (last arg).
global CFLAGS
global CXXFLAGS
global ar
+ global exec_output
foreach testitem $ldtests {
set testname [lindex $testitem 0]
set actions [lindex $testitem 4]
set binfile tmpdir/[lindex $testitem 5]
set lang [lindex $testitem 6]
+ set warnings [lindex $testitem 7]
set objfiles {}
set is_unresolved 0
set failed 0
set failed 0
}
} elseif { ![ld_simple_link $cc_cmd $binfile "-L$srcdir/$subdir $ldflags $objfiles"] } {
- fail $testname
- set failed 1
+ # Check if exec_output is expected.
+ if { $warnings != "" } then {
+ verbose -log "returned with: <$exec_output>, expected: <$warnings>"
+ if { [regexp $warnings $exec_output] } then {
+ set failed 0
+ } else {
+ set failed 1
+ }
+ } else {
+ fail $testname
+ set failed 1
+ }
} else {
set failed 0
}