aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/exec.c20
-rw-r--r--src/main.c2
-rw-r--r--src/prelink.c2
3 files changed, 18 insertions, 6 deletions
diff --git a/src/exec.c b/src/exec.c
index 8389297..6182f73 100644
--- a/src/exec.c
+++ b/src/exec.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
@@ -259,6 +259,12 @@ prelink_exec (struct prelink_info *info)
assert (j == move->new_shnum);
ehdr.e_shnum = j;
+ if (old_sdynbss != -1 && old_dynbss == -1)
+ {
+ old_dynbss = old_sdynbss;
+ old_sdynbss = -1;
+ }
+
add = alloca ((rinfo.last - rinfo.first + 5) * sizeof (*add));
old = alloca ((rinfo.last - rinfo.first + 5) * sizeof (*old));
new = alloca ((rinfo.last - rinfo.first + 5) * sizeof (*new));
@@ -515,7 +521,9 @@ prelink_exec (struct prelink_info *info)
{
Elf_Data *data = elf_getdata (dso->scn[j], NULL);
- assert (data->d_size == dso->shdr[j].sh_size);
+ assert (data->d_size == dso->shdr[j].sh_size
+ || j == new_dynbss + 1
+ || j == new_sdynbss + 1);
if (data->d_size)
{
data->d_buf = realloc (data->d_buf, data->d_size);
@@ -766,7 +774,13 @@ prelink_exec (struct prelink_info *info)
dso->shdr[new_dynbss] = dso->shdr[new_dynbss + 1];
- dso->shdr[new_dynbss].sh_name = shstrtabadd (dso, ".dynbss");
+ if (! strcmp (strptr (dso, dso->ehdr.e_shstrndx,
+ dso->shdr[new_dynbss + 1].sh_name),
+ ".sbss")
+ && new_sdynbss == -1)
+ dso->shdr[new_dynbss].sh_name = shstrtabadd (dso, ".sdynbss");
+ else
+ dso->shdr[new_dynbss].sh_name = shstrtabadd (dso, ".dynbss");
if (dso->shdr[new_dynbss].sh_name == 0)
goto error_out;
diff --git a/src/main.c b/src/main.c
index b998a1e..8af4f90 100644
--- a/src/main.c
+++ b/src/main.c
@@ -228,7 +228,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
return 0;
}
-static struct argp argp = { options, parse_opt, 0, argp_doc };
+static struct argp argp = { options, parse_opt, "[FILES]", argp_doc };
int
main (int argc, char *argv[])
diff --git a/src/prelink.c b/src/prelink.c
index b7c9ef6..5b3c7c3 100644
--- a/src/prelink.c
+++ b/src/prelink.c
@@ -302,7 +302,6 @@ prelink_prepare (DSO *dso)
if (! liblist || ! libstr || ! undo)
{
- Elf_Data data;
struct section_move *move;
move = init_section_move (dso);
@@ -345,7 +344,6 @@ prelink_prepare (DSO *dso)
if (reopen_dso (dso, move))
{
- free (data.d_buf);
free (move);
return 1;
}