[GASPP,3/3] Don't skip negative offsets for ldr by default for armasm64

Message ID 1520326712-19031-3-git-send-email-martin@martin.st
State Committed
Headers show
Series
  • [GASPP,1/3] Document what versions were buggy and required GASPP_ARMASM64_INVERT_SCALE
Related show

Commit Message

Martin Storsjö March 6, 2018, 8:58 a.m.
The version of armasm64 in Visual Studio 2017 15.6 can assemble
these just fine.
---
 gas-preprocessor.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Janne Grunau March 14, 2018, 10:04 p.m. | #1
On 2018-03-06 10:58:32 +0200, Martin Storsjö wrote:
> The version of armasm64 in Visual Studio 2017 15.6 can assemble
> these just fine.
> ---
>  gas-preprocessor.pl | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
> index cb2f912..b0c909c 100755
> --- a/gas-preprocessor.pl
> +++ b/gas-preprocessor.pl
> @@ -973,8 +973,8 @@ sub handle_serialized_line {
>                  my $reg = $1;
>                  my $sym = $2;
>                  my $offset = eval_expr($3);
> -                if ($offset < 0) {
> -                    # armasm64 is buggy with ldr x0, =sym+offset where the
> +                if ($offset < 0 and $ENV{GASPP_ARMASM64_SKIP_NEG_OFFSET}) {
> +                    # armasm64 in VS < 15.6 is buggy with ldr x0, =sym+offset where the
>                      # offset is a negative value; it does write a negative
>                      # offset into the literal pool as it should, but the
>                      # negative offset only covers the lower 32 bit of the 64

ok

Janne

Patch

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index cb2f912..b0c909c 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -973,8 +973,8 @@  sub handle_serialized_line {
                 my $reg = $1;
                 my $sym = $2;
                 my $offset = eval_expr($3);
-                if ($offset < 0) {
-                    # armasm64 is buggy with ldr x0, =sym+offset where the
+                if ($offset < 0 and $ENV{GASPP_ARMASM64_SKIP_NEG_OFFSET}) {
+                    # armasm64 in VS < 15.6 is buggy with ldr x0, =sym+offset where the
                     # offset is a negative value; it does write a negative
                     # offset into the literal pool as it should, but the
                     # negative offset only covers the lower 32 bit of the 64