diff options
author | emaste <emaste@FreeBSD.org> | 2016-01-08 00:56:41 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2016-01-08 00:56:41 +0000 |
commit | 202862da9c3d0c9d9447745fb02b22623440fb40 (patch) | |
tree | aa1f93f8e69ad6f45b75fe3898ca7fffdf1cd690 /libexec/rtld-elf | |
parent | 4f30c1fb307d367f8f223d9b53f276eda15e4ac1 (diff) | |
download | FreeBSD-src-202862da9c3d0c9d9447745fb02b22623440fb40.zip FreeBSD-src-202862da9c3d0c9d9447745fb02b22623440fb40.tar.gz |
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
Diffstat (limited to 'libexec/rtld-elf')
-rw-r--r-- | libexec/rtld-elf/rtld.c | 6 | ||||
-rw-r--r-- | libexec/rtld-elf/rtld.h | 1 |
2 files changed, 2 insertions, 5 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 424f2ea..ad5d359 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1144,13 +1144,13 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_Dyn **dyn_rpath, * 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 phnum, caddr_t entry, const char *path) 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; diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index f151db0..72a632e 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -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 (%) */ |