From 374ad2854b4a69a0efdb29f8f1122b4472e8055b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 14 Oct 2009 05:25:02 +0000 Subject: [PATCH] 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. --- gold/ChangeLog | 30 ++++++++++++++++++ gold/README | 1 - gold/gold.cc | 5 +-- gold/i386.cc | 4 +-- gold/layout.cc | 2 +- gold/options.cc | 11 +++++-- gold/options.h | 16 +++++----- gold/output.cc | 2 +- gold/symtab.cc | 3 +- gold/symtab.h | 3 +- gold/testsuite/Makefile.am | 18 +++++++++++ gold/testsuite/Makefile.in | 62 ++++++++++++++++++++++++++++++++------ 12 files changed, 129 insertions(+), 28 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index c39e44f16c9..9b0623deddd 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,33 @@ +2009-10-13 Ian Lance Taylor + + 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. + 2009-10-13 Bernhard Reutner-Fischer * options.h (class General_options): Add -init and -fini. diff --git a/gold/README b/gold/README index 8891d624d65..80da4558aa7 100644 --- a/gold/README +++ b/gold/README @@ -18,7 +18,6 @@ gold--are: * MEMORY regions in linker scripts * MRI compatible linker scripts * cross-reference reports (--cref) - * position independent executables (-pie) * various other minor options diff --git a/gold/gold.cc b/gold/gold.cc index 909d7c38453..4ac1e3dca03 100644 --- a/gold/gold.cc +++ b/gold/gold.cc @@ -396,8 +396,9 @@ queue_middle_tasks(const General_options& options, workqueue->set_thread_count(thread_count); // Now we have seen all the input files. - const bool doing_static_link = (!input_objects->any_dynamic() - && !parameters->options().shared()); + const bool doing_static_link = + (!input_objects->any_dynamic() + && !parameters->options().output_is_position_independent()); set_parameters_doing_static_link(doing_static_link); if (!doing_static_link && options.is_static()) { diff --git a/gold/i386.cc b/gold/i386.cc index 18eb8493561..5ac9ff4e75c 100644 --- a/gold/i386.cc +++ b/gold/i386.cc @@ -692,7 +692,7 @@ Output_data_plt_i386::do_write(Output_file* of) elfcpp::Elf_types<32>::Elf_Addr plt_address = this->address(); elfcpp::Elf_types<32>::Elf_Addr got_address = this->got_plt_->address(); - if (parameters->options().shared()) + if (parameters->options().output_is_position_independent()) memcpy(pov, dyn_first_plt_entry, plt_entry_size); else { @@ -724,7 +724,7 @@ Output_data_plt_i386::do_write(Output_file* of) { // Set and adjust the PLT entry itself. - if (parameters->options().shared()) + if (parameters->options().output_is_position_independent()) { memcpy(pov, dyn_plt_entry, plt_entry_size); elfcpp::Swap_unaligned<32, false>::writeval(pov + 2, got_offset); diff --git a/gold/layout.cc b/gold/layout.cc index d198ce24373..24965309d01 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -2144,7 +2144,7 @@ Layout::set_segment_offsets(const Target* target, Output_segment* load_seg, uint64_t addr; if (parameters->options().user_set_Ttext()) addr = parameters->options().Ttext(); - else if (parameters->options().shared()) + else if (parameters->options().output_is_position_independent()) addr = 0; else addr = target->default_text_segment_address(); diff --git a/gold/options.cc b/gold/options.cc index 5be414def08..299a748048b 100644 --- a/gold/options.cc +++ b/gold/options.cc @@ -1001,17 +1001,24 @@ General_options::finalize() // Now that we've normalized the options, check for contradictory ones. if (this->shared() && this->is_static()) gold_fatal(_("-shared and -static are incompatible")); + if (this->shared() && this->pie()) + gold_fatal(_("-shared and -pie are incompatible")); if (this->shared() && this->relocatable()) gold_fatal(_("-shared and -r are incompatible")); + if (this->pie() && this->relocatable()) + gold_fatal(_("-pie and -r are incompatible")); // TODO: implement support for -retain-symbols-file with -r, if needed. if (this->relocatable() && this->retain_symbols_file()) gold_fatal(_("-retain-symbols-file does not yet work with -r")); if (this->oformat_enum() != General_options::OBJECT_FORMAT_ELF - && (this->shared() || this->relocatable())) - gold_fatal(_("binary output format not compatible with -shared or -r")); + && (this->shared() + || this->pie() + || this->relocatable())) + gold_fatal(_("binary output format not compatible " + "with -shared or -pie or -r")); if (this->user_set_hash_bucket_empty_fraction() && (this->hash_bucket_empty_fraction() < 0.0 diff --git a/gold/options.h b/gold/options.h index 1a034423a72..cbb45b52179 100644 --- a/gold/options.h +++ b/gold/options.h @@ -763,6 +763,12 @@ class General_options DEFINE_string(oformat, options::EXACTLY_TWO_DASHES, '\0', "elf", N_("Set output format"), N_("[binary]")); + DEFINE_bool(pie, options::ONE_DASH, '\0', false, + N_("Create a position independent executable"), NULL); + DEFINE_bool_alias(pic_executable, pie, options::TWO_DASHES, '\0', + N_("Create a position independent executable"), NULL, + false); + #ifdef ENABLE_PLUGINS DEFINE_special(plugin, options::TWO_DASHES, '\0', N_("Load a plugin library"), N_("PLUGIN")); @@ -1009,7 +1015,7 @@ class General_options // the output is position-independent or not. bool output_is_position_independent() const - { return this->shared(); } + { return this->shared() || this->pie(); } // Return true if the output is something that can be exec()ed, such // as a static executable, or a position-dependent or @@ -1017,13 +1023,7 @@ class General_options // object file. bool output_is_executable() const - { return !this->shared() || this->output_is_pie(); } - - // Return true if the output is a position-independent executable. - // This is currently not supported. - bool - output_is_pie() const - { return false; } + { return !this->shared() && !this->relocatable(); } // This would normally be static(), and defined automatically, but // since static is a keyword, we need to come up with our own name. diff --git a/gold/output.cc b/gold/output.cc index 7d869b3326e..ae7b7b8686f 100644 --- a/gold/output.cc +++ b/gold/output.cc @@ -442,7 +442,7 @@ Output_file_header::do_sized_write(Output_file* of) elfcpp::ET e_type; if (parameters->options().relocatable()) e_type = elfcpp::ET_REL; - else if (parameters->options().shared()) + else if (parameters->options().output_is_position_independent()) e_type = elfcpp::ET_DYN; else e_type = elfcpp::ET_EXEC; diff --git a/gold/symtab.cc b/gold/symtab.cc index 6d5038fb2c6..5dbab35b73b 100644 --- a/gold/symtab.cc +++ b/gold/symtab.cc @@ -394,7 +394,8 @@ Symbol::final_value_is_known() const { // If we are not generating an executable, then no final values are // known, since they will change at runtime. - if (parameters->options().shared() || parameters->options().relocatable()) + if (parameters->options().output_is_position_independent() + || parameters->options().relocatable()) return false; // If the symbol is not from an object file, and is not undefined, diff --git a/gold/symtab.h b/gold/symtab.h index d186cc17bb5..d1cd64761cc 100644 --- a/gold/symtab.h +++ b/gold/symtab.h @@ -533,7 +533,7 @@ class Symbol // Return true if this symbol is a function that needs a PLT entry. // If the symbol is defined in a dynamic object or if it is subject // to pre-emption, we need to make a PLT entry. If we're doing a - // static link, we don't create PLT entries. + // static link or a -pie link, we don't create PLT entries. bool needs_plt_entry() const { @@ -542,6 +542,7 @@ class Symbol return false; return (!parameters->doing_static_link() + && !parameters->options().pie() && this->type() == elfcpp::STT_FUNC && (this->is_from_dynobj() || this->is_undefined() diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am index e5cb0591bbb..09d7325cb3d 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 diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in index 14c2cad1eb7..3f5459f707a 100644 --- a/gold/testsuite/Makefile.in +++ b/gold/testsuite/Makefile.in @@ -102,7 +102,7 @@ check_PROGRAMS = object_unittest$(EXEEXT) binary_unittest$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_4 = basic_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_static_test basic_pic_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_static_pic_test \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@ constructor_test \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_pie_test constructor_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ constructor_static_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_static_test \ @@ -114,7 +114,8 @@ check_PROGRAMS = object_unittest$(EXEEXT) binary_unittest$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_same_shared_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_12_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_21_test \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_relocatable_test +@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_relocatable_test \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_pie_test @GCC_FALSE@constructor_test_DEPENDENCIES = libgoldtest.a ../libgold.a \ @GCC_FALSE@ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \ @GCC_FALSE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) @@ -433,6 +434,7 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest_a_OBJECTS) @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_static_test$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_pic_test$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_static_pic_test$(EXEEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_pie_test$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ constructor_test$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ constructor_static_test$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test$(EXEEXT) \ @@ -445,7 +447,8 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest_a_OBJECTS) @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_same_shared_test$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_12_test$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_21_test$(EXEEXT) \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_relocatable_test$(EXEEXT) +@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_relocatable_test$(EXEEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_pie_test$(EXEEXT) @FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_2 = two_file_shared_1_nonpic_test$(EXEEXT) \ @FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_2_nonpic_test$(EXEEXT) \ @FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_same_shared_nonpic_test$(EXEEXT) \ @@ -524,6 +527,12 @@ am__DEPENDENCIES_1 = basic_pic_test_DEPENDENCIES = libgoldtest.a ../libgold.a \ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +basic_pie_test_SOURCES = basic_pie_test.c +basic_pie_test_OBJECTS = basic_pie_test.$(OBJEXT) +basic_pie_test_LDADD = $(LDADD) +basic_pie_test_DEPENDENCIES = libgoldtest.a ../libgold.a \ + ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) basic_static_pic_test_SOURCES = basic_static_pic_test.c basic_static_pic_test_OBJECTS = basic_static_pic_test.$(OBJEXT) basic_static_pic_test_LDADD = $(LDADD) @@ -920,6 +929,12 @@ am__two_file_pic_test_SOURCES_DIST = two_file_test_main.cc two_file_pic_test_OBJECTS = $(am_two_file_pic_test_OBJECTS) two_file_pic_test_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(two_file_pic_test_LDFLAGS) $(LDFLAGS) -o $@ +two_file_pie_test_SOURCES = two_file_pie_test.c +two_file_pie_test_OBJECTS = two_file_pie_test.$(OBJEXT) +two_file_pie_test_LDADD = $(LDADD) +two_file_pie_test_DEPENDENCIES = libgoldtest.a ../libgold.a \ + ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__two_file_relocatable_test_SOURCES_DIST = two_file_test_main.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@am_two_file_relocatable_test_OBJECTS = \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_main.$(OBJEXT) @@ -1148,7 +1163,7 @@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ -SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c \ +SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c basic_pie_test.c \ basic_static_pic_test.c basic_static_test.c basic_test.c \ $(binary_test_SOURCES) $(binary_unittest_SOURCES) \ $(common_test_1_SOURCES) $(constructor_static_test_SOURCES) \ @@ -1180,7 +1195,7 @@ SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c \ $(tls_static_pic_test_SOURCES) $(tls_static_test_SOURCES) \ $(tls_test_SOURCES) $(two_file_mixed_2_shared_test_SOURCES) \ $(two_file_mixed_shared_test_SOURCES) \ - $(two_file_pic_test_SOURCES) \ + $(two_file_pic_test_SOURCES) two_file_pie_test.c \ $(two_file_relocatable_test_SOURCES) \ $(two_file_same_shared_nonpic_test_SOURCES) \ $(two_file_same_shared_strip_test_SOURCES) \ @@ -1203,9 +1218,9 @@ SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c \ $(weak_test_SOURCES) $(weak_undef_nonpic_test_SOURCES) \ $(weak_undef_test_SOURCES) DIST_SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c \ - basic_static_pic_test.c basic_static_test.c basic_test.c \ - $(am__binary_test_SOURCES_DIST) $(binary_unittest_SOURCES) \ - $(am__common_test_1_SOURCES_DIST) \ + basic_pie_test.c basic_static_pic_test.c basic_static_test.c \ + basic_test.c $(am__binary_test_SOURCES_DIST) \ + $(binary_unittest_SOURCES) $(am__common_test_1_SOURCES_DIST) \ $(am__constructor_static_test_SOURCES_DIST) \ $(am__constructor_test_SOURCES_DIST) \ $(am__copy_test_SOURCES_DIST) \ @@ -1246,7 +1261,7 @@ DIST_SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c \ $(am__tls_test_SOURCES_DIST) \ $(am__two_file_mixed_2_shared_test_SOURCES_DIST) \ $(am__two_file_mixed_shared_test_SOURCES_DIST) \ - $(am__two_file_pic_test_SOURCES_DIST) \ + $(am__two_file_pic_test_SOURCES_DIST) two_file_pie_test.c \ $(am__two_file_relocatable_test_SOURCES_DIST) \ $(am__two_file_same_shared_nonpic_test_SOURCES_DIST) \ $(am__two_file_same_shared_strip_test_SOURCES_DIST) \ @@ -1845,6 +1860,12 @@ clean-checkPROGRAMS: @NATIVE_LINKER_FALSE@basic_pic_test$(EXEEXT): $(basic_pic_test_OBJECTS) $(basic_pic_test_DEPENDENCIES) @NATIVE_LINKER_FALSE@ @rm -f basic_pic_test$(EXEEXT) @NATIVE_LINKER_FALSE@ $(LINK) $(basic_pic_test_OBJECTS) $(basic_pic_test_LDADD) $(LIBS) +@GCC_FALSE@basic_pie_test$(EXEEXT): $(basic_pie_test_OBJECTS) $(basic_pie_test_DEPENDENCIES) +@GCC_FALSE@ @rm -f basic_pie_test$(EXEEXT) +@GCC_FALSE@ $(LINK) $(basic_pie_test_OBJECTS) $(basic_pie_test_LDADD) $(LIBS) +@NATIVE_LINKER_FALSE@basic_pie_test$(EXEEXT): $(basic_pie_test_OBJECTS) $(basic_pie_test_DEPENDENCIES) +@NATIVE_LINKER_FALSE@ @rm -f basic_pie_test$(EXEEXT) +@NATIVE_LINKER_FALSE@ $(LINK) $(basic_pie_test_OBJECTS) $(basic_pie_test_LDADD) $(LIBS) @GCC_FALSE@basic_static_pic_test$(EXEEXT): $(basic_static_pic_test_OBJECTS) $(basic_static_pic_test_DEPENDENCIES) @GCC_FALSE@ @rm -f basic_static_pic_test$(EXEEXT) @GCC_FALSE@ $(LINK) $(basic_static_pic_test_OBJECTS) $(basic_static_pic_test_LDADD) $(LIBS) @@ -2073,6 +2094,12 @@ two_file_mixed_shared_test$(EXEEXT): $(two_file_mixed_shared_test_OBJECTS) $(two two_file_pic_test$(EXEEXT): $(two_file_pic_test_OBJECTS) $(two_file_pic_test_DEPENDENCIES) @rm -f two_file_pic_test$(EXEEXT) $(two_file_pic_test_LINK) $(two_file_pic_test_OBJECTS) $(two_file_pic_test_LDADD) $(LIBS) +@GCC_FALSE@two_file_pie_test$(EXEEXT): $(two_file_pie_test_OBJECTS) $(two_file_pie_test_DEPENDENCIES) +@GCC_FALSE@ @rm -f two_file_pie_test$(EXEEXT) +@GCC_FALSE@ $(LINK) $(two_file_pie_test_OBJECTS) $(two_file_pie_test_LDADD) $(LIBS) +@NATIVE_LINKER_FALSE@two_file_pie_test$(EXEEXT): $(two_file_pie_test_OBJECTS) $(two_file_pie_test_DEPENDENCIES) +@NATIVE_LINKER_FALSE@ @rm -f two_file_pie_test$(EXEEXT) +@NATIVE_LINKER_FALSE@ $(LINK) $(two_file_pie_test_OBJECTS) $(two_file_pie_test_LDADD) $(LIBS) two_file_relocatable_test$(EXEEXT): $(two_file_relocatable_test_OBJECTS) $(two_file_relocatable_test_DEPENDENCIES) @rm -f two_file_relocatable_test$(EXEEXT) $(two_file_relocatable_test_LINK) $(two_file_relocatable_test_OBJECTS) $(two_file_relocatable_test_LDADD) $(LIBS) @@ -2171,6 +2198,7 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_pic_test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_pie_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_static_pic_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_static_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic_test.Po@am__quote@ @@ -2217,6 +2245,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls_test_file2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls_test_main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_file_pie_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_file_strip_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_file_test_1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_file_test_1b.Po@am__quote@ @@ -2637,6 +2666,10 @@ uninstall-am: @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ basic_pic_test.o @GCC_TRUE@@NATIVE_LINKER_TRUE@basic_static_pic_test: basic_pic_test.o gcctestdir/ld @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@basic_pie_test.o: basic_test.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -O0 -c -fpie -o $@ $< +@GCC_TRUE@@NATIVE_LINKER_TRUE@basic_pie_test: basic_pie_test.o gcctestdir/ld +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -pie basic_pie_test.o @GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_1_pic.o: two_file_test_1.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $< @GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_1b_pic.o: two_file_test_1b.cc @@ -2651,6 +2684,17 @@ uninstall-am: @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o @GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o @GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_1_pie.o: two_file_test_1.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpie -o $@ $< +@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_1b_pie.o: two_file_test_1b.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpie -o $@ $< +@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_2_pie.o: two_file_test_2.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpie -o $@ $< +@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_test_main_pie.o: two_file_test_main.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpie -o $@ $< +@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_pie_test: two_file_test_1_pie.o two_file_test_1b_pie.o \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_test_2_pie.o two_file_test_main_pie.o gcctestdir/ld +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(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 @GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared.dbg: two_file_shared.so @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(TEST_READELF) -w $< >$@ 2>/dev/null @FN_PTRS_IN_SO_WITHOUT_PIC_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld -- 2.30.2