Do not store data below the stack pointer on MIPS.
authorPetar Jovanovic <petar.jovanovic@rt-rk.com>
Fri, 6 Jul 2012 19:12:21 +0000 (19:12 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 6 Jul 2012 19:12:21 +0000 (19:12 +0000)
ports/ChangeLog.mips
ports/sysdeps/mips/dl-machine.h

index 337ef43..de39d53 100644 (file)
@@ -1,3 +1,8 @@
+2012-07-06  Petar Jovanovic  <petar.jovanovic@rt-rk.com>
+
+       * sysdeps/mips/dl-machine.h (RTLD_START): Do not store data below
+       the stack pointer.
+
 2012-06-19  Joseph Myers  <joseph@codesourcery.com>
 
        * sysdeps/unix/sysv/linux/mips/mips32/nptl/ld.abilist: Update
index bc03785..cc7da76 100644 (file)
@@ -266,13 +266,14 @@ do {                                                                      \
        " STRINGXP(PTR_ADDU) " $7, $7, " STRINGXP (PTRSIZE) " \n\
        # Make sure the stack pointer is aligned for _dl_init_internal.\n\
        and $2, $29, -2 * " STRINGXP(SZREG) "\n\
-       " STRINGXP(PTR_S) " $29, -" STRINGXP(SZREG) "($2)\n\
+       move $8, $29\n\
        " STRINGXP(PTR_SUBIU) " $29, $2, 32\n\
+       " STRINGXP(PTR_S) " $8, (32 - " STRINGXP(SZREG) ")($29)\n\
        " STRINGXP(SAVE_GP(16)) "\n\
        # Call the function to run the initializers.\n\
        jal _dl_init_internal\n\
        # Restore the stack pointer for _start.\n\
-       " STRINGXP(PTR_L)  " $29, 32-" STRINGXP(SZREG) "($29)\n\
+       " STRINGXP(PTR_L)  " $29, (32 - " STRINGXP(SZREG) ")($29)\n\
        # Pass our finalizer function to the user in $2 as per ELF ABI.\n\
        " STRINGXP(PTR_LA) " $2, _dl_fini\n\
        # Jump to the user entry point.\n\