aboutsummaryrefslogtreecommitdiff
path: root/gold/testsuite/Makefile.am
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-10-14 05:25:02 +0000
committerIan Lance Taylor <ian@airs.com>2009-10-14 05:25:02 +0000
commit374ad2854b4a69a0efdb29f8f1122b4472e8055b (patch)
treebdef35b60f15322094f5a6c77b05bfa2416dc074 /gold/testsuite/Makefile.am
parentfc1ed737279ecd7ab047b583a411e626a678207d (diff)
downloadgdb-374ad2854b4a69a0efdb29f8f1122b4472e8055b.zip
gdb-374ad2854b4a69a0efdb29f8f1122b4472e8055b.tar.gz
gdb-374ad2854b4a69a0efdb29f8f1122b4472e8055b.tar.bz2
Add support for -pie.
* options.h (class General_options): Add -pie and --pic-executable. (General_options::output_is_position_independent): Test -pie. (General_options::output_is_executable): Return true if not shared and not relocatable. (General_options::output_is_pie): Remove. * options.cc (General_options::finalize): Reject incompatible uses of -pie. * gold.cc (queue_middle_tasks): A -pie link is not static. * symtab.h (Symbol::needs_plt_entry): Return false if -pie. * symtab.cc (Symbol::final_value_is_known): Return false if output_is_position_independent. * layout.cc (Layout::set_segment_offsets): Start at address 0 if output_is_position_independent. * output.cc (Output_file_header::do_sized_write): Use ET_DYN if output_is_position_independent. * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if output_is_position_independent. * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and two_file_pie_test. (basic_pie_test.o, basic_pie_test): New targets. (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets. (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets. (two_file_pie_test): New target. * testsuite/Makefile.in: Rebuild. * README: Remove note saying that -pie is not supported.
Diffstat (limited to 'gold/testsuite/Makefile.am')
-rw-r--r--gold/testsuite/Makefile.am18
1 files changed, 18 insertions, 0 deletions
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
index e5cb059..09d7325 100644
--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -176,6 +176,11 @@ basic_pic_test: basic_pic_test.o gcctestdir/ld
basic_static_pic_test: basic_pic_test.o gcctestdir/ld
$(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o
+check_PROGRAMS += basic_pie_test
+basic_pie_test.o: basic_test.cc
+ $(CXXCOMPILE) -O0 -c -fpie -o $@ $<
+basic_pie_test: basic_pie_test.o gcctestdir/ld
+ $(CXXLINK) -Bgcctestdir/ -pie basic_pie_test.o
check_PROGRAMS += constructor_test
check_PROGRAMS += constructor_static_test
@@ -281,6 +286,19 @@ two_file_relocatable_test_LDADD = two_file_relocatable.o
two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o
gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o
+check_PROGRAMS += two_file_pie_test
+two_file_test_1_pie.o: two_file_test_1.cc
+ $(CXXCOMPILE) -c -fpie -o $@ $<
+two_file_test_1b_pie.o: two_file_test_1b.cc
+ $(CXXCOMPILE) -c -fpie -o $@ $<
+two_file_test_2_pie.o: two_file_test_2.cc
+ $(CXXCOMPILE) -c -fpie -o $@ $<
+two_file_test_main_pie.o: two_file_test_main.cc
+ $(CXXCOMPILE) -c -fpie -o $@ $<
+two_file_pie_test: two_file_test_1_pie.o two_file_test_1b_pie.o \
+ two_file_test_2_pie.o two_file_test_main_pie.o gcctestdir/ld
+ $(CXXLINK) -Bgcctestdir/ -pie two_file_test_1_pie.o two_file_test_1b_pie.o two_file_test_2_pie.o two_file_test_main_pie.o
+
check_SCRIPTS += two_file_shared.sh
check_DATA += two_file_shared.dbg
MOSTLYCLEANFILES += two_file_shared.dbg