This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gold][patch] Fix internal error with .eh_frame section merging
- From: Cary Coutant <ccoutant at google dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Fri, 14 Nov 2008 17:31:27 -0800
- Subject: [gold][patch] Fix internal error with .eh_frame section merging
In a 64-bit build of gold, the "needs_special_offset_handling" flag
isn't getting set properly for .eh_frame sections because my earlier
patch to clean up the usage of -1U constants missed one that should
have been changed to "invalid_address". As a result, we end up
processing relocations for a CIE that was eliminated, and generating a
dynamic relocation for the reference to the personality routine in
that CIE. When trying to deal with that dynamic relocation later, we
sometimes hit an assert in Output_reloc::get_address().
The attached patch fixes this problem. Committing as obvious.
-cary
ChangeLog:
* reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
instead of -1U.
Index: reloc.cc
===================================================================
RCS file: /cvs/src/src/gold/reloc.cc,v
retrieving revision 1.38
diff -u -p -r1.38 reloc.cc
--- reloc.cc 29 Sep 2008 21:10:26 -0000 1.38
+++ reloc.cc 15 Nov 2008 01:07:09 -0000
@@ -274,7 +274,7 @@ Sized_relobj<size, big_endian>::do_read_
sr.sh_type = sh_type;
sr.reloc_count = reloc_count;
sr.output_section = os;
- sr.needs_special_offset_handling = out_offsets[shndx] == -1U;
+ sr.needs_special_offset_handling = out_offsets[shndx] == invalid_address;
sr.is_data_section_allocated = is_section_allocated;
}