SHA256
1
0
forked from pool/glibc
glibc/glibc-2.14-fix-ctors.patch

31 lines
729 B
Diff

Index: glibc-2.14/elf/soinit.c
===================================================================
--- glibc-2.14.orig/elf/soinit.c
+++ glibc-2.14/elf/soinit.c
@@ -26,7 +26,11 @@ void
__libc_global_ctors (void)
{
/* Call constructor functions. */
- run_hooks (__CTOR_LIST__);
+ void (**tem)();
+ asm ("" : "=r" (tem) : "0" (__CTOR_LIST__));
+ /* Call destructor functions. */
+
+ run_hooks (tem);
}
@@ -36,7 +40,11 @@ void
__libc_fini (void)
{
/* Call destructor functions. */
- run_hooks (__DTOR_LIST__);
+ void (**tem)();
+ asm ("" : "=r" (tem) : "0" (__DTOR_LIST__));
+ /* Call destructor functions. */
+
+ run_hooks (tem);
}
void (*_fini_ptr) (void) __attribute__ ((section (".fini_array")))