public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: Petar Jovanovic <petar.jovanovic@rt-rk.com>
Cc: "'Moore, Catherine'" <Catherine_Moore@mentor.com>,
	       'Matthew Fortune' <Matthew.Fortune@imgtec.com>,
	       gcc-patches@gcc.gnu.org
Subject: RE: [PATCH v2][MIPS] fix CRT_CALL_STATIC_FUNCTION macro
Date: Thu, 16 Apr 2015 18:23:00 -0000	[thread overview]
Message-ID: <alpine.LFD.2.11.1504161850320.2813@eddie.linux-mips.org> (raw)
In-Reply-To: <000501d07865$e26f2830$a74d7890$@rt-rk.com>

On Thu, 16 Apr 2015, Petar Jovanovic wrote:

> > There isn't any need to execute a large testcase.  Instead, try adding a
> short version of your test to the directory gcc/testsuite/gcc.target/mips.
> > There are examples of other tests there they check for specific assembler
> sequences by using scan-assembler.   See umips-swp-1.c (and others) for a
> specific example of how to do this.
> > Let me know if you need additional help.
> > Thanks,
> > Catherine
> 
> Hi Catherine,
> 
> Sorry for late response, I have missed to follow up on this.
> IIUC, scan-assembler will scan assembly file generated from a test file.
> This particular change will - on the other hand - modify crtend.o and thus
> init section. Is there a 'scan-assembler' functionality over a final linked
> executable, as that would actually test the change?

 You'd need `objdump' for doing that and there is no ready-to-use solution 
within the GCC test suite available, you'd have to cook something up 
yourself, perhaps starting with `[find_binutils_prog objdump]'.

 Another solution might be using an auxiliary linker script (`-Wl,-T,...' 
or maybe just an implicit linker script will do; see the LD manual for 
details) to place the sections the jump is made between apart manually at 
addresses appropriate for JAL to fail.  They span does not have to be 
large -- when placed correctly, even `JAL .' can jump to the wrong place, 
which is what LD is supposed to catch as a relocation error -- so a test 
executable successfully linked with your correction in place won't be 
large, it doesn't have to take more than 2 virtual pages.

 The downside of the latter solution are possible portability issues with 
the linker script.  You won't have to run your executable AFAICT from 
glibc BZ #17601 as you'll get a link error if a jump target is out of 
range.  So you could make it a mere link test, no need to run it.

  Maciej

  reply	other threads:[~2015-04-16 18:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <003e01d04179$ccc38bc0$664aa340$@rt-rk.com>
2015-02-05 20:51 ` Matthew Fortune
2015-02-06 10:43   ` Maciej W. Rozycki
2015-02-06 10:57     ` Matthew Fortune
2015-02-06 12:23       ` Maciej W. Rozycki
2015-02-06 17:27         ` Mike Stump
2015-02-06 17:41           ` Matthew Fortune
2015-02-06 18:03             ` Mike Stump
2015-02-06 19:19               ` Maciej W. Rozycki
2015-02-06 17:46           ` Maciej W. Rozycki
2015-02-06 15:12   ` Moore, Catherine
2015-02-13  0:28     ` Petar Jovanovic
2015-02-13  1:36       ` Moore, Catherine
2015-04-16 16:53         ` Petar Jovanovic
2015-04-16 18:23           ` Maciej W. Rozycki [this message]
2015-04-16 20:38             ` Moore, Catherine
     [not found] <6a22-55314b00-5-5cf51280@159592552>
2015-04-17 18:23 ` Petar Jovanovic
2015-04-17 18:35   ` Moore, Catherine
2015-04-21 18:05     ` Petar Jovanovic
2015-04-17 19:36 ` Maciej W. Rozycki

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=alpine.LFD.2.11.1504161850320.2813@eddie.linux-mips.org \
    --to=macro@linux-mips.org \
    --cc=Catherine_Moore@mentor.com \
    --cc=Matthew.Fortune@imgtec.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=petar.jovanovic@rt-rk.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).