public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: "Petar Jovanovic" <petar.jovanovic@rt-rk.com>
To: "'Joseph Myers'" <joseph@codesourcery.com>
Cc: "'Maciej W. Rozycki'" <macro@codesourcery.com>,
	<libc-ports@sourceware.org>
Subject: RE: patch to RTLD_START to avoid store data below $sp on MIPS
Date: Fri, 06 Jul 2012 15:45:00 -0000	[thread overview]
Message-ID: <2AEC5E6F36A1494EA8C5EFFB09D00F15@domain.local> (raw)
In-Reply-To: <Pine.LNX.4.64.1207051853260.13568@digraph.polyomino.org.uk>

[-- Attachment #1: Type: text/plain, Size: 774 bytes --]

Sure, it is attached.

Regards,
Petar

-----Original Message-----
From: Joseph Myers [mailto:joseph@codesourcery.com] 
Sent: Thursday, July 05, 2012 8:54 PM
To: Petar Jovanovic
Cc: 'Maciej W. Rozycki'; libc-ports@sourceware.org
Subject: RE: patch to RTLD_START to avoid store data below $sp on MIPS

On Thu, 5 Jul 2012, Petar Jovanovic wrote:

> @Joseph
> I did try it out on o32 platform, this is how I know Valgrind will not
> report error with that change. I have not run any test suite.
> 
> @Maciej
> You are right, additional spaces and brackets will look nicer.

Could you send a patch updated to take account of Maciej's comments?  I 
can then do some testing for all three ABIs before putting it in if it 
tests out OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

[-- Attachment #2: dl-machine-patch.diff --]
[-- Type: application/octet-stream, Size: 1143 bytes --]

diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h
index bc03785..cc7da76 100644
--- a/sysdeps/mips/dl-machine.h
+++ b/sysdeps/mips/dl-machine.h
@@ -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\

  reply	other threads:[~2012-07-06 15:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-04 15:14 Petar Jovanovic
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 [this message]
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=2AEC5E6F36A1494EA8C5EFFB09D00F15@domain.local \
    --to=petar.jovanovic@rt-rk.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-ports@sourceware.org \
    --cc=macro@codesourcery.com \
    /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).