This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

patch to RTLD_START to avoid store data below $sp on MIPS


Hi everyone,
 
there is a store-data-below-stack-pointer case in RTLD_START in
sysdeps/mips/dl-machine.h. Is there any reason to be so?
 
If not, I'd like to propose a small fix for it. Valgrind has detected the
issue and reports an error in this region. With the change, it will not
report it.
 
Let me know what you think.
 
Thanks.
 
Regards,
Petar
 
diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h
index bc03785..5aabc88 100644
--- a/sysdeps/mips/dl-machine.h
+++ b/sysdeps/mips/dl-machine.h
@@ -266,8 +266,9 @@ 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\


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]