aboutsummaryrefslogtreecommitdiff
path: root/gold/testsuite/Makefile.am
diff options
context:
space:
mode:
authorSriraman Tallam <tmsriram@google.com>2018-02-15 17:35:16 -0800
committerSriraman Tallam <tmsriram@google.com>2018-02-15 17:35:16 -0800
commit3281b315c89caf1d539a316e41cc095e46482f75 (patch)
treec324284c8a21bf2bac30f2bb5678cbb430e63867 /gold/testsuite/Makefile.am
parent43859909e2982252d136e19258431f3aa8afb890 (diff)
downloadbinutils-3281b315c89caf1d539a316e41cc095e46482f75.zip
binutils-3281b315c89caf1d539a316e41cc095e46482f75.tar.gz
binutils-3281b315c89caf1d539a316e41cc095e46482f75.tar.bz2
Fix symbol resolution with linker plugins for defsym symbols.
2018-02-07 Sriraman Tallam <tmsriram@google.com> * expression.cc (Symbol_expression::set_expr_sym_in_real_elf): New method. (Unary_expression::set_expr_sym_in_real_elf): New method. (Binary_expression::set_expr_sym_in_real_elf): New method. (Trinary_expression::set_expr_sym_in_real_elf): New method. * plugin.cc (get_symbol_resolution_info): Fix symbol resolution if defined or used in defsyms. * plugin.h (Plugin_manager::is_defsym_def): New method. (Plugin_manager::Plugin_manager): Initialize defsym_defines_set_. (Plugin_manager::defsym_defines_set_): New member. (Plugin_manager::Defsym_defines_set): New typedef. * script.cc (Script_options::set_defsym_uses_in_real_elf): New method. (Script_options::find_defsym_defs): New method. * script.h (Expression::set_expr_sym_in_real_elf): New method. (Symbol_assignment::is_defsym): New method. (Symbol_assignment::value): New method. (Script_options::find_defsym_defs): New method. (Script_options::set_defsym_uses_in_real_elf): New method. * testsuite/Makefile.am (plugin_test_defsym): New test. * testsuite/Makefile.in: Regenerate. * testsuite/plugin_test.c: Check for new symbol resolution. * testsuite/plugin_test_defsym.sh: New script. * testsuite/plugin_test_defsym.c: New test source.
Diffstat (limited to 'gold/testsuite/Makefile.am')
-rw-r--r--gold/testsuite/Makefile.am13
1 files changed, 12 insertions, 1 deletions
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
index 16cae80..7ec3e8d 100644
--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -2332,11 +2332,22 @@ plugin_test_start_lib: unused.o plugin_start_lib_test.o plugin_start_lib_test_2.
plugin_test_start_lib.err: plugin_test_start_lib
@touch plugin_test_start_lib.err
+check_PROGRAMS += plugin_test_defsym
+check_SCRIPTS += plugin_test_defsym.sh
+check_DATA += plugin_test_defsym.err
+MOSTLYCLEANFILES += plugin_test_defsym.err
+plugin_test_defsym.syms: plugin_test_defsym.o
+ $(TEST_READELF) -sW $< >$@ 2>/dev/null
+plugin_test_defsym.o: plugin_test_defsym.c
+ $(COMPILE) -c -o $@ $<
+plugin_test_defsym: plugin_test_defsym.o plugin_test_defsym.syms gcctestdir/ld plugin_test.so
+ $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" -Wl,--defsym,bar=foo plugin_test_defsym.syms 2>plugin_test_defsym.err
+plugin_test_defsym.err: plugin_test_defsym
+ @touch plugin_test_defsym.err
plugin_start_lib_test_2.syms: plugin_start_lib_test_2.o
$(TEST_READELF) -sW $< >$@ 2>/dev/null
-
plugin_test.so: plugin_test.o gcctestdir/ld
$(LINK) -Bgcctestdir/ -shared plugin_test.o
plugin_test.o: plugin_test.c