mirror of
git://repo.or.cz/tinycc.git
synced 2026-11-04 21:26:36 +08:00
arm64: fix symbol addends on LLP64 hosts
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86_64-win32 (push) Has been cancelled
build and test / test-i386-win32 (push) Has been cancelled
build and test / test-arm64-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled
build and test / test-i386-linux (push) Has been cancelled
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86_64-win32 (push) Has been cancelled
build and test / test-i386-win32 (push) Has been cancelled
build and test / test-arm64-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled
build and test / test-i386-linux (push) Has been cancelled
The host-sized symbol addend parameter was introduced by commit b14ef0e2 and truncates 64-bit addends on LLP64 hosts.
Use addr_t and cover the negative-addend case.
This commit is contained in:
parent
da58264ab1
commit
2be0218be4
@ -463,7 +463,7 @@ static void arm64_strv(int sz_, int dst, int bas, uint64_t off)
|
||||
}
|
||||
}
|
||||
|
||||
static void arm64_sym(int r, Sym *sym, unsigned long addend)
|
||||
static void arm64_sym(int r, Sym *sym, addr_t addend)
|
||||
{
|
||||
if (sym->type.t & VT_TLS) {
|
||||
#if TCC_TARGET_PE
|
||||
|
||||
17
tests/tests2/152_arm64_addend.c
Normal file
17
tests/tests2/152_arm64_addend.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static unsigned short data[844];
|
||||
|
||||
static uint64_t address_for_index(int index)
|
||||
{
|
||||
return (uint64_t)(uintptr_t)data - 845186ULL
|
||||
+ (uint64_t)index * 2;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
printf("%d\n", address_for_index(422593)
|
||||
== (uint64_t)(uintptr_t)data);
|
||||
return 0;
|
||||
}
|
||||
1
tests/tests2/152_arm64_addend.expect
Normal file
1
tests/tests2/152_arm64_addend.expect
Normal file
@ -0,0 +1 @@
|
||||
1
|
||||
Loading…
Reference in New Issue
Block a user