From: grischka via Tinycc-devel <[email protected]>
Date: Thu, 30 Jul 2026 23:19:41 +0900
 > 
 > Seems that a 32-bit-windows 'long' at
 > 
 >  static void arm64_sym(int r, Sym *sym, unsigned long addend)
 > 
 > could truncate the addend even before the generator would see it.
 > 
 > Try unsigned long long or uint64_t.
 > 
 > 
 
Agree. On Windows, unsigned long is always 32 bits, so the target's
64-bit addend was truncated before arm64_movimm() saw it.

I reproduced the failure with Windows ARM64 PE and ELF compilers.

I have pushed the fix to mob:

    2be0218b arm64: fix symbol addends on LLP64 hosts

I used addr_t. uint64_t would also work for ARM64, but addr_t expresses
what this parameter represents.  The commit also adds a regression test
based on the reduced testcase.

With the fix, the complete tests2 suite passes.

Regards,

Mounir IDRASSI



_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to