diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/exec.c | 1 | ||||
-rw-r--r-- | src/space.c | 14 | ||||
-rw-r--r-- | src/space.h | 3 |
3 files changed, 15 insertions, 3 deletions
@@ -331,6 +331,7 @@ prelink_exec (struct prelink_info *info) addcnt = i; memset (&adjust, 0, sizeof (adjust)); adjust.new = new; + adjust.move = move; for (i = 0; i < addcnt; ++i) { diff --git a/src/space.c b/src/space.c index c32e900..81b6e17 100644 --- a/src/space.c +++ b/src/space.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -604,10 +604,12 @@ find_readonly_space (DSO *dso, GElf_Shdr *add, GElf_Ehdr *ehdr, else { GElf_Shdr moveshdr; - int newidx, ret, movedidx; + int newidx, ret, movedidx, oldidx; moveshdr = shdr[movesec]; newidx = remove_readonly_section (ehdr, shdr, movesec, adjust); + oldidx = adjust->move->new_to_old[movesec]; + remove_section (adjust->move, movesec); ret = find_readonly_space (dso, add, ehdr, phdr, shdr, adjust); if (ret == 0) return 0; @@ -617,6 +619,14 @@ find_readonly_space (DSO *dso, GElf_Shdr *add, GElf_Ehdr *ehdr, return 0; if (newidx != -1) adjust->new[newidx] = movedidx; + add_section (adjust->move, movedidx); + if (oldidx != -1) + { + adjust->move->old_to_new[oldidx] = movedidx; + adjust->move->new_to_old[movedidx] = oldidx; + } + if (movedidx <= ret) + ++ret; return ret; } } diff --git a/src/space.h b/src/space.h index 5d9973b..8f8402b 100644 --- a/src/space.h +++ b/src/space.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001 Red Hat, Inc. +/* Copyright (C) 2001, 2004 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -25,6 +25,7 @@ struct readonly_adjust int moveend; int move2; int newcount, *new; + struct section_move *move; }; void insert_readonly_section (GElf_Ehdr *ehdr, GElf_Shdr *shdr, int n, |