This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Prevent LTO wrappers to process a recursive execution


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]