summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2019-03-03 12:42:34 -0500
committerRich Felker <dalias@aerifal.cx>2019-03-03 12:45:23 -0500
commitf034f145bdf7541995eaf08451275329e09694d8 (patch)
tree329c98135f75ca7a72428b15e1ae2f7b9b29e06c /ldso
parente612d094b1d27e1d61940e58d8aaeb249c54e768 (diff)
downloadmusl-f034f145bdf7541995eaf08451275329e09694d8.tar.gz
avoid malloc of deps arrays for ldso and vdso
neither has or can have any dependencies, but since commit 403555690775f7c8806372644f543518e6664e3b, gratuitous zero-length deps arrays were being allocated for them. use a dummy array instead.
Diffstat (limited to 'ldso')
-rw-r--r--ldso/dynlink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ldso/dynlink.c b/ldso/dynlink.c
index 255ace2d..4f090ada 100644
--- a/ldso/dynlink.c
+++ b/ldso/dynlink.c
@@ -134,6 +134,7 @@ static size_t static_tls_cnt;
static pthread_mutex_t init_fini_lock;
static pthread_cond_t ctor_cond;
static struct dso *builtin_deps[2];
+static struct dso *const no_deps[1];
static struct dso **main_ctor_queue;
static struct fdpic_loadmap *app_loadmap;
static struct fdpic_dummy_loadmap app_dummy_loadmap;
@@ -1820,6 +1821,7 @@ _Noreturn void __dls3(size_t *sp)
reclaim_gaps(&ldso);
/* Load preload/needed libraries, add symbols to global namespace. */
+ ldso.deps = (struct dso **)no_deps;
if (env_preload) load_preload(env_preload);
load_deps(&app);
for (struct dso *p=head; p; p=p->next)
@@ -1841,6 +1843,7 @@ _Noreturn void __dls3(size_t *sp)
vdso.name = "";
vdso.shortname = "linux-gate.so.1";
vdso.relocated = 1;
+ vdso.deps = (struct dso **)no_deps;
decode_dyn(&vdso);
vdso.prev = tail;
tail->next = &vdso;