aboutsummaryrefslogtreecommitdiff
path: root/gold/x86_64.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-02-08 22:49:22 +0000
committerIan Lance Taylor <iant@google.com>2008-02-08 22:49:22 +0000
commit8fc19601e8cc9e67bbc39c41fd368df15dcc20aa (patch)
tree508721bdc307d3a9917507013f648fb79e4fcd0f /gold/x86_64.cc
parent8da2a1df1661ca37851fd21c1dda16d433a5811a (diff)
downloadgdb-8fc19601e8cc9e67bbc39c41fd368df15dcc20aa.zip
gdb-8fc19601e8cc9e67bbc39c41fd368df15dcc20aa.tar.gz
gdb-8fc19601e8cc9e67bbc39c41fd368df15dcc20aa.tar.bz2
From Cary Coutant: fix handling of undefined symbols in shared
libraries.
Diffstat (limited to 'gold/x86_64.cc')
-rw-r--r--gold/x86_64.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index 51a8d84..54357fd 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -1144,7 +1144,9 @@ Target_x86_64::Scan::global(const General_options& options,
// If this symbol is not fully resolved, we need to add a
// dynamic relocation for it.
Reloc_section* rela_dyn = target->rela_dyn_section(layout);
- if (gsym->is_from_dynobj() || gsym->is_preemptible())
+ if (gsym->is_from_dynobj()
+ || gsym->is_undefined()
+ || gsym->is_preemptible())
got->add_global_with_rela(gsym, rela_dyn,
elfcpp::R_X86_64_GLOB_DAT);
else
@@ -1426,7 +1428,7 @@ Target_x86_64::Relocate::relocate(const Relocate_info<64, false>* relinfo,
if (gsym != NULL
&& (gsym->is_from_dynobj()
|| (parameters->output_is_shared()
- && gsym->is_preemptible()))
+ && (gsym->is_undefined() || gsym->is_preemptible())))
&& gsym->has_plt_offset())
{
symval.set_output_value(target->plt_section()->address()