about summary refs log tree commit diff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-01-13 08:36:54 +0000
committerUlrich Drepper <drepper@redhat.com>2004-01-13 08:36:54 +0000
commited20b3d9cc5ce78fd71f32c47b2eb7a897c7a25d (patch)
treec4ea660173f2c8cc138e8f0f1c64055a156c5036 /elf/dl-load.c
parent1c563add69af03557ba47a4a13790d821133478c (diff)
downloadglibc-ed20b3d9cc5ce78fd71f32c47b2eb7a897c7a25d.tar.gz
glibc-ed20b3d9cc5ce78fd71f32c47b2eb7a897c7a25d.tar.xz
glibc-ed20b3d9cc5ce78fd71f32c47b2eb7a897c7a25d.zip
Update.
2004-01-13  Ulrich Drepper  <drepper@redhat.com>

	* Makeconfig: Define relro-LDFLAGS if have-z-relro==yes.  Add it to
	LDFLAGS.so and LDFLAGS-rtld.
	(+link): Add relro-LDFLAGS.
	* Makeconfig (shlib.lds): Place __libc_subfreeres, __libc_atexit, and
	__libc_thread_subfreeres sections after .jcr section.
	* config.make.in: Add have-z-relro.
	* configure.in: Add check for -z relro option.
	* include/link.h (struct link_map): Add relro_addr and relro_size
	members.
	* elf/dl-load.c (_dl_map_object_from_fd): Recognize PT_GNU_RELRO.
	* elf/dl-reloc.c (_dl_relocate_object): At the end, make relro
	part of loaded segments read-only.
	* elf/elf.h: Define PT_GNU_RELRO.
	* elf/rtld.c (_dl_start): Recognize PT_GNU_RELRO of ld.so.
	(dl_main): Recognize PT_GNU_RELRO of the application.  Call
	_dl_debug_initialize and initialize l_info[DT_DEBUG] before
	relocations.
Diffstat (limited to 'elf/dl-load.c')
-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 c7e3716cb6..dc993a5894 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1,5 +1,5 @@
 /* Map in a shared object's segments from the file.
-   Copyright (C) 1995-2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1995-2002, 2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -1065,6 +1065,11 @@ cannot allocate TLS data structures for initial thread");
 	case PT_GNU_STACK:
 	  stack_flags = ph->p_flags;
 	  break;
+
+	case PT_GNU_RELRO:
+	  l->l_relro_addr = ph->p_vaddr;
+	  l->l_relro_size = ph->p_memsz;
+	  break;
 	}
 
     if (__builtin_expect (nloadcmds == 0, 0))