public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Xi Ruoyao <xry111@xry111.site>
Cc: binutils@sourceware.org
Subject: Re: [PATCH v3] x86-64: Add -z mark-plt and -z nomark-plt
Date: Wed, 17 Jan 2024 08:12:11 -0800	[thread overview]
Message-ID: <CAMe9rOom+0P3-65-k0iPo1deC+jFwerm8GqJgOZeY301NXpa0w@mail.gmail.com> (raw)
In-Reply-To: <32f802c6a0c3e0fce9b12da29b98574f82ea6d1e.camel@xry111.site>

On Wed, Jan 17, 2024 at 3:02 AM Xi Ruoyao <xry111@xry111.site> wrote:
>
> Hi H.J.,
>
> When I test Binutils-2.41.90 I get 4 test failures regarding mark-plt:
>
> ./ld/ld.log:FAIL: ld-x86-64/mark-plt-1b
> ./ld/ld.log:FAIL: ld-x86-64/mark-plt-1d
> ./ld/ld.log:FAIL: ld-x86-64/mark-plt-1b-x32
> ./ld/ld.log:FAIL: ld-x86-64/mark-plt-1d-x32
>
> It seems related to --enable-default-hash-style=gnu: for mark-plt-1b
> with --hash-style=both I get the same dump as the .d file:
>
> 0000000000001010 <bar@plt>:
>     1010:       ff 25 32 11 00 00       jmp    *0x1132(%rip)        # 2148 <bar>
>     1016:       68 00 00 00 00          push   $0x0
>     101b:       e9 e0 ff ff ff          jmp    1000 <bar@plt-0x10>
>
> But with --hash-style=gnu:
>
> 0000000000001010 <bar@plt>:
>     1010:       ff 25 22 11 00 00       jmp    *0x1122(%rip)        # 2138 <bar>
>     1016:       68 00 00 00 00          push   $0x0
>     101b:       e9 e0 ff ff ff          jmp    1000 <bar@plt-0x10>
>
> The simplest "fix" would be adding --hash-style=both for these tests but
> I'm not sure if doing so is proper.
>
> On Thu, 2023-09-28 at 08:38 -0700, H.J. Lu via Binutils wrote:
> > diff --git a/ld/testsuite/ld-x86-64/mark-plt-1b.d b/ld/testsuite/ld-x86-64/mark-plt-1b.d
> > new file mode 100644
> > index 00000000000..dc046c031eb
> > --- /dev/null
> > +++ b/ld/testsuite/ld-x86-64/mark-plt-1b.d
> > @@ -0,0 +1,16 @@
> > +#source: mark-plt-1.s
> > +#as: --64
> > +#ld: -melf_x86_64 -shared -z mark-plt
> > +#objdump: -dw
> > +
> > +#...
> > +0+1010 <bar@plt>:
> > + +1010:      ff 25 32 11 00 00       jmp    \*0x1132\(%rip\)        # 2148 <bar>
> > + +1016:      68 00 00 00 00          push   \$0x0
> > + +101b:      e9 e0 ff ff ff          jmp    1000 <bar@plt-0x10>
> > +
> > +Disassembly of section .text:
> > +
> > +0+1020 <foo>:
> > + +1020:      e8 eb ff ff ff          call   1010 <bar@plt>
> > +#pass
>
> --
> Xi Ruoyao <xry111@xry111.site>
> School of Aerospace Science and Technology, Xidian University

Thanks for reporting it.  Fixed by:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=16666ccc91295d1568c5c2cb0e7600694840dfd9

-- 
H.J.

      reply	other threads:[~2024-01-17 16:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28 15:38 H.J. Lu
2024-01-17 11:02 ` Xi Ruoyao
2024-01-17 16:12   ` H.J. Lu [this message]

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=CAMe9rOom+0P3-65-k0iPo1deC+jFwerm8GqJgOZeY301NXpa0w@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=binutils@sourceware.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).