[gold/15662] Fix a powerpc internal error in do_relax()
Jing Yu
jingyu@google.com
Mon Jun 24 20:44:00 GMT 2013
The patch is to fix an gold internal error,
internal error in set_current_data_size_for_child, at
/usr/local/home/jingyu/opensource/binutils_trunk/src/gold/output.h:436
The error happens when set_current_data_size_for_child is called through
this->rel_->add_relative(elfcpp::R_POWERPC_RELATIVE, this, off, to);
through
Target_powerpc<size, big_endian>::do_relax().
When the data size is updated through add_relative, the flag
is_data_size_valid_ is not set to false beforehand, which triggers the
assertion failure.
Thanks Cary for the comments in gold/15662. Here is the updated patch.
Is the patch ok? Thanks!
2013-06-24 Jing Yu <jingyu@google.com>
PR gold/15662
* powerpc.cc (Target_powerpc::do_relax): Add calls to reset
and finalize its relo section's data size.
Index: powerpc.cc
===================================================================
RCS file: /cvs/src/src/gold/powerpc.cc,v
retrieving revision 1.91
diff -u -p -r1.91 powerpc.cc
--- powerpc.cc 27 Apr 2013 00:53:16 -0000 1.91
+++ powerpc.cc 24 Jun 2013 20:09:03 -0000
@@ -2628,7 +2628,7 @@ Target_powerpc<size, big_endian>::do_rel
&& parameters->options().output_is_position_independent())
{
// Fill in the BRLT relocs.
- this->brlt_section_->reset_data_size();
+ this->brlt_section_->reset_brlt_sizes();
for (typename Branch_lookup_table::const_iterator p
= this->branch_lookup_table_.begin();
p != this->branch_lookup_table_.end();
@@ -2636,7 +2636,7 @@ Target_powerpc<size, big_endian>::do_rel
{
this->brlt_section_->add_reloc(p->first, p->second);
}
- this->brlt_section_->finalize_data_size();
+ this->brlt_section_->finalize_brlt_sizes();
}
return again;
}
@@ -3013,6 +3013,20 @@ class Output_data_brlt_powerpc : public
targ_(targ)
{ }
+ void
+ reset_brlt_sizes()
+ {
+ this->reset_data_size();
+ this->rel_->reset_data_size();
+ }
+
+ void
+ finalize_brlt_sizes()
+ {
+ this->finalize_data_size();
+ this->rel_->finalize_data_size();
+ }
+
// Add a reloc for an entry in the BRLT.
void
add_reloc(Address to, unsigned int off)
More information about the Binutils
mailing list