public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: binutils@sourceware.org
Subject: Re: Commit: Gas: Add .nop directive.
Date: Tue, 15 Sep 2020 10:53:58 +0100	[thread overview]
Message-ID: <f146d2aa-9ad4-8cf3-874f-dace880f2b57@redhat.com> (raw)
In-Reply-To: <7a474cb0-829e-8493-d49c-b9a5bc1c5440@redhat.com>

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

Hi Guys,

  The code to implement the .nop directive calls the md_assemble() function 
  with an allocated string, rather than input_line_pointer.  This is supposed
  to work, but there are some targets that assume that md_assemble()'s 
  argument is input_line_pointer, and that they are free to update it.  Even 
  worse some of them assign input_line_pointer to the string argument and
  leave it there.  So when s_nop() finishes and frees the string pointer,
  input_line_pointer is left pointing at freed memory.

  At first I though that it was just the S12Z port that behaved in this way
  but now I have found that the MN10300 port does too.  There may be others
  as well, since the symptom is hard to trace.  So I am applying the attached
  patch to fix s_nop() so that it explicitly preserves input_line_pointer
  instead.

Cheers
  Nick

gas/ChangeLog
2020-09-15  Nick Clifton  <nickc@redhat.com>

	* read.c (s_nop): Preserve the input_line_pointer around the call
	to md_assemble.
	* config/tc-s12z.c (md_assemble): Revert previous delta.

[-- Attachment #2: gas-nop-directive.patch.2 --]
[-- Type: application/x-troff-man, Size: 1383 bytes --]

  parent reply	other threads:[~2020-09-15  9:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.151032.1600097231.8982.binutils@sourceware.org>
2020-09-14 16:04 ` Michael Morrell
2020-09-14 16:31   ` Nick Clifton
2020-09-15  3:52     ` 2.35.1 (was: Commit: Gas: Add .nop directive.) Hans-Peter Nilsson
2020-09-15 10:31       ` Nick Clifton
2020-09-15 11:47         ` Hans-Peter Nilsson
2020-09-15 12:45           ` Nick Clifton
2020-09-15  9:53     ` Nick Clifton [this message]
2020-09-14 15:13 Commit: Gas: Add .nop directive Nick Clifton
2020-09-14 15:27 ` Jose E. Marchesi
2020-09-15 11:13   ` Nick Clifton
2020-09-15 11:57     ` Jose E. Marchesi
2020-09-14 15:38 ` Andreas Schwab
2020-09-14 16:02   ` Nick Clifton
2020-09-30 18:18 ` 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=f146d2aa-9ad4-8cf3-874f-dace880f2b57@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@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).