summaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-10-20 06:59:57 +0000
committerJakub Jelinek <jakub@redhat.com>2005-10-20 06:59:57 +0000
commitb7071f6fc41f4c20510de3683f39e5c8ea8a2e1e (patch)
tree852f4f1992a3c9ecbb44b822df6702c7e635fc5a /elf
parentacfebba27b162b3064c616142883541eaef3f725 (diff)
Updated to fedora-glibc-20051020T0651
Diffstat (limited to 'elf')
-rw-r--r--elf/Makefile8
-rw-r--r--elf/cache.c3
-rw-r--r--elf/dl-load.c22
3 files changed, 18 insertions, 15 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 123b448ff1..91fb218ccd 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -223,6 +223,10 @@ extra-objs += $(addsuffix .os,$(strip $(modules-names)))
# We need this variable to be sure the test modules get the right CPPFLAGS.
test-extras += $(modules-names)
+# filtmod1.so has a special rule
+modules-names-nobuild := filtmod1
+
+
include ../Rules
check-abi: check-abi-ld
@@ -490,10 +494,6 @@ reldep9mod1.so-no-z-defs = yes
unload3mod4.so-no-z-defs = yes
unload4mod1.so-no-z-defs = yes
-# filtmod1.so has a special rule
-$(filter-out $(objpfx)filtmod1.so, $(test-modules)): $(objpfx)%.so: $(objpfx)%.os
- $(build-module)
-
ifeq ($(build-shared),yes)
# Build all the modules even when not actually running test programs.
tests: $(test-modules)
diff --git a/elf/cache.c b/elf/cache.c
index 9324f3dc6c..d5f313657c 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -108,7 +108,8 @@ print_entry (const char *lib, int flag, unsigned int osversion,
[1] = "Hurd",
[2] = "Solaris",
[3] = "FreeBSD",
- [4] = N_("Unknown OS")
+ [4] = "kNetBSD",
+ [5] = N_("Unknown OS")
};
#define MAXTAG (sizeof abi_tag_os / sizeof abi_tag_os[0] - 1)
unsigned int os = osversion >> 24;
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 0ed670d158..bba1c83ba0 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -50,15 +50,17 @@
overwritten. Some losing VM systems like Linux's lack MAP_COPY. All we
get is MAP_PRIVATE, which copies each page when it is modified; this
means if the file is overwritten, we may at some point get some pages
- from the new version after starting with pages from the old version. */
-#ifndef MAP_COPY
-# define MAP_COPY MAP_PRIVATE
-#endif
+ from the new version after starting with pages from the old version.
-/* We want to prevent people from modifying DSOs which are currently in
- use. This is what MAP_DENYWRITE is for. */
-#ifndef MAP_DENYWRITE
-# define MAP_DENYWRITE 0
+ To make up for the lack and avoid the overwriting problem,
+ what Linux does have is MAP_DENYWRITE. This prevents anyone
+ from modifying the file while we have it mapped. */
+#ifndef MAP_COPY
+# ifdef MAP_DENYWRITE
+# define MAP_COPY (MAP_PRIVATE | MAP_DENYWRITE)
+# else
+# define MAP_COPY MAP_PRIVATE
+# endif
#endif
/* Some systems link their relocatable objects for another base address
@@ -1181,7 +1183,7 @@ cannot allocate TLS data structures for initial thread");
/* Remember which part of the address space this object uses. */
l->l_map_start = (ElfW(Addr)) __mmap ((void *) mappref, maplength,
c->prot,
- MAP_COPY|MAP_FILE|MAP_DENYWRITE,
+ MAP_COPY|MAP_FILE,
fd, c->mapoff);
if (__builtin_expect ((void *) l->l_map_start == MAP_FAILED, 0))
{
@@ -1229,7 +1231,7 @@ cannot allocate TLS data structures for initial thread");
/* Map the segment contents from the file. */
&& (__mmap ((void *) (l->l_addr + c->mapstart),
c->mapend - c->mapstart, c->prot,
- MAP_FIXED|MAP_COPY|MAP_FILE|MAP_DENYWRITE,
+ MAP_FIXED|MAP_COPY|MAP_FILE,
fd, c->mapoff)
== MAP_FAILED))
goto map_error;