k1w1 wrote:
My question is about other platforms. I am trying to get TCC working completely (including bounds checking) under cygwin. So I am trying to understand how it works on other platforms so I can do it correctly. It appeared to me that on any platform except Windows bcheck.o is compiled with the native compiler (e.g. gcc) which seems strange since bcheck.o is linked against TCC compiled code to make the final executable. Am I correct?
That is not strange. TCC has an ELF linker built-in, so on a native ELF platform such as linux it can of course link its own code against object code compiled with the native gcc (say with minor problems hence and when). Just on windows gcc would produce COFF objects, which TCC cannot read. That is also true for cygwin's gcc. As to how well bcheck works on the other platform, all I really know is that it passes the test (See below). --- grischka $ make -C tests btest ------------ btest ------------ --- boundtest 1 --- succeded as expected --- boundtest 4 --- succeded as expected --- boundtest 8 --- succeded as expected --- boundtest 10 --- succeded as expected --- boundtest 14 --- succeded as expected --- boundtest 2 --- Runtime error: dereferencing invalid pointer at 0x09b75457: test2() (boundtest.c:26) by 0x09b75ad3: main() (boundtest.c:227) failed as expected --- boundtest 5 --- Runtime error: dereferencing invalid pointer at 0x097f45f3: test5() (boundtest.c:69) by 0x097f4ad3: main() (boundtest.c:227) failed as expected --- boundtest 7 --- i=100 99a111c Runtime error: dereferencing invalid pointer at 0x0999f729: test7() (boundtest.c:102) by 0x0999fad3: main() (boundtest.c:227) failed as expected --- boundtest 9 --- Runtime error: dereferencing invalid pointer at 0x09610807: test9() (boundtest.c:126) by 0x09610ad3: main() (boundtest.c:227) failed as expected --- boundtest 11 --- Runtime error: dereferencing invalid pointer at 0x098feffa: __bound_check() by 0x098ff081: __bound_memset() by 0x098fe8c2: test11() (boundtest.c:148) by 0x098fead3: main() (boundtest.c:227) failed as expected --- boundtest 12 --- Runtime error: freeing invalid region at 0x081c8a32: __bound_free() by 0x400c73f5: ??? by 0x081c7918: test12() (boundtest.c:158) by 0x081c7ad3: main() (boundtest.c:227) failed as expected --- boundtest 13 --- Runtime error: bad pointer in strlen() at 0x0939a040: __bound_strlen() by 0x0939996b: test13() (boundtest.c:169) by 0x09399ad3: main() (boundtest.c:227) failed as expected --- boundtest 15 --- Runtime error: dereferencing invalid pointer at 0x09de0ffa: __bound_check() by 0x09de1081: __bound_memset() by 0x09de0a1f: test15() (boundtest.c:184) by 0x09de0ad3: main() (boundtest.c:227) failed as expected Bound test OK _______________________________________________ Tinycc-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/tinycc-devel
