This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Prevent LTO wrappers to process a recursive execution
- From: Martin LiÅka <mliska at suse dot cz>
- To: Andi Kleen <andi at firstfloor dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>, Richard Biener <richard dot guenther at gmail dot com>
- Date: Tue, 26 Apr 2016 09:58:15 +0200
- Subject: Re: [PATCH] Prevent LTO wrappers to process a recursive execution
- Authentication-results: sourceware.org; auth=none
- References: <571E3CA4 dot 3000300 at suse dot cz> <87inz55vw4 dot fsf at tassilo dot jf dot intel dot com>
On 04/25/2016 09:30 PM, Andi Kleen wrote:
> Does that really work? When the executable is found in $PATH
> av[0] does not contain the full path name. But you seem to assume
> it does?
>
> -Andi
Hi.
Well, it should be resolved by lrealpath. There's usage from my machine:
marxin@marxinbox:~> which nm
/home/marxin/bin/gcc2/bin/nm
marxin@marxinbox:~> strace -f -s512 nm /tmp/a.o 2>&1 | grep exec
execve("/home/marxin/bin/gcc2/bin/nm", ["nm", "/tmp/a.o"], [/* 97 vars */]) = 0
[pid 5288] execve("/home/marxin/bin/gcc2/bin/nm", ["/home/marxin/bin/gcc2/bin/nm", "--plugin", "/home/marxin/bin/gcc2/lib/gcc/x86_64-pc-linux-gnu/7.0.0/liblto_plugin.so", "/tmp/a.o"], [/* 97 vars */] <unfinished ...>
[pid 5288] <... execve resumed> ) = 0
[pid 5289] execve("/usr/bin/nm", ["/usr/bin/nm", "--plugin", "/home/marxin/bin/gcc2/lib/gcc/x86_64-pc-linux-gnu/7.0.0/liblto_plugin.so", "--plugin", "/home/marxin/bin/gcc2/lib/gcc/x86_64-pc-linux-gnu/7.0.0/liblto_plugin.so", "/tmp/a.o"], [/* 97 vars */] <unfinished ...>
[pid 5289] <... execve resumed> ) = 0
marxin@marxinbox:~> l /home/marxin/bin/gcc2/bin/ | grep nm
-rwxr-xr-x 2 marxin users 141880 Apr 26 09:53 gcc-nm*
lrwxrwxrwx 1 marxin users 6 Apr 26 09:31 nm -> gcc-nm*
Martin