Do not crash on corrupt symbol tables
Daniel Jacobowitz
drow@false.org
Fri May 16 18:31:00 GMT 2008
On Tue, Dec 04, 2007 at 11:14:25AM -0500, Daniel Jacobowitz wrote:
> 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.
Ping?
> 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
>
--
Daniel Jacobowitz
CodeSourcery
More information about the Prelink
mailing list