public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: YunQiang Su <syq@gcc.gnu.org>, Xi Ruoyao <xry111@xry111.site>
Cc: binutils@sourceware.org, macro@orcam.me.uk
Subject: Re: [PATCH] MIPS: support PCREL GOT access
Date: Mon, 5 Feb 2024 11:48:02 +0000	[thread overview]
Message-ID: <11a02e57-b292-4f1e-b879-a54ca08c2234@redhat.com> (raw)
In-Reply-To: <CAKcpw6UV_+H2Ow49TBd1XQ1Lv8jEk-vOuUNvM_66Xd+hZc983g@mail.gmail.com>

Hi YunQiang,

> Any idea how to write ld testcases?
> Normal readelf/objdump can only be sure that it is linked.
> I think that we need to execute the out objects to be sure that it has no
> problems, such as segfault etc.

You can use the [isnative] test to check to see if the test
is being run natively and then try executing the linked code.

For example in ld/testsuite/ld-elf/shared.exp there is the
following code to run a linked executable as part of the
mix_pic_and_non_pic procedure:

    if ![isnative] {
	unsupported "Run $exe fun undefined"
	return
     }

     set exec_output [run_host_cmd "tmpdir/$exe" ""]
     if {![string match "PASS" $exec_output]} {
	fail "Run $exe fun undefined"
     } else {
	pass "Run $exe fun undefined"
     }

Cheers
   Nick


  reply	other threads:[~2024-02-05 11:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31  8:32 YunQiang Su
2024-01-31  9:24 ` Xi Ruoyao
2024-02-02  1:25   ` YunQiang Su
2024-02-05 11:48     ` Nick Clifton [this message]
2024-02-05 12:59       ` Maciej W. Rozycki
2024-02-06 16:52         ` YunQiang Su
2024-02-06 19:47           ` Maciej W. Rozycki
2024-02-25 16:00             ` YunQiang Su
2024-03-01 17:38               ` Maciej W. Rozycki
2024-03-15 13:44                 ` YunQiang Su
2024-02-02  6:39 [PATCH] MIPS: Support " YunQiang Su
2024-02-02  6:42 ` YunQiang Su

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=11a02e57-b292-4f1e-b879-a54ca08c2234@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=macro@orcam.me.uk \
    --cc=syq@gcc.gnu.org \
    --cc=xry111@xry111.site \
    /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).