From: Roland McGrath Date: Wed, 16 Feb 2005 11:18:39 +0000 (+0000) Subject: 2005-01-07 Jakub Jelinek X-Git-Tag: cvs/fedora-glibc-2_3-20050216T1256~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b890a430990fb2018700ea9fcafeaf39b8b9c58;p=thirdparty%2Fglibc.git 2005-01-07 Jakub Jelinek [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. --- diff --git a/elf/dl-load.c b/elf/dl-load.c index eb1a7919fb8..3da3df7346b 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;