diff options
Diffstat (limited to 'backends/riscv_symbol.c')
-rw-r--r-- | backends/riscv_symbol.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/backends/riscv_symbol.c b/backends/riscv_symbol.c index 866a2d7a..c34b7702 100644 --- a/backends/riscv_symbol.c +++ b/backends/riscv_symbol.c @@ -40,14 +40,38 @@ /* Check for the simple reloc types. */ Elf_Type -riscv_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type) +riscv_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type, + int *addsub) { switch (type) { + case R_RISCV_SET8: + return ELF_T_BYTE; + case R_RISCV_SET16: + return ELF_T_HALF; case R_RISCV_32: + case R_RISCV_SET32: return ELF_T_WORD; case R_RISCV_64: return ELF_T_XWORD; + case R_RISCV_ADD16: + *addsub = 1; + return ELF_T_HALF; + case R_RISCV_SUB16: + *addsub = -1; + return ELF_T_HALF; + case R_RISCV_ADD32: + *addsub = 1; + return ELF_T_WORD; + case R_RISCV_SUB32: + *addsub = -1; + return ELF_T_WORD; + case R_RISCV_ADD64: + *addsub = 1; + return ELF_T_XWORD; + case R_RISCV_SUB64: + *addsub = -1; + return ELF_T_XWORD; default: return ELF_T_NUM; } |