* testsuite/ld-i386/i386.exp: Run weakundef1 tests.
* testsuite/ld-i386/weakundef1.c: New file.
+2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ * testsuite/ld-i386/i386.exp: Run weakundef1 tests.
+ * testsuite/ld-i386/weakundef1.c: New file.
+
2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
PR ld/21090
}
}
+# Must be native with the C compiler.
+if { [isnative]
+ && [istarget "i?86-*-*"]
+ && [which $CC] != 0 } {
+ run_ld_link_exec_tests [list \
+ [list \
+ "Run weakundef1 without PIE" \
+ "$NOPIE_LDFLAGS" \
+ "" \
+ { weakundef1.c } \
+ "weakundef1pie" \
+ "pass.out" \
+ "$NOPIE_CFLAGS" \
+ ] \
+ [list \
+ "Run weakundef1 with PIE" \
+ "-pie" \
+ "" \
+ { weakundef1.c } \
+ "weakundef1pie" \
+ "pass.out" \
+ "-fPIE" \
+ ] \
+ ]
+}
+
if { !([istarget "i?86-*-linux*"]
|| [istarget "x86_64-*-linux*"]) } {
return
--- /dev/null
+#include <stdlib.h>
+#include <stdio.h>
+
+extern int visibility_var_weak
+ __attribute__ ((weak, visibility ("hidden")));
+
+int
+main ()
+{
+ if (&visibility_var_weak != NULL)
+ abort ();
+
+ printf ("PASS\n");
+
+ return 0;
+}