This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][gold] Issue an error if a forced local symbol is referenced by DSO.


Hi,

The patch prevents gold from creating an executable which fails to run
in the case where a symbol defined in the executable and referenced
by a shared library is forced local (for example, with a version script).

On the other hand, if the symbol is defined in another DSO or referenced
only with weak references, the executable file can run, so we don't
generate the error in that case.

Best Regards,
Igor Kudrin
C++ Developer, Access Softek, Inc.

---
gold/ChangeLog

	* symtab.h (Symbol::is_defined_in_dyn,
	Symbol::set_is_defined_in_dyn, Symbol::is_ref_dynamic_nonweak,
	Symbol::set_is_ref_dynamic_nonweak): New methods.
	(Symbol::is_defined_in_dyn_, Symbol::is_ref_dynamic_nonweak_):
	New data members.
	(Symbol_table::warn_about_forced_local_dynobj_ref_symbol):
	New method.
	* symtab.cc (Symbol::init_fields): Reset the new flags.
	(Symbol::init_base_object): Initialize the new flags.
	(Symbol_table::sized_write_globals): Scan forced local
	symbols and call warn_about_undefined_dynobj_symbol.
	(Symbol_table::warn_about_undefined_dynobj_symbol):
	New method.
	* resolve.cc (Symbol_table::resolve): Set the new flags.
	* testsuite/Makefile.am (ver_test_14a, ver_test_14b,
	ver_test_14c): New tests.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/ver_test_14.script: New test version script.
	* testsuite/ver_test_14_def.s: New test source file.
	* testsuite/ver_test_14_main.s: Likewise.
	* testsuite/ver_test_14_ref.s: Likewise.
	* testsuite/ver_test_14_ref_weak.s: Likewise.
	* testsuite/ver_test_14a.sh: New test script.

Attachment: gold-forced-local-ref-by-dso.patch.txt
Description: gold-forced-local-ref-by-dso.patch.txt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]