[Bug15639][ARM] gold and -flto always fails with an internal error on arm-linux-gnueabi*

Kugan kugan.vivekanandarajah@linaro.org
Wed Jan 29 11:27:00 GMT 2014


Hi,

In Sized_relobj_file<size,
big_endian>::do_layout_deferred_sections(Layout* layout), while reading
.eh_frame, Arm_relobj<big_endian>::do_read_symbols(Read_symbols_data*
sd) is called second time around and this triggering the assert.

This patch removes the assert and skips reading if this section is
already read.

Is this OK?

Thanks,
Kugan


gold/
+2014-01-29  Kugan Vivekanandarajah  <kuganv@linaro.org>
+
+	* arm.cc (Arm_relobj<big_endian>::do_read_symbols): Skip reading
+	.ARM.attributes section if already read.
+
-------------- next part --------------
diff --git a/gold/arm.cc b/gold/arm.cc
index 560f380..4588b94 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -6729,9 +6729,9 @@ Arm_relobj<big_endian>::do_read_symbols(Read_symbols_data* sd)
 	// be conservative.
 	must_merge_flags_and_attributes = true;
 
-      if (shdr.get_sh_type() == elfcpp::SHT_ARM_ATTRIBUTES)
+      if ((shdr.get_sh_type() == elfcpp::SHT_ARM_ATTRIBUTES)
+	  && (this->attributes_section_data_ == NULL))
 	{
-	  gold_assert(this->attributes_section_data_ == NULL);
 	  section_offset_type section_offset = shdr.get_sh_offset();
 	  section_size_type section_size =
 	    convert_to_section_size_type(shdr.get_sh_size());


More information about the Binutils mailing list