public inbox for prelink@sourceware.org
 help / color / mirror / Atom feed
* Do not crash on corrupt symbol tables
@ 2007-12-04 16:14 Daniel Jacobowitz
  2008-05-16 18:31 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Jacobowitz @ 2007-12-04 16:14 UTC (permalink / raw)
  To: prelink

I have a library with a very corrupt symbol table.  It kills the
prelinker, because some sections have not yet been moved in dso->scn
when we go to close the corrupt file, so it tries to free some mmapped
pointers.  This patch lets everything else in the filesystem be
prelinked normally.

-- 
Daniel Jacobowitz
CodeSourcery

2007-12-04  Daniel Jacobowitz  <dan@codesourcery.com>

	* dso.c (reopen_dso): Update dso->scn and dso->shdr before
	adjusting sections.

---
 src/dso.c |    4 ++++
 1 files changed, 4 insertions(+)

Index: prelink-20061211/src/dso.c
===================================================================
--- prelink-20061211.orig/src/dso.c	2007-12-04 07:36:25.000000000 -0800
+++ prelink-20061211/src/dso.c	2007-12-04 08:05:40.000000000 -0800
@@ -936,6 +936,10 @@ reopen_dso (DSO *dso, struct section_mov
     {
       dso->scn[i] = elf_getscn (dso->elf, i);
       gelfx_getshdr (dso->elf, dso->scn[i], dso->shdr + i);
+    }
+
+  for (i = 1; i < move->new_shnum; i++)
+    {
       if (move->new_to_old[i] == -1)
 	continue;
       if (dso->move

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-16 18:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-04 16:14 Do not crash on corrupt symbol tables Daniel Jacobowitz
2008-05-16 18:31 ` Daniel Jacobowitz

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).