Add option --weak-unresolved-symbols to treat unresolved symbols as weak ref.

This patch adds option --weak-unresolved-symbols to treat unresolved symbols as
weak references.  This is helpful when we want the link to succeed with unresolved
symbols and the dynamic loader to not complain at run-time.  Option
--warn-unresolved-symbols lets the link succeed but could fail at run-time with
unresolved symbol warnings especially when the unresolved symbols have GOT entries
and dynamic relocations against them, like when -fPIE is used.
This commit is contained in:
Sriraman Tallam
2015-04-23 13:56:40 -07:00
parent 65eb8c79be
commit a100d66fb4
6 changed files with 69 additions and 5 deletions

View File

@ -1219,6 +1219,9 @@ class General_options
options::TWO_DASHES, '\0',
N_("Report unresolved symbols as errors"),
NULL, true);
DEFINE_bool(weak_unresolved_symbols, options::TWO_DASHES, '\0', false,
N_("Convert unresolved symbols to weak references"),
NULL);
DEFINE_bool(wchar_size_warning, options::TWO_DASHES, '\0', true, NULL,
N_("(ARM only) Do not warn about objects with incompatible "