bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/20364] Data-based padding causes current address evaluation to


From: nickc at redhat dot com
Subject: [Bug gas/20364] Data-based padding causes current address evaluation to be non-constant on aarch64
Date: Tue, 02 Aug 2016 15:47:01 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=20364

Nick Clifton <nickc at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2016-08-02
                 CC|                            |nickc at redhat dot com
           Assignee|unassigned at sourceware dot org   |nickc at redhat dot com
     Ever confirmed|0                           |1

--- Comment #1 from Nick Clifton <nickc at redhat dot com> ---
Created attachment 9419
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9419&action=edit
Proposed patch

Hi Paul,

  This is a subtle one.  What is happening is that ".align <num>" in a code 
section (like .text or .vectors) will use the default NOP value to fill in
the space.  But ".align <num>, <fill>" will use the provided fill value.  This
matters because the AArch64 backend knows that NOP is an instruction, but it
does not know about <fill> and it assumes that it is a *data* value, not an
*instruction*.  So it changes the mapping state to MAP_DATA, creates a
mapping symbol ($d) indicate the change of state, and creates a new fragment
to contain the data.

  All of this means that when the macro parser tries to evaluate the .if
statement it finds that dot is one fragment and the symbol is in another 
fragment.  Since fragments can grow or shrink the distance between them 
cannot be computed reliably (at the time that the .if expressions is evaluated)
and so the assembler issues its error message.

  I have uploaded a small patch which I think will fix the problem.  It tells
the AArch64 backend not to assume that alignment directives in code sections
contain data.  Instead it should assume that they contain instructions, and
so not change the mapping state.  This causes a subtle problem with regard to
literal pools, but the patch takes care of that.

  Please give the patch a try and let me know how you get on.

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]