Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161718337
D4791.id11935.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D4791.id11935.diff
View Options
Index: libexec/rtld-elf/rtld.h
===================================================================
--- libexec/rtld-elf/rtld.h
+++ libexec/rtld-elf/rtld.h
@@ -264,6 +264,9 @@
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) */
+#ifdef __mips__
+ bool writable_dynamic : 1; /* PT_DYNAMIC is writable */
+#endif
struct link_map linkmap; /* For GDB and dlinfo() */
Objlist dldags; /* Object belongs to these dlopened DAGs (%) */
Index: libexec/rtld-elf/rtld.c
===================================================================
--- libexec/rtld-elf/rtld.c
+++ libexec/rtld-elf/rtld.c
@@ -1144,13 +1144,15 @@
* is mapped read-only. DT_MIPS_RLD_MAP is used instead.
*/
-#ifndef __mips__
case DT_DEBUG:
+#ifdef __mips__
+ if (!obj->writable_dynamic)
+ break;
+#endif
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,6 +1333,10 @@
break;
case PT_DYNAMIC:
+#ifdef __mips__
+ if (ph->p_flags & PROT_WRITE)
+ obj->writable_dynamic = 1;
+#endif
obj->dynamic = (const Elf_Dyn *)(ph->p_vaddr + obj->relocbase);
break;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jul 7, 5:24 AM (6 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34785790
Default Alt Text
D4791.id11935.diff (1 KB)
Attached To
Mode
D4791: RFC populate DT_DEBUG on MIPS if PT_DYNAMIC is writable
Attached
Detach File
Event Timeline
Log In to Comment