Skip to content

Commit d73cc72

Browse files
WalterBrightthewilsonator
authored andcommitted
statics should not get GOT relocation
1 parent 7b6b1de commit d73cc72

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

compiler/src/dmd/backend/machobj.d

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ void MachObj_term(const(char)[] objfilename)
972972
else if (s.Sfl == FL.unde || // special case for __chkstk_darwin, need to research what PAGEOFF12 really means
973973
s.Sfl == FL.extern_ ||
974974
(s.Sclass == SC.extern_ && s.Sfl == FL.func) ||
975-
(s.Sclass == SC.static_ && s.Sfl == FL.data) ||
975+
//(s.Sclass == SC.static_ && s.Sfl == FL.data) ||
976976
s.Sfl == FL.tlsdata)
977977
{
978978
rel.r_type = r.rtype == REL.add ? ARM64_RELOC_GOT_LOAD_PAGEOFF12 : ARM64_RELOC_GOT_LOAD_PAGE21;
@@ -1584,6 +1584,8 @@ static if (1)
15841584

15851585
ubyte remap(uint seg)
15861586
{
1587+
if (!machobj.AArch64)
1588+
return cast(ubyte)seg;
15871589
foreach (i; 0 .. table.length)
15881590
{
15891591
if (table[i] == seg)

0 commit comments

Comments
 (0)