This is the mail archive of the 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.


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.


	* 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.
	New method.
	* (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.
	New method.
	* (Symbol_table::resolve): Set the new flags.
	* testsuite/ (ver_test_14a, ver_test_14b,
	ver_test_14c): New tests.
	* testsuite/ 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/ 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]