aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-06-27 03:11:22 +0000
committerAlan Modra <amodra@gmail.com>2013-06-27 03:11:22 +0000
commita2d7bf59d6e7b42aa05c73d40fa7b6ebb12df4f7 (patch)
treeff85ce23981e3454bc81fe195c0d8121fcb7a395 /gold
parent02b1871e58f3de923ae7d3eceb99e0db43928249 (diff)
downloadgdb-a2d7bf59d6e7b42aa05c73d40fa7b6ebb12df4f7.zip
gdb-a2d7bf59d6e7b42aa05c73d40fa7b6ebb12df4f7.tar.gz
gdb-a2d7bf59d6e7b42aa05c73d40fa7b6ebb12df4f7.tar.bz2
* powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
on garbage collected .opd section. * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx is non-zero. (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx(). (Target_powerpc::do_function_location): Likewise for loc->shndx.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog12
-rw-r--r--gold/powerpc.cc9
2 files changed, 17 insertions, 4 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 07fe276..874a20a 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,15 @@
+2013-06-27 Cary Coutant <ccoutant@google.com>
+
+ * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
+ on garbage collected .opd section.
+
+2013-06-27 Alan Modra <amodra@gmail.com>
+
+ * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
+ is non-zero.
+ (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
+ (Target_powerpc::do_function_location): Likewise for loc->shndx.
+
2013-06-14 Cary Coutant <ccoutant@google.com>
* resolve.cc (Symbol::override_base): Don't override st_type
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index ca4aaa2..747c7b4 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -5827,7 +5827,7 @@ Target_powerpc<size, big_endian>::do_gc_add_reference(
Powerpc_relobj<size, big_endian>* ppc_object
= static_cast<Powerpc_relobj<size, big_endian>*>(dst_obj);
- if (dst_shndx == ppc_object->opd_shndx())
+ if (dst_shndx != 0 && dst_shndx == ppc_object->opd_shndx())
{
if (ppc_object->opd_valid())
{
@@ -5859,7 +5859,7 @@ Target_powerpc<size, big_endian>::do_gc_mark_symbol(
= static_cast<Powerpc_relobj<size, big_endian>*>(sym->object());
bool is_ordinary;
unsigned int shndx = sym->shndx(&is_ordinary);
- if (is_ordinary && shndx == ppc_object->opd_shndx())
+ if (is_ordinary && shndx != 0 && shndx == ppc_object->opd_shndx())
{
Sized_symbol<size>* gsym = symtab->get_sized_symbol<size>(sym);
Address dst_off = gsym->value();
@@ -5882,7 +5882,7 @@ void
Target_powerpc<size, big_endian>::do_function_location(
Symbol_location* loc) const
{
- if (size == 64)
+ if (size == 64 && loc->shndx != 0)
{
if (loc->object->is_dynamic())
{
@@ -6183,7 +6183,8 @@ Target_powerpc<size, big_endian>::symval_for_branch(
if (shndx == 0)
return value;
Address opd_addr = symobj->get_output_section_offset(shndx);
- gold_assert(opd_addr != invalid_address);
+ if (opd_addr == invalid_address)
+ return value;
opd_addr += symobj->output_section(shndx)->address();
if (value >= opd_addr && value < opd_addr + symobj->section_size(shndx))
{