Browse Source

* improve module local data accesses by avoiding a got read

florian 2 years ago
parent
commit
4430422489
1 changed files with 2 additions and 2 deletions
  1. 2 2
      compiler/aarch64/cgcpu.pas

+ 2 - 2
compiler/aarch64/cgcpu.pas

@@ -184,7 +184,7 @@ implementation
               preferred_newbasereg:=getaddressregister(list);
             { load the (GOT) page }
             reference_reset_symbol(href,ref.symbol,0,8,[]);
-            if ((ref.symbol.typ in [AT_FUNCTION,AT_LABEL]) and
+            if ((ref.symbol.typ in [AT_FUNCTION,AT_LABEL,AT_DATA]) and
                 (ref.symbol.bind in [AB_LOCAL,AB_GLOBAL])) or
                ((ref.symbol.typ=AT_DATA) and
                 (ref.symbol.bind=AB_LOCAL)) or
@@ -198,7 +198,7 @@ implementation
             href.symbol:=ref.symbol;
             { code symbols defined in the current compilation unit do not
               have to be accessed via the GOT }
-            if ((ref.symbol.typ in [AT_FUNCTION,AT_LABEL]) and
+            if ((ref.symbol.typ in [AT_FUNCTION,AT_LABEL,AT_DATA]) and
                 (ref.symbol.bind in [AB_LOCAL,AB_GLOBAL])) or
                ((ref.symbol.typ=AT_DATA) and
                 (ref.symbol.bind=AB_LOCAL)) or