tinycc/lib
herman ten brugge 0b8ee7364a Add bound checking to arm, arm64 and riscv64
Checked on:
- i386/x86_64 (linux/windows)
- arm/arm64 (rapberry pi)
- riscv64 (simulator)
Not tested for arm softfloat because raspberry pi does not support it.

Modifications:

Makefile:
  add arm-asm.c to arm64_FILES
  add riscv64-asm.c (new file) to riscv64_FILES

lib/Makefile:
  add fetch_and_add_arm.o(new file) to ARM_O
  add fetch_and_add_arm64.o(new file) to ARM64_O
  add fetch_and_add_riscv64.o(new file) to RISCV64_O
  add $(BCHECK_O) to OBJ-arm/OBJ-arm64/OBJ-riscv64

tcc.h:
  Enable CONFIG_TCC_BCHECK for arm32/arm64/riscv64
  Add arm-asm.c, riscv64-asm.c

tcctok.h:
  for arm use memmove4 instead of memcpy4
  for arm use memmove8 instead of memcpy8

tccgen.c:
  put_extern_sym2: for arm check memcpy/memmove/memset/memmove4/memmove8
                   only use alloca for i386/x86_64
  for arm use memmove4 instead of memcpy4
  for arm use memmove8 instead of memcpy8
  fix builtin_frame_address/builtin_return_address for arm/riscv64

tccrun.c:
  Add riscv64 support
  fix rt_getcontext/rt_get_caller_pc for arm

tccelf.c:
  tcc_load_dll: Print filename for bad architecture

libtcc.c:
  add arm-asm.c/riscv64-asm.c

tcc-doc.texi:
  Add arm, arm64, riscv64 support for bound checking

lib/bcheck.c:
  add __bound___aeabi_memcpy/__bound___aeabi_memmove
      __bound___aeabi_memmove4/__bound___aeabi_memmove8
      __bound___aeabi_memset for arm
  call fetch_and_add_arm/fetch_and_add_arm64/fetch_and_add_riscv64
  __bound_init: Fix type for start/end/ad
  __bound_malloc/__bound_memalign/__bound_realloc/__bound_calloc: Use size + 1

arm-gen.c:
  add bound checking code like i386/x86_64
  assign_regs: only malloc if nb_args != 0
  gen_opi/gen_opf: Fix reload problems

arm-link.c:
  relocate_plt: Fix address calculating

arm64-gen.c:
  add bound checking code like i386/x86_64
  load/store: remove VT_BOUNDED from sv->r
  arm64_hfa_aux/arm64_hfa_aux: Fix array code
  gfunc_prolog: only malloc if n != 0

arm64-link.c:
  code_reloc/gotplt_entry_type/relocate: add R_AARCH64_LDST64_ABS_LO12_NC
  relocate: Use addXXle instead of writeXXle

riscv64-gen.c:
  add bound checking code like i386/x86_64
  add NB_ASM_REGS/CONFIG_TCC_ASM

riscv64-link.c:
  relocate: Use addXXle instead of writeXXle

i386-gen.c/x86_64-gen.c
  gen_bounds_epilog: Fix code (unrelated)

tests/Makefile:
  add $(BTESTS) for arm/arm64/riscv64

tests/tests2/Makefile:
  Use 85 only on i386/x86_64 because of asm code
  Use 113 only on i386/x86_64 because of DLL code
  Add 112/114/115/116 for arm/arm64/riscv64
  Fix FILTER (failed on riscv64)

tests/boundtest.c:
  Only use alloca for i386/x86_64
2020-06-16 07:39:48 +02:00
..
alloca86_64-bt.S bcheck cleanup 2019-12-14 13:26:18 +01:00
alloca86_64.S bcheck cleanup 2019-12-14 13:26:18 +01:00
alloca86-bt.S tccgen: nodata_wanted fix, default ONE_SOURCE, etc... 2017-07-23 21:24:11 +02:00
alloca86.S tccgen: nodata_wanted fix, default ONE_SOURCE, etc... 2017-07-23 21:24:11 +02:00
alloca-arm.S cross-compilers: allow individual configuration 2017-02-23 08:41:57 +01:00
armeabi.c cross-compilers: allow individual configuration 2017-02-23 08:41:57 +01:00
armflush.c arm: Don't override syscall implementation 2019-11-06 01:01:56 +11:00
bcheck.c Add bound checking to arm, arm64 and riscv64 2020-06-16 07:39:48 +02:00
bt-dll.c tccrun.c: standalone backtraces with -bt[N] or -b 2020-01-17 22:58:39 +01:00
bt-exe.c tccrun.c: standalone backtraces with -bt[N] or -b 2020-01-17 22:58:39 +01:00
bt-log.c Fix gcc10 warnings 2020-05-23 20:27:43 +02:00
dsohandle.c Define __dso_handle in libtcc1.a 2019-06-22 01:38:43 +02:00
fetch_and_add_arm64.S Add bound checking to arm, arm64 and riscv64 2020-06-16 07:39:48 +02:00
fetch_and_add_arm.S Add bound checking to arm, arm64 and riscv64 2020-06-16 07:39:48 +02:00
fetch_and_add_riscv64.S Add bound checking to arm, arm64 and riscv64 2020-06-16 07:39:48 +02:00
lib-arm64.c riscv: Implement long double support 2019-09-01 23:13:20 +02:00
libtcc1.c tccgen: nodata_wanted fix, default ONE_SOURCE, etc... 2017-07-23 21:24:11 +02:00
Makefile Add bound checking to arm, arm64 and riscv64 2020-06-16 07:39:48 +02:00
va_list.c stdarg: always have the __builtin_va_* available 2020-04-15 22:06:52 +02:00