22 juni 2019 06:09 av c...@voidptr.se:

>
> 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.
>
>
Never mind. It works fine. My bad. There is still some problem with -run though.

$ tcc -run -g atexit.c
Runtime error: dereferencing invalid pointer
Segmentation fault (core dumped)


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

Reply via email to