diff options
author | Alan Modra <amodra@gmail.com> | 2015-04-28 13:28:29 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2015-06-06 00:08:22 +0930 |
commit | 99381983ab1b423b93bfa3f6fbe7115079717255 (patch) | |
tree | 8022525c64ed6260b73cf3faf66af7b73ed4d8ca | |
parent | f64cce87d52a6a8a624a284026cb876783adfc10 (diff) | |
download | gdb-99381983ab1b423b93bfa3f6fbe7115079717255.zip gdb-99381983ab1b423b93bfa3f6fbe7115079717255.tar.gz gdb-99381983ab1b423b93bfa3f6fbe7115079717255.tar.bz2 |
PowerPC gold assertion on missing global entry stub
Global entry stubs are used on ELFv2 to provide addresses for
functions not defined in a non-PIC executable but whose address is
taken, in much the same way as PLT stub code is used on other
targets to provide function addresses. We don't want to insert a
global entry stub just because (bogus) debug info refers to the
address of a non-local function, but we also don't want gold to die.
* powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
on missing global entry stub due to bogus debug info.
-rw-r--r-- | gold/ChangeLog | 4 | ||||
-rw-r--r-- | gold/powerpc.cc | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index b2225e0..f554ee8 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,6 +1,10 @@ 2015-06-05 Alan Modra <amodra@gmail.com> Apply from master + 2015-04-28 Alan Modra <amodra@gmail.com> + * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert + on missing global entry stub due to bogus debug info. + 2015-03-24 Alan Modra <amodra@gmail.com> PR 18147 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report diff --git a/gold/powerpc.cc b/gold/powerpc.cc index e7f3554..3766f72 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -6748,8 +6748,11 @@ Target_powerpc<size, big_endian>::Relocate::relocate( && !is_branch_reloc(r_type)) { unsigned int off = target->glink_section()->find_global_entry(gsym); - gold_assert(off != (unsigned int)-1); - value = target->glink_section()->global_entry_address() + off; + if (off != (unsigned int)-1) + { + value = target->glink_section()->global_entry_address() + off; + has_stub_value = true; + } } else { @@ -6771,8 +6774,8 @@ Target_powerpc<size, big_endian>::Relocate::relocate( rela.get_r_addend()); gold_assert(off != invalid_address); value = stub_table->stub_address() + off; + has_stub_value = true; } - has_stub_value = true; } if (r_type == elfcpp::R_POWERPC_GOT16 |