public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* gold patch committed: Ignore empty reloc sections
@ 2011-05-31  9:52 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2011-05-31  9:52 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

This patch to gold ignores empty reloc sections when reading relocs,
rather than crashing when it tries to get a zero-sized view.  Committed
to mainline.

Ian


2011-05-30  Ian Lance Taylor  <iant@google.com>

	* reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
	sections.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 528 bytes --]

Index: reloc.cc
===================================================================
RCS file: /cvs/src/src/gold/reloc.cc,v
retrieving revision 1.66
diff -p -u -r1.66 reloc.cc
--- reloc.cc	24 May 2011 21:41:10 -0000	1.66
+++ reloc.cc	31 May 2011 04:25:52 -0000
@@ -322,6 +322,9 @@ Sized_relobj_file<size, big_endian>::do_
 
       off_t sh_size = shdr.get_sh_size();
 
+      if (sh_size == 0)
+	continue;
+
       unsigned int reloc_size;
       if (sh_type == elfcpp::SHT_REL)
 	reloc_size = elfcpp::Elf_sizes<size>::rel_size;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-31  4:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-31  9:52 gold patch committed: Ignore empty reloc sections Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).