Compiling with -shared makes tcc compile ok but the binary segfaults.

Including crtbegin.o (for symbol __dso_handle) and crtend.o (for symbol 
__TMC_END__) makes tcc compile ok and the binary works.

$ tcc ../atexit.c /usr/lib/gcc/x86_64-redhat-linux/9/crtbegin.o 
/usr/lib/gcc/x86_64-redhat-linux/9/crtend.o

I don't know the right way to fix this in tcc.

/cjw

16 juni 2019 17:12 av c...@voidptr.se:

> Hi
>
> Trying to compile a program that uses atexit in Fedora 30 (gcc version 9.1.1 
> 20190503, glibc 2.29), results in a tcc error.
> ---
> tcc: error: undefined symbol '__dso_handle'
>
> Regards
> /cjw
>
> _______________________________________________
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>

Attachment: crtbegin.o
Description: Binary data

Attachment: crtend.o
Description: Binary data

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to