Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Jan 2016 00:56:42 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r293403 - head/libexec/rtld-elf
Message-ID:  <201601080056.u080ugYK019384@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Fri Jan  8 00:56:41 2016
New Revision: 293403
URL: https://svnweb.freebsd.org/changeset/base/293403

Log:
  Revert r293201, r293202 (rtld: populate DT_DEBUG iff DYNAMIC segment is writable)
  
  It turns out MIPS binaries may have other oddities that can trigger a
  fault at startup.
  
  PR:		206017
  Reported by:	ray

Modified:
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/rtld.h

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Fri Jan  8 00:46:28 2016	(r293402)
+++ head/libexec/rtld-elf/rtld.c	Fri Jan  8 00:56:41 2016	(r293403)
@@ -1144,13 +1144,13 @@ digest_dynamic1(Obj_Entry *obj, int earl
 	 * is mapped read-only. DT_MIPS_RLD_MAP is used instead.
 	 */
 
+#ifndef __mips__
 	case DT_DEBUG:
-	    if (!obj->writable_dynamic)
-		break;
 	    if (!early)
 		dbg("Filling in DT_DEBUG entry");
 	    ((Elf_Dyn*)dynp)->d_un.d_ptr = (Elf_Addr) &r_debug;
 	    break;
+#endif
 
 	case DT_FLAGS:
 		if (dynp->d_un.d_val & DF_ORIGIN)
@@ -1331,8 +1331,6 @@ digest_phdr(const Elf_Phdr *phdr, int ph
 	    break;
 
 	case PT_DYNAMIC:
-	    if (ph->p_flags & PROT_WRITE)
-		obj->writable_dynamic = true;
 	    obj->dynamic = (const Elf_Dyn *)(ph->p_vaddr + obj->relocbase);
 	    break;
 

Modified: head/libexec/rtld-elf/rtld.h
==============================================================================
--- head/libexec/rtld-elf/rtld.h	Fri Jan  8 00:46:28 2016	(r293402)
+++ head/libexec/rtld-elf/rtld.h	Fri Jan  8 00:56:41 2016	(r293403)
@@ -264,7 +264,6 @@ typedef struct Struct_Obj_Entry {
     bool valid_hash_sysv : 1;	/* A valid System V hash hash tag is available */
     bool valid_hash_gnu : 1;	/* A valid GNU hash tag is available */
     bool dlopened : 1;		/* dlopen()-ed (vs. load statically) */
-    bool writable_dynamic : 1;	/* PT_DYNAMIC is writable */
 
     struct link_map linkmap;	/* For GDB and dlinfo() */
     Objlist dldags;		/* Object belongs to these dlopened DAGs (%) */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601080056.u080ugYK019384>