22 juni 2019 01:43 av matz....@frakked.de:

> Hi,
>
> On Thu, 20 Jun 2019, C.J. Wagenius wrote:
>
>> 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.
>>
>
> Okay, let's bite the bullet and provide it from libtcc1.a on glibc systems.  
> I've made it so in mob, so your example should work now.
>
It compiles ok now, but the binary is complaining.

$ ./tcc ~/Temp/atexit.c -o atexit
$ ./atexit
./atexit: symbol lookup error: ./atexit: undefined symbol: __dso_handle

Thamks for looking into this.

/cjw

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

Reply via email to