about summary refs log tree commit diff
path: root/src/ldso
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-06-29 00:29:08 -0400
committerRich Felker <dalias@aerifal.cx>2011-06-29 00:29:08 -0400
commit9f17413c753030811761d576fdb95f200bd818d7 (patch)
treec069c66819bb91df9bcfff9fb227528b96ae4395 /src/ldso
parent2cee45762a1e69444cd711a1a8112a401540081a (diff)
downloadmusl-9f17413c753030811761d576fdb95f200bd818d7.tar.gz
musl-9f17413c753030811761d576fdb95f200bd818d7.tar.xz
musl-9f17413c753030811761d576fdb95f200bd818d7.zip
textrel support, cheap and ugly
Diffstat (limited to 'src/ldso')
-rw-r--r--src/ldso/dynlink.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index 031e1f0f..465fe4cf 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -248,6 +248,11 @@ static void *map_library(int fd, size_t *lenp, unsigned char **basep, size_t *dy
 			}
 		}
 	}
+	for (i=0; ((size_t *)(base+dyn))[i]; i+=2)
+		if (((size_t *)(base+dyn))[i]==DT_TEXTREL) {
+			mprotect(map, map_len, PROT_READ|PROT_WRITE|PROT_EXEC);
+			break;
+		}
 	if (!runtime) reclaim_gaps(base, (void *)((char *)buf + eh->e_phoff),
 		eh->e_phentsize, eh->e_phnum);
 	*lenp = map_len;