tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] execve being called with wrong path


From: Yao Zi
Subject: Re: [Tinycc-devel] execve being called with wrong path
Date: Wed, 9 Oct 2024 08:00:05 +0000

On Mon, Oct 07, 2024 at 05:44:47PM -0300, Brian Mayer wrote:
> The program being compiled:
> 
> # cat main.c
> #include <stdio.h>
> 
> void main(void) {
>         printf("hello from lin0\n");
> }
> 
> I'm using musl-1.2.5 compiled on Arch Linux with GCC on x86_64 with
> static libs disabled.

Could you send the output of

        readelf --program-headers ./main

where main is TinyCC generated, segfaulting executable?

And could you try linking your program with musl statically? Maybe
something like

        tcc main.c -o main -static

Recent TinyCC may generate ELF binaries with a zero-lengthed LOAD
segment, which musl's dynamic linker doesn't handle correctly. I thought
it's a musl problem and a patch has been sent to musl upstream[1].

Cheers,
Yao Zi

[1]: https://www.openwall.com/lists/musl/2024/09/15/1



reply via email to

[Prev in Thread] Current Thread [Next in Thread]