bcheck cleanup
commit56db092ab7df109508efa4e3d2034028b18fd101
authorgrischka <grischka>
Thu, 12 Dec 2019 14:45:45 +0000 (12 15:45 +0100)
committergrischka <grischka>
Sat, 14 Dec 2019 12:26:18 +0000 (14 13:26 +0100)
treead80a00be7676d6481b9b052582f7a4b77a982b0
parenta86f47889c6de1602c7e26da6862d65c295861f0
bcheck cleanup

- revert Makefiles to state before last bcheck additions
  Instead, just load bcheck.o explicitly if that is
  what is wanted.

- move tcc_add_bcheck() to the <target>-link.c files and
  remove revently added arguments.  This function is to
  support tccelf.c with linking, not for tccgen.c to
  support compilation.

- remove -ba option:  It said:
  "-ba  Enable better address checking with bounds checker"
  Okay, if it is better then to have it is not an option.

- remove va_copy. It is C99 and we try to stay C89 in tinycc
  when possible.  For example, MS compilers do not have va_copy.

- win64: revert any 'fixes' to alloca
  It was correct as it was before, except for bound_checking
  where it was not implemented.  This should now work too.

- remove parasitic filename:linenum features
  Such feature is already present with rt_printline in
  tccrun.c.  If it doesn't work it can be fixed.

- revert changes to gen_bounded_ptr_add()
  gen_bounded_ptr_add() was working as it should before
  (mostly).  For the sake of simplicity I switched it to
  CDECL.  Anyway, FASTCALL means SLOWCALL with tinycc.

In exchange you get one addition which is required for
bounds_cnecking function arguments.  The important thing
is to check them *BEFORE* they are loaded into registers.
New function gbound_args() does that.

In any case, code instrumentation with the bounds-check
functions as such now seems to work flawlessly again,
which means when they are inserted as NOPs, any code that
tcc can compile, seems to behave just the same as without
them.

What these functions then do when fully enabled, is a
differnt story.  I did not touch this.
19 files changed:
Makefile
i386-gen.c
i386-link.c
lib/Makefile
lib/alloca86_64-bt.S
lib/alloca86_64.S
lib/bcheck.c
lib/dummy.c [deleted file]
libtcc.c
tcc.c
tcc.h
tccelf.c
tccgen.c
tccpe.c
tccpp.c
tcctok.h
tests/Makefile
x86_64-gen.c
x86_64-link.c