@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_8 \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10 \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_11 \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_12 \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_start_lib
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@am__append_45 = \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_1.sh \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_7.sh \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10.sh \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_11.sh \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_12.sh \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_start_lib.sh
# Test that symbols known in the IR file but not in the replacement file
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_9b.err \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10.sections \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_11.err \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_12.err \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_start_lib.err
# Make a copy of two_file_test_1.o, which does not define the symbol _Z4t16av.
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@am__append_47 = \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10.sections \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_11.err \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_thin.a \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_12.err \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_start_lib.err
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@am__append_48 = plugin_test_tls
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@am__append_49 = plugin_test_tls.sh
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_8$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_10$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_11$(EXEEXT) \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_12$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ plugin_test_start_lib$(EXEEXT)
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@@TLS_TRUE@am__EXEEXT_25 = plugin_test_tls$(EXEEXT)
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_26 = \
../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
+plugin_test_12_SOURCES = plugin_test_12.c
+plugin_test_12_OBJECTS = plugin_test_12.$(OBJEXT)
+plugin_test_12_LDADD = $(LDADD)
+plugin_test_12_DEPENDENCIES = libgoldtest.a ../libgold.a \
+ ../../libiberty/libiberty.a $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
plugin_test_2_SOURCES = plugin_test_2.c
plugin_test_2_OBJECTS = plugin_test_2.$(OBJEXT)
plugin_test_2_LDADD = $(LDADD)
$(many_sections_test_SOURCES) $(object_unittest_SOURCES) \
$(overflow_unittest_SOURCES) permission_test.c \
$(pie_copyrelocs_test_SOURCES) plugin_test_1.c \
- plugin_test_10.c plugin_test_11.c plugin_test_2.c \
- plugin_test_3.c plugin_test_4.c plugin_test_5.c \
- plugin_test_6.c plugin_test_7.c plugin_test_8.c \
- plugin_test_start_lib.c plugin_test_tls.c pr17704a_test.c \
- $(pr20216a_test_SOURCES) $(pr20216b_test_SOURCES) \
- $(pr20216c_test_SOURCES) $(pr20216d_test_SOURCES) \
- $(pr20216e_test_SOURCES) $(pr20308a_test_SOURCES) \
- $(pr20308b_test_SOURCES) $(pr20308c_test_SOURCES) \
- $(pr20308d_test_SOURCES) $(pr20308e_test_SOURCES) pr20976.c \
- $(protected_1_SOURCES) $(protected_2_SOURCES) \
- $(relro_now_test_SOURCES) $(relro_script_test_SOURCES) \
- $(relro_strip_test_SOURCES) $(relro_test_SOURCES) \
- $(script_test_1_SOURCES) script_test_11.c script_test_12.c \
- script_test_12i.c $(script_test_2_SOURCES) script_test_3.c \
+ plugin_test_10.c plugin_test_11.c plugin_test_12.c \
+ plugin_test_2.c plugin_test_3.c plugin_test_4.c \
+ plugin_test_5.c plugin_test_6.c plugin_test_7.c \
+ plugin_test_8.c plugin_test_start_lib.c plugin_test_tls.c \
+ pr17704a_test.c $(pr20216a_test_SOURCES) \
+ $(pr20216b_test_SOURCES) $(pr20216c_test_SOURCES) \
+ $(pr20216d_test_SOURCES) $(pr20216e_test_SOURCES) \
+ $(pr20308a_test_SOURCES) $(pr20308b_test_SOURCES) \
+ $(pr20308c_test_SOURCES) $(pr20308d_test_SOURCES) \
+ $(pr20308e_test_SOURCES) pr20976.c $(protected_1_SOURCES) \
+ $(protected_2_SOURCES) $(relro_now_test_SOURCES) \
+ $(relro_script_test_SOURCES) $(relro_strip_test_SOURCES) \
+ $(relro_test_SOURCES) $(script_test_1_SOURCES) \
+ script_test_11.c script_test_12.c script_test_12i.c \
+ $(script_test_2_SOURCES) script_test_3.c \
$(searched_file_test_SOURCES) start_lib_test.c \
$(thin_archive_test_1_SOURCES) $(thin_archive_test_2_SOURCES) \
$(tls_phdrs_script_test_SOURCES) $(tls_pic_test_SOURCES) \
@PLUGINS_FALSE@plugin_test_11$(EXEEXT): $(plugin_test_11_OBJECTS) $(plugin_test_11_DEPENDENCIES) $(EXTRA_plugin_test_11_DEPENDENCIES)
@PLUGINS_FALSE@ @rm -f plugin_test_11$(EXEEXT)
@PLUGINS_FALSE@ $(LINK) $(plugin_test_11_OBJECTS) $(plugin_test_11_LDADD) $(LIBS)
+@GCC_FALSE@plugin_test_12$(EXEEXT): $(plugin_test_12_OBJECTS) $(plugin_test_12_DEPENDENCIES) $(EXTRA_plugin_test_12_DEPENDENCIES)
+@GCC_FALSE@ @rm -f plugin_test_12$(EXEEXT)
+@GCC_FALSE@ $(LINK) $(plugin_test_12_OBJECTS) $(plugin_test_12_LDADD) $(LIBS)
+@NATIVE_LINKER_FALSE@plugin_test_12$(EXEEXT): $(plugin_test_12_OBJECTS) $(plugin_test_12_DEPENDENCIES) $(EXTRA_plugin_test_12_DEPENDENCIES)
+@NATIVE_LINKER_FALSE@ @rm -f plugin_test_12$(EXEEXT)
+@NATIVE_LINKER_FALSE@ $(LINK) $(plugin_test_12_OBJECTS) $(plugin_test_12_LDADD) $(LIBS)
+@PLUGINS_FALSE@plugin_test_12$(EXEEXT): $(plugin_test_12_OBJECTS) $(plugin_test_12_DEPENDENCIES) $(EXTRA_plugin_test_12_DEPENDENCIES)
+@PLUGINS_FALSE@ @rm -f plugin_test_12$(EXEEXT)
+@PLUGINS_FALSE@ $(LINK) $(plugin_test_12_OBJECTS) $(plugin_test_12_LDADD) $(LIBS)
@GCC_FALSE@plugin_test_2$(EXEEXT): $(plugin_test_2_OBJECTS) $(plugin_test_2_DEPENDENCIES) $(EXTRA_plugin_test_2_DEPENDENCIES)
@GCC_FALSE@ @rm -f plugin_test_2$(EXEEXT)
@GCC_FALSE@ $(LINK) $(plugin_test_2_OBJECTS) $(plugin_test_2_LDADD) $(LIBS)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_test_1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_test_10.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_test_11.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_test_12.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_test_2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_test_3.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin_test_4.Po@am__quote@
@p='plugin_test_10.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
plugin_test_11.sh.log: plugin_test_11.sh
@p='plugin_test_11.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+plugin_test_12.sh.log: plugin_test_12.sh
+ @p='plugin_test_12.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
plugin_test_start_lib.sh.log: plugin_test_start_lib.sh
@p='plugin_test_start_lib.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
plugin_test_tls.sh.log: plugin_test_tls.sh
@p='plugin_test_10$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
plugin_test_11.log: plugin_test_11$(EXEEXT)
@p='plugin_test_11$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
+plugin_test_12.log: plugin_test_12$(EXEEXT)
+ @p='plugin_test_12$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
plugin_test_start_lib.log: plugin_test_start_lib$(EXEEXT)
@p='plugin_test_start_lib$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
plugin_test_tls.log: plugin_test_tls$(EXEEXT)
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_thin.a: two_file_test_1.o two_file_test_1b.o two_file_test_2.o
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ rm -f $@
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_AR) crT $@ $^
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@export_dynamic_plugin.o.syms: export_dynamic_plugin.o
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(TEST_READELF) -sW $< >$@ 2>/dev/null
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@export_dynamic_plugin.o: export_dynamic_plugin.cc
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(COMPILE) -c -o $@ $<
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_12: export_dynamic_plugin.o gcctestdir/ld plugin_test.so export_dynamic_plugin.o.syms
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z3foov" -Wl,--export-dynamic-symbol,"_Z3foov" export_dynamic_plugin.o.syms 2>plugin_test_12.err
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_12.err: plugin_test_12
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ @touch plugin_test_12.err
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_start_lib: unused.o plugin_start_lib_test.o plugin_start_lib_test_2.syms gcctestdir/ld plugin_test.so
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_start_lib_test.o \
@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@ -Wl,--start-lib plugin_start_lib_test_2.syms -Wl,--end-lib 2>plugin_test_start_lib.err
--- /dev/null
+#!/bin/sh
+
+# plugin_test_12.sh -- a test case for the plugin API.
+
+# Copyright (C) 2017 onwards Free Software Foundation, Inc.
+# Written by Teresa Johnson <tejohnson@google.com>.
+
+# This file is part of gold.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+# This file goes with plugin_test.c, a simple plug-in library that
+# exercises the basic interfaces and prints out version numbers and
+# options passed to the plugin.
+
+# This checks if the symbol resolution withe export dynamic symbol is
+# as expected.
+
+check()
+{
+ if ! grep -q "$2" "$1"
+ then
+ echo "Did not find expected output in $1:"
+ echo " $2"
+ echo ""
+ echo "Actual output below:"
+ cat "$1"
+ exit 1
+ fi
+}
+
+check plugin_test_12.err "API version:"
+check plugin_test_12.err "gold version:"
+check plugin_test_12.err "option: _Z3foov"
+check plugin_test_12.err "export_dynamic_plugin.o.syms: claim file hook called"
+check plugin_test_12.err "export_dynamic_plugin.o.syms: _Z3foov: PREVAILING_DEF_IRONLY_EXP"
+check plugin_test_12.err "cleanup hook called"
+
+exit 0