summaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2005-02-16 11:18:39 +0000
committerRoland McGrath <roland@gnu.org>2005-02-16 11:18:39 +0000
commit2b890a430990fb2018700ea9fcafeaf39b8b9c58 (patch)
tree487e5b7c8981444ab95a6296d627f4a4618332fd /elf
parent5944209b613e1e262d01de6a850fa17e7072afc0 (diff)
2005-01-07 Jakub Jelinek <jakub@redhat.com>
[BZ #738] * elf/dl-load.c (open_path): If rtld_search_dirs is in RELRO segment, avoid writing to it if none of the standard search directories exist.
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-load.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index eb1a7919fb..3da3df7346 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1788,7 +1788,12 @@ open_path (const char *name, size_t namelen, int preloaded,
must not be freed using the general free() in libc. */
if (sps->malloced)
free (sps->dirs);
- sps->dirs = (void *) -1;
+#ifdef HAVE_Z_RELRO
+ /* rtld_search_dirs is attribute_relro, therefore avoid writing
+ into it. */
+ if (sps != &rtld_search_dirs)
+#endif
+ sps->dirs = (void *) -1;
}
return -1;