about summary refs log tree commit diff
path: root/src/ldso/dynlink.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-04-13 22:38:18 -0400
committerRich Felker <dalias@aerifal.cx>2015-04-13 22:38:18 -0400
commitf4f9562cc963181ca0ea04fbe6d31f4ca14a5d8c (patch)
tree8dc04782f4be80d2b1e289cc07817be187123871 /src/ldso/dynlink.c
parent1ef849c6ec6a4e30badc844371cdf1b9eedfba57 (diff)
downloadmusl-f4f9562cc963181ca0ea04fbe6d31f4ca14a5d8c.tar.gz
musl-f4f9562cc963181ca0ea04fbe6d31f4ca14a5d8c.tar.xz
musl-f4f9562cc963181ca0ea04fbe6d31f4ca14a5d8c.zip
remove initializers for decoded aux/dyn arrays in dynamic linker
the zero initialization is redundant since decode_vec does its own
clearing, and it increases the risk that buggy compilers will generate
calls to memset. as long as symbols are bound at ld time, such a call
will not break anything, but it may be desirable to turn off ld-time
binding in the future.
Diffstat (limited to 'src/ldso/dynlink.c')
-rw-r--r--src/ldso/dynlink.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index 8b15daa2..46183ce7 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -636,7 +636,7 @@ static int fixup_rpath(struct dso *p, char *buf, size_t buf_size)
 
 static void decode_dyn(struct dso *p)
 {
-	size_t dyn[DYN_CNT] = {0};
+	size_t dyn[DYN_CNT];
 	decode_vec(p->dynv, dyn, DYN_CNT);
 	p->syms = (void *)(p->base + dyn[DT_SYMTAB]);
 	p->strings = (void *)(p->base + dyn[DT_STRTAB]);
@@ -901,7 +901,7 @@ static void do_mips_relocs(struct dso *p, size_t *got)
 
 static void reloc_all(struct dso *p)
 {
-	size_t dyn[DYN_CNT] = {0};
+	size_t dyn[DYN_CNT];
 	for (; p; p=p->next) {
 		if (p->relocated) continue;
 		decode_vec(p->dynv, dyn, DYN_CNT);
@@ -949,7 +949,7 @@ static void kernel_mapped_dso(struct dso *p)
 static void do_fini()
 {
 	struct dso *p;
-	size_t dyn[DYN_CNT] = {0};
+	size_t dyn[DYN_CNT];
 	for (p=fini_head; p; p=p->fini_next) {
 		if (!p->constructed) continue;
 		decode_vec(p->dynv, dyn, DYN_CNT);
@@ -967,7 +967,7 @@ static void do_fini()
 
 static void do_init_fini(struct dso *p)
 {
-	size_t dyn[DYN_CNT] = {0};
+	size_t dyn[DYN_CNT];
 	int need_locking = libc.threads_minus_1;
 	/* Allow recursive calls that arise when a library calls
 	 * dlopen from one of its constructors, but block any
@@ -1145,7 +1145,7 @@ void __dls2(unsigned char *base)
 _Noreturn void __dls3(size_t *sp)
 {
 	static struct dso app, vdso;
-	size_t aux[AUX_CNT] = {0}, *auxv;
+	size_t aux[AUX_CNT], *auxv;
 	size_t i;
 	char *env_preload=0;
 	size_t vdso_base;