• herman ten brugge's avatar
    Update bound checking code. · 38776187
    herman ten brugge 创作于
    Add __attribute__((constructor)) to __bounds_init.
    - remove tcc_add_bcheck from i386-link.c and x86_64-link.c
    - add simplified tcc_add_bcheck to tccelf.c
    - Update tccrun.c to call constructor/destructor.
    Set dynsym sh_info to number of local symbols in tccelf.c
    Reduce stack size when bounds checking is enabled.
    Added variable TCC_LIBBCHECK for windows support.
    Add signal stack to detect stack overflow.
    Add all & parameters in lbound_section and remove them if not used.
    Close fd in tcc_relocate in tccrun.c
    Fix section type constructor/destructor in tccelf.c
    Add check code in tests/boundtest.c for mem/str functions.
    Remove -ba from documentation.
    Add bounds check signal info in documentation.
    
    bcheck.c:
    - Fix initial_pool alignment.
    . Fix printf statements.
    . Add prototypes for all external interface functions.
    - Add TCC_BOUNDS_WARN_POINTER_ADD environment variable.
    . Add ctype and errno data.
    - Fix alloca when multithreading is used.
    - Add lock for __bound_checking and __bound_never_fatal.
    - Catch pthread_create and use locks when called.
    - Detect in loaded in shared lib and use locks when found
    - Use spin locks instead of semaphore locks.
    - Make spin locked code as small as possible.
    - Fix mem/str functions checking.
    - Fix overlap checking mem/str functions.
    38776187