about summary refs log tree commit diff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2014-03-12 15:58:39 -0700
committerPaul Pluzhnikov <ppluzhnikov@google.com>2014-03-12 15:58:39 -0700
commit798212a01311491d5e14fcda687460b75f8ca286 (patch)
tree97d78fbe6bd1a25dd6f1d181ae3a0efc90479d52 /elf/dl-load.c
parentabe6d90cc8c1c212dab7cde4468f9ed895d6ba86 (diff)
downloadglibc-798212a01311491d5e14fcda687460b75f8ca286.tar.gz
glibc-798212a01311491d5e14fcda687460b75f8ca286.tar.xz
glibc-798212a01311491d5e14fcda687460b75f8ca286.zip
2014-03-12 Paul Pluzhnikov <ppluzhnikov@google.com>
	[BZ #16381]

	* elf/Makefile (tests): Add tst-pie2.
        (tests-pie): Add tst-pie2.
	* elf/tst-pie2.c: New file.
	* elf/dl-load.c (_dl_map_object_from_fd): Assert correct l_type
	for ET_EXEC.
	* elf/rtld.c (map_doit): Load executable as lt_executable.
	(dl_main): Likewise.
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r--elf/dl-load.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 6501ff2dca..8ebc1285ea 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1534,8 +1534,8 @@ cannot enable executable stack as shared object requires");
   /* Signal that we closed the file.  */
   fd = -1;
 
-  if (l->l_type == lt_library && type == ET_EXEC)
-    l->l_type = lt_executable;
+  /* If this is ET_EXEC, we should have loaded it as lt_executable.  */
+  assert (type != ET_EXEC || l->l_type == lt_executable);
 
   l->l_entry += l->l_addr;