patch-2.2.0-pre2 linux/include/asm-i386/elf.h

Next file: linux/include/asm-i386/pgtable.h
Previous file: linux/include/asm-i386/byteorder.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.0-pre1/linux/include/asm-i386/elf.h linux/include/asm-i386/elf.h
@@ -32,8 +32,16 @@
    This provides a mean for the dynamic linker to call DT_FINI functions for
    shared libraries that have been loaded before the code runs.
 
-   A value of 0 tells we have no such handler.  */
-#define ELF_PLAT_INIT(_r)	_r->edx = 0
+   A value of 0 tells we have no such handler. 
+
+   We might as well make sure everything else is cleared too (except for %esp),
+   just to make things more deterministic.
+ */
+#define ELF_PLAT_INIT(_r)	do { \
+	_r->ebx = 0; _r->ecx = 0; _r->edx = 0; \
+	_r->esi = 0; _r->edi = 0; _r->ebp = 0; \
+	_r->eax = 0; \
+} while (0)
 
 #define USE_ELF_CORE_DUMP
 #define ELF_EXEC_PAGESIZE	4096

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov