summaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2009-07-30 14:18:37 +0200
committerAndreas Schwab <schwab@redhat.com>2009-07-30 14:18:37 +0200
commitb870de510d54108c7c839abc17ea1559085e55a3 (patch)
treed59aca63c9713ac51b929e388187f6ec0bb1273e /elf
parentca2a37b64e0347b400e58da9ca238c9320a55edb (diff)
parent78c4ef475d47a2289635f74b726f52defedb4651 (diff)
Merge commit 'origin/master' into fedora/master
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-lookup.c13
-rw-r--r--elf/dl-reloc.c5
-rw-r--r--elf/dl-runtime.c8
3 files changed, 25 insertions, 1 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index 1d68d67a35..56724c9b4d 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -380,6 +380,10 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
if (size * 3 <= tab->n_elements * 4)
{
/* Expand the table. */
+#ifdef RTLD_CHECK_FOREIGN_CALL
+ /* This must not happen during runtime relocations. */
+ assert (!RTLD_CHECK_FOREIGN_CALL);
+#endif
size_t newsize = _dl_higher_prime_number (size + 1);
struct unique_sym *newentries
= calloc (sizeof (struct unique_sym), newsize);
@@ -405,6 +409,11 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
}
else
{
+#ifdef RTLD_CHECK_FOREIGN_CALL
+ /* This must not happen during runtime relocations. */
+ assert (!RTLD_CHECK_FOREIGN_CALL);
+#endif
+
#define INITIAL_NUNIQUE_SYM_TABLE 31
size = INITIAL_NUNIQUE_SYM_TABLE;
entries = calloc (sizeof (struct unique_sym), size);
@@ -600,6 +609,10 @@ add_dependency (struct link_map *undef_map, struct link_map *map, int flags)
unsigned int max
= undef_map->l_reldepsmax ? undef_map->l_reldepsmax * 2 : 10;
+#ifdef RTLD_PREPARE_FOREIGN_CALL
+ RTLD_PREPARE_FOREIGN_CALL;
+#endif
+
newp = malloc (sizeof (*newp) + max * sizeof (struct link_map *));
if (newp == NULL)
{
diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
index 28f08de3e7..680caadd65 100644
--- a/elf/dl-reloc.c
+++ b/elf/dl-reloc.c
@@ -61,7 +61,10 @@ _dl_try_allocate_static_tls (struct link_map *map)
size_t n;
size_t blsize;
- freebytes = GL(dl_tls_static_size) - GL(dl_tls_static_used) - TLS_TCB_SIZE;
+ freebytes = GL(dl_tls_static_size) - GL(dl_tls_static_used);
+ if (freebytes < TLS_TCB_SIZE)
+ goto fail;
+ freebytes -= TLS_TCB_SIZE;
blsize = map->l_tls_blocksize + map->l_tls_firstbyte_offset;
if (freebytes < blsize)
diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c
index 0eb7d4e3b9..a52120d121 100644
--- a/elf/dl-runtime.c
+++ b/elf/dl-runtime.c
@@ -111,6 +111,10 @@ _dl_fixup (
flags |= DL_LOOKUP_GSCOPE_LOCK;
}
+#ifdef RTLD_ENABLE_FOREIGN_CALL
+ RTLD_ENABLE_FOREIGN_CALL;
+#endif
+
result = _dl_lookup_symbol_x (strtab + sym->st_name, l, &sym, l->l_scope,
version, ELF_RTYPE_CLASS_PLT, flags, NULL);
@@ -118,6 +122,10 @@ _dl_fixup (
if (!RTLD_SINGLE_THREAD_P)
THREAD_GSCOPE_RESET_FLAG ();
+#ifdef RTLD_FINALIZE_FOREIGN_CALL
+ RTLD_FINALIZE_FOREIGN_CALL;
+#endif
+
/* Currently result contains the base load address (or link map)
of the object that defines sym. Now add in the symbol
offset. */