* improve module local data accesses by avoiding a got read

This commit is contained in:
florian 2022-12-28 22:05:23 +01:00
parent 9e48addff5
commit 4430422489

View File

@ -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