gold patch committed: Don't crash on invalid reloc offset

Ian Lance Taylor iant@google.com
Sat Apr 27 00:53:00 GMT 2013


When I tried linking gold with a bogus object file I got a segmentation
violation.  This patch fixes it by not trying to relocate an address
with a bad relocation offset.  It still permits target to accept
unexpected relocation offsets by having their relocation routine return
false.  Committed to mainline.

Ian


2013-04-26  Ian Lance Taylor  <iant@google.com>

	* target-reloc.h (relocate_section): If the reloc offset is out of
	range, pass VIEW as NULL to relocate.relocate.
	* arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
	* i386.cc (Target_i386::Relocate::relocate): Likewise.
	* powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
	* sparc.cc (Target_sparc::Relocate::relocate): Likewise.
	* tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
	* x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-diff
Size: 5990 bytes
Desc: patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20130427/cd7fc4ee/attachment.bin>


More information about the Binutils mailing list