diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-06-29 00:29:08 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-06-29 00:29:08 -0400 |
commit | 9f17413c753030811761d576fdb95f200bd818d7 (patch) | |
tree | c069c66819bb91df9bcfff9fb227528b96ae4395 /src | |
parent | 2cee45762a1e69444cd711a1a8112a401540081a (diff) | |
download | musl-9f17413c753030811761d576fdb95f200bd818d7.tar.gz musl-9f17413c753030811761d576fdb95f200bd818d7.tar.bz2 musl-9f17413c753030811761d576fdb95f200bd818d7.tar.xz musl-9f17413c753030811761d576fdb95f200bd818d7.zip |
textrel support, cheap and ugly
Diffstat (limited to 'src')
-rw-r--r-- | src/ldso/dynlink.c | 5 |
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; |