public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: "Petar Jovanovic" <petar.jovanovic@rt-rk.com>
To: <libc-ports@sourceware.org>
Subject: patch to RTLD_START to avoid store data below $sp on MIPS
Date: Wed, 04 Jul 2012 15:14:00 -0000	[thread overview]
Message-ID: <38131C9536FD498AA0679A54D87B1B96@domain.local> (raw)

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\

             reply	other threads:[~2012-07-04 15:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-04 15:14 Petar Jovanovic [this message]
2012-07-04 16:09 ` Joseph S. Myers
2012-07-04 16:30 ` Maciej W. Rozycki
2012-07-05 17:31   ` Petar Jovanovic
2012-07-05 18:54     ` Joseph S. Myers
2012-07-06 15:45       ` Petar Jovanovic
2012-07-06 19:13         ` Joseph S. Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38131C9536FD498AA0679A54D87B1B96@domain.local \
    --to=petar.jovanovic@rt-rk.com \
    --cc=libc-ports@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).