[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/20364] Data-based padding causes current address evaluation to
nickc at redhat dot com
[Bug gas/20364] Data-based padding causes current address evaluation to be non-constant on aarch64
Tue, 02 Aug 2016 15:47:01 +0000
Nick Clifton <nickc at redhat dot com> changed:
What |Removed |Added
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
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.
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gas/20364] Data-based padding causes current address evaluation to be non-constant on aarch64,
nickc at redhat dot com <=