aboutsummaryrefslogtreecommitdiff
path: root/gold/testsuite/Makefile.am
diff options
context:
space:
mode:
authorRahul Chaudhry <rahulchaudhry@google.com>2017-02-15 00:37:10 -0800
committerCary Coutant <ccoutant@gmail.com>2017-02-15 00:37:10 -0800
commit4aebb6312eb5dcd12f2f8420028547584b708907 (patch)
tree3ddb862e883a0ae0c3cb7f4e517f32b33979c360 /gold/testsuite/Makefile.am
parent4e746bb68947abd2f64ced0dcf5a00021571e45d (diff)
downloadgdb-4aebb6312eb5dcd12f2f8420028547584b708907.zip
gdb-4aebb6312eb5dcd12f2f8420028547584b708907.tar.gz
gdb-4aebb6312eb5dcd12f2f8420028547584b708907.tar.bz2
Improved support for --icf=safe when used with -pie.
gold/ * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers): Return true even when building pie binaries. (Target_x86_64::possible_function_pointer_reloc): Check opcode for R_X86_64_PC32 relocations. (Target_x86_64::local_reloc_may_be_function_pointer): Pass extra arguments to local_reloc_may_be_function_pointer. (Target_x86_64::global_reloc_may_be_function_pointer): Likewise. * gc.h (gc_process_relocs): Add check for STT_FUNC. * testsuite/Makefile.am (icf_safe_pie_test): New test case. * testsuite/Makefile.in: Regenerate. * testsuite/icf_safe_pie_test.sh: New shell script.
Diffstat (limited to 'gold/testsuite/Makefile.am')
-rw-r--r--gold/testsuite/Makefile.am14
1 files changed, 14 insertions, 0 deletions
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
index d9480ab..d0803d2 100644
--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -274,6 +274,20 @@ icf_safe_test_1.stdout: icf_safe_test
icf_safe_test_2.stdout: icf_safe_test
$(TEST_READELF) -h $< > $@
+check_SCRIPTS += icf_safe_pie_test.sh
+check_DATA += icf_safe_pie_test_1.stdout icf_safe_pie_test_2.stdout icf_safe_pie_test.map
+MOSTLYCLEANFILES += icf_safe_pie_test icf_safe_pie_test.map
+icf_safe_pie_test.o: icf_safe_test.cc
+ $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $<
+icf_safe_pie_test: icf_safe_pie_test.o gcctestdir/ld
+ $(CXXLINK) -o icf_safe_pie_test -Bgcctestdir/ -Wl,--icf=safe,-Map,icf_safe_pie_test.map icf_safe_pie_test.o -pie
+icf_safe_pie_test.map: icf_safe_pie_test
+ @touch icf_safe_pie_test.map
+icf_safe_pie_test_1.stdout: icf_safe_pie_test
+ $(TEST_NM) $< > $@
+icf_safe_pie_test_2.stdout: icf_safe_pie_test
+ $(TEST_READELF) -h $< > $@
+
check_SCRIPTS += icf_safe_so_test.sh
check_DATA += icf_safe_so_test_1.stdout icf_safe_so_test_2.stdout icf_safe_so_test.map
MOSTLYCLEANFILES += icf_safe_so_test icf_safe_so_test.map