macos: support bounds checking
commit57ba50e6111fb6c835c41d49bf80d3ae45184998
authorMichael Matz <matz@suse.de>
Fri, 22 May 2020 03:06:08 +0000 (22 05:06 +0200)
committerMichael Matz <matz@suse.de>
Sat, 20 Jun 2020 20:14:56 +0000 (20 22:14 +0200)
treed8c8be23c9c3609a8120ff913fb853ed82c7e62e
parent0b3c8360a095a8a02dbddd8834aa5e5d749ef5e2
macos: support bounds checking

* non-process-shared POSIX semaphores aren't supported on
  Darwin, we use the dispatch framework
* dlsym segfaults with RTLD_NEXT from JIT code, so we must not
  even try this for -run.  So we need to know in __bound_init
  if called from -run code, or from normal code, which means passing
  this down also from __bt_init and hence from the stub added in
  tcc_add_btstub
* Darwin uses different structures for <ctype.h> facilities, this
  merely adds a warning about this
* __libc_freeres doesn't exist
* for non -run modus the context (.prog_base member) is constructed
  incorrectly (uses symbol zero for trying to get at the load bias,
  which doesn't really work that way), on Mach-O this errors out
  (and could also error out on ELF).  For now deactivate this, which
  makes backtraces not be symbolic on MacOS for not -run.
lib/Makefile
lib/bcheck.c
lib/bt-exe.c
tccelf.c
tccrun.c