[Bug gas/20364] Data-based padding causes current address evaluation to be non-constant on aarch64

2016-10-19 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=20364

--- Comment #5 from cvs-commit at gcc dot gnu.org  ---
The linaro_binutils-2_27-branch branch has been updated by Christophe Lyon
:

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

commit eb65c97589b3c6a5c2954cea45c068b30c751b51
Author: Nick Clifton 
Date:   Fri Aug 5 10:37:57 2016 +0100

Fix the generation of alignment frags in code sections for AArch64.

PR gas/20364
* config/tc-aarch64.c (s_ltorg): Change the mapping state after
aligning the frag.
(aarch64_init): Treat rs_align frags in code sections as
containing code, not data.
* testsuite/gas/aarch64/pr20364.s: New test.
* testsuite/gas/aarch64/pr20364.d: New test driver.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/20364] Data-based padding causes current address evaluation to be non-constant on aarch64

2016-08-07 Thread contact at paulk dot fr
https://sourceware.org/bugzilla/show_bug.cgi?id=20364

--- Comment #4 from Paul Kocialkowski  ---
Thanks for the explanation and the fix! It does solve the problem we had with
the ARM Trusted Firmware codebase. I'm glad it was merged, too.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/20364] Data-based padding causes current address evaluation to be non-constant on aarch64

2016-08-05 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20364

Nick Clifton  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Nick Clifton  ---
I have gone ahead and applied the patch.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/20364] Data-based padding causes current address evaluation to be non-constant on aarch64

2016-08-05 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=20364

--- Comment #2 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Nick Clifton :

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

commit 7ea12e5c3ad54da440c08f32da09534e63e515ca
Author: Nick Clifton 
Date:   Fri Aug 5 10:37:57 2016 +0100

Fix the generation of alignment frags in code sections for AArch64.

PR gas/20364
* config/tc-aarch64.c (s_ltorg): Change the mapping state after
aligning the frag.
(aarch64_init): Treat rs_align frags in code sections as
containing code, not data.
* testsuite/gas/aarch64/pr20364.s: New test.
* testsuite/gas/aarch64/pr20364.d: New test driver.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/20364] Data-based padding causes current address evaluation to be non-constant on aarch64

2016-08-02 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20364

Nick Clifton  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  ---
Created attachment 9419
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9419=edit
Proposed patch

Hi Paul,

  This is a subtle one.  What is happening is that ".align " in a code 
section (like .text or .vectors) will use the default NOP value to fill in
the space.  But ".align , " will use the provided fill value.  This
matters because the AArch64 backend knows that NOP is an instruction, but it
does not know about  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.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils