libs/libc/machine/sim/arch_elf64.c: Implement R_X86_64_PC64

This relocation type is often found in eh_frame with -mcmodel=large
This commit is contained in:
YAMAMOTO Takashi 2022-01-27 19:58:07 +09:00 committed by Xiang Xiao
parent 341bfeb8b6
commit 021b1a6bfb

View File

@ -47,6 +47,7 @@
#define R_X86_64_PLT32 4
#define R_X86_64_32 10
#define R_X86_64_32S 11
#define R_X86_64_PC64 24
/****************************************************************************
* Private Data Types
@ -181,6 +182,10 @@ int up_relocateadd(FAR const Elf64_Rela *rel, FAR const Elf64_Sym *sym,
*(uint32_t *)addr = value;
break;
case R_X86_64_PC64: /* S + A - P */
value = sym->st_value + rel->r_addend - addr;
*(uint64_t *)addr = value;
break;
case R_X86_64_32: /* S + A */
case R_X86_64_32S: /* S + A */
value = sym->st_value + rel->r_addend;