summaryrefslogtreecommitdiff
path: root/src/ldso/dynlink.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-06-17 17:21:46 +0000
committerRich Felker <dalias@aerifal.cx>2015-06-17 17:21:46 +0000
commit75eceb3ae824d54e865686c0c538551aeebf3372 (patch)
treee6b3b7c367af9a1040c4f06161e957b050d1370e /src/ldso/dynlink.c
parent10d0268ccfab9152250eeeed3952ce3fed44131a (diff)
downloadmusl-75eceb3ae824d54e865686c0c538551aeebf3372.tar.gz
musl-75eceb3ae824d54e865686c0c538551aeebf3372.tar.bz2
musl-75eceb3ae824d54e865686c0c538551aeebf3372.tar.xz
musl-75eceb3ae824d54e865686c0c538551aeebf3372.zip
ignore ENOSYS error from mprotect in pthread_create and dynamic linker
this error simply indicated a system without memory protection (NOMMU) and should not cause failure in the caller.
Diffstat (limited to 'src/ldso/dynlink.c')
-rw-r--r--src/ldso/dynlink.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index 71252d03..7e566933 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -536,7 +536,8 @@ static void *map_library(int fd, struct dso *dso)
}
for (i=0; ((size_t *)(base+dyn))[i]; i+=2)
if (((size_t *)(base+dyn))[i]==DT_TEXTREL) {
- if (mprotect(map, map_len, PROT_READ|PROT_WRITE|PROT_EXEC) < 0)
+ if (mprotect(map, map_len, PROT_READ|PROT_WRITE|PROT_EXEC)
+ && errno != ENOSYS)
goto error;
break;
}
@@ -927,7 +928,8 @@ static void reloc_all(struct dso *p)
do_relocs(p, (void *)(p->base+dyn[DT_RELA]), dyn[DT_RELASZ], 3);
if (head != &ldso && p->relro_start != p->relro_end &&
- mprotect(p->base+p->relro_start, p->relro_end-p->relro_start, PROT_READ) < 0) {
+ mprotect(p->base+p->relro_start, p->relro_end-p->relro_start, PROT_READ)
+ && errno != ENOSYS) {
error("Error relocating %s: RELRO protection failed: %m",
p->name);
if (runtime) longjmp(*rtld_fail, 1);