aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/dso.c6
-rw-r--r--src/exec.c6
-rw-r--r--src/layout.c9
-rw-r--r--src/layout.h4
-rw-r--r--src/prelink.c3
-rw-r--r--src/prelink.h7
-rw-r--r--src/space.c3
-rw-r--r--src/stabs.c6
8 files changed, 38 insertions, 6 deletions
diff --git a/src/dso.c b/src/dso.c
index 8a9512e..20ee44f 100644
--- a/src/dso.c
+++ b/src/dso.c
@@ -102,6 +102,11 @@ read_dynamic (DSO *dso)
dso->info_set_mask |= (1ULL << DT_AUXILIARY_BIT);
else if (dyn.d_tag == DT_LOPROC)
dso->info_set_mask |= (1ULL << DT_LOPROC_BIT);
+ else if (dyn.d_tag == DT_GNU_HASH)
+ {
+ dso->info_DT_GNU_HASH = dyn.d_un.d_val;
+ dso->info_set_mask |= (1ULL << DT_GNU_HASH_BIT);
+ }
}
if (ndx < maxndx)
break;
@@ -1361,6 +1366,7 @@ adjust_dso (DSO *dso, GElf_Addr start, GElf_Addr adjust)
return 1;
break;
case SHT_HASH:
+ case SHT_GNU_HASH:
case SHT_NOBITS:
case SHT_STRTAB:
break;
diff --git a/src/exec.c b/src/exec.c
index 515283b..7c8f38f 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -61,7 +61,11 @@ update_dynamic_tags (DSO *dso, GElf_Shdr *shdr, GElf_Shdr *old_shdr,
|| (dynamic_info_is_set (dso, DT_VERSYM_BIT)
&& dso->info_DT_VERSYM == old_shdr[j].sh_addr
&& old_shdr[j].sh_type == SHT_GNU_versym
- && set_dynamic (dso, DT_VERSYM, shdr[i].sh_addr, 1)))
+ && set_dynamic (dso, DT_VERSYM, shdr[i].sh_addr, 1))
+ || (dynamic_info_is_set (dso, DT_GNU_HASH_BIT)
+ && dso->info_DT_GNU_HASH == old_shdr[j].sh_addr
+ && old_shdr[j].sh_type == SHT_GNU_HASH
+ && set_dynamic (dso, DT_GNU_HASH, shdr[i].sh_addr, 1)))
return 1;
}
diff --git a/src/layout.c b/src/layout.c
index ce624df..9292425 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2004, 2006 Red Hat, Inc.
Written by Jakub Jelinek <jakub@redhat.com>, 2001.
This program is free software; you can redistribute it and/or modify
@@ -86,6 +86,12 @@ find_libs (void **p, void *info)
e->done = 0;
if (e->type == ET_CACHE_DYN || e->type == ET_CACHE_EXEC)
e->done = 2;
+ if (e->base & (l->max_page_size - 1))
+ {
+ e->done = 0;
+ e->end -= e->base;
+ e->base = 0;
+ }
return 1;
}
@@ -247,6 +253,7 @@ layout_libs (void)
l.flags = arches[arch];
l.libs = plibs;
l.binlibs = pbinlibs;
+ l.max_page_size = plarch->max_page_size;
htab_traverse (prelink_filename_htab, find_libs, &l);
max_page_size = plarch->max_page_size;
diff --git a/src/layout.h b/src/layout.h
index 666d83b..f481d22 100644
--- a/src/layout.h
+++ b/src/layout.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2004 Red Hat, Inc.
+/* Copyright (C) 2001, 2004, 2006 Red Hat, Inc.
Written by Jakub Jelinek <jakub@redhat.com>, 2001.
This program is free software; you can redistribute it and/or modify
@@ -24,7 +24,7 @@ struct layout_libs
struct prelink_entry **binlibs;
struct prelink_entry *list;
struct prelink_entry *fake;
- GElf_Addr mmap_base, mmap_start, mmap_fin, mmap_end;
+ GElf_Addr mmap_base, mmap_start, mmap_fin, mmap_end, max_page_size;
void *arch_data;
int flags;
int nlibs;
diff --git a/src/prelink.c b/src/prelink.c
index 7df2a1b..a828440 100644
--- a/src/prelink.c
+++ b/src/prelink.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Red Hat, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Red Hat, Inc.
Written by Jakub Jelinek <jakub@redhat.com>, 2001.
This program is free software; you can redistribute it and/or modify
@@ -424,6 +424,7 @@ prelink_prepare (DSO *dso)
switch (dso->shdr[i].sh_type)
{
case SHT_HASH:
+ case SHT_GNU_HASH:
case SHT_DYNSYM:
case SHT_REL:
case SHT_RELA:
diff --git a/src/prelink.h b/src/prelink.h
index 9eb2b81..17d34fc 100644
--- a/src/prelink.h
+++ b/src/prelink.h
@@ -44,6 +44,11 @@
#define SHT_GNU_LIBLIST 0x6ffffff7
#endif
+#ifndef DT_GNU_HASH
+#define DT_GNU_HASH 0x6ffffef5
+#define SHT_GNU_HASH 0x6ffffff6
+#endif
+
struct prelink_entry;
struct prelink_info;
struct PLArch;
@@ -75,6 +80,7 @@ typedef struct
GElf_Addr info_DT_GNU_PRELINKED;
GElf_Addr info_DT_CHECKSUM;
GElf_Addr info_DT_VERNEED, info_DT_VERDEF, info_DT_VERSYM;
+ GElf_Addr info_DT_GNU_HASH;
#define DT_GNU_PRELINKED_BIT 50
#define DT_CHECKSUM_BIT 51
#define DT_VERNEED_BIT 52
@@ -83,6 +89,7 @@ typedef struct
#define DT_FILTER_BIT 55
#define DT_AUXILIARY_BIT 56
#define DT_LOPROC_BIT 57
+#define DT_GNU_HASH_BIT 58
uint64_t info_set_mask;
int fd, fdro;
int lastscn, dynamic;
diff --git a/src/space.c b/src/space.c
index ab8e0c4..155feba 100644
--- a/src/space.c
+++ b/src/space.c
@@ -60,6 +60,7 @@ print_sections (DSO *dso, GElf_Ehdr *ehdr, GElf_Shdr *shdr)
{ SHT_GNU_verneed, "VERNEED" },
{ SHT_GNU_versym, "VERSYM" },
{ SHT_GNU_LIBLIST, "LIBLIST" },
+ { SHT_GNU_HASH, "GNU_HASH" },
{ 0, NULL }
};
@@ -181,6 +182,7 @@ readonly_is_movable (DSO *dso, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int k)
switch (shdr[k].sh_type)
{
case SHT_HASH:
+ case SHT_GNU_HASH:
case SHT_DYNSYM:
case SHT_REL:
case SHT_RELA:
@@ -527,6 +529,7 @@ find_readonly_space (DSO *dso, GElf_Shdr *add, GElf_Ehdr *ehdr,
switch (shdr[j].sh_type)
{
case SHT_HASH:
+ case SHT_GNU_HASH:
case SHT_DYNSYM:
case SHT_STRTAB:
case SHT_GNU_verdef:
diff --git a/src/stabs.c b/src/stabs.c
index 6420fc9..c0a5a6a 100644
--- a/src/stabs.c
+++ b/src/stabs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2005 Red Hat, Inc.
+/* Copyright (C) 2001, 2005, 2006 Red Hat, Inc.
Written by Jakub Jelinek <jakub@redhat.com>, 2001.
This program is free software; you can redistribute it and/or modify
@@ -30,6 +30,7 @@
#define N_STSYM 0x26
#define N_LCSYM 0x28
#define N_MAIN 0x2a
+#define N_BNSYM 0x2e
#define N_PC 0x30
#define N_NSYMS 0x32
#define N_NOMAP 0x34
@@ -42,6 +43,7 @@
#define N_BSLINE 0x48
#define N_BROWS 0x48
#define N_DEFD 0x4a
+#define N_ENSYM 0x4e
#define N_EHDECL 0x50
#define N_MOD2 0x50
#define N_CATCH 0x54
@@ -143,6 +145,8 @@ adjust_stabs (DSO *dso, int n, GElf_Addr start, GElf_Addr adjust)
case N_CATCH:
case N_SO:
case N_SOL:
+ case N_BNSYM:
+ case N_ENSYM:
value = read_32 (data->d_buf + off + 8);
sec = addr_to_sec (dso, value);
if (sec != -1)