aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.h
diff options
context:
space:
mode:
authorSriraman Tallam <tmsriram@google.com>2015-04-23 13:56:40 -0700
committerSriraman Tallam <tmsriram@google.com>2015-04-23 13:56:40 -0700
commita100d66fb42044153dc0e93c96d7944dab0cc674 (patch)
tree7ab7ef6c6911cde3a440fed3c688e6b533d973f4 /gold/symtab.h
parent65eb8c79be0c71f9b52d14563c0817fc5ca33c0d (diff)
downloadgdb-a100d66fb42044153dc0e93c96d7944dab0cc674.zip
gdb-a100d66fb42044153dc0e93c96d7944dab0cc674.tar.gz
gdb-a100d66fb42044153dc0e93c96d7944dab0cc674.tar.bz2
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.
Diffstat (limited to 'gold/symtab.h')
-rw-r--r--gold/symtab.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/gold/symtab.h b/gold/symtab.h
index 9413360..6f47c5e 100644
--- a/gold/symtab.h
+++ b/gold/symtab.h
@@ -526,7 +526,8 @@ class Symbol
{
return (this->is_undefined()
&& (this->binding() == elfcpp::STB_WEAK
- || this->is_undef_binding_weak()));
+ || this->is_undef_binding_weak()
+ || parameters->options().weak_unresolved_symbols()));
}
// Return whether this is a strong undefined symbol.
@@ -535,7 +536,8 @@ class Symbol
{
return (this->is_undefined()
&& this->binding() != elfcpp::STB_WEAK
- && !this->is_undef_binding_weak());
+ && !this->is_undef_binding_weak()
+ && !parameters->options().weak_unresolved_symbols());
}
// Return whether this is an absolute symbol.