From 87f1617a4f71347db8f9bd7f257f729bc08f2d31 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 1 Dec 2011 11:38:32 +0000 Subject: * emultempl/spuelf.em (spu_elf_relink): Use pex_one in place of execvp. --- ld/emultempl/spuelf.em | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'ld/emultempl') diff --git a/ld/emultempl/spuelf.em b/ld/emultempl/spuelf.em index 92f2d16..714d33d 100644 --- a/ld/emultempl/spuelf.em +++ b/ld/emultempl/spuelf.em @@ -384,9 +384,13 @@ spu_elf_open_overlay_script (void) return script; } +#include + static void spu_elf_relink (void) { + const char *pex_return; + int status; char **argv = xmalloc ((my_argc + 4) * sizeof (*argv)); memcpy (argv, my_argv, my_argc * sizeof (*argv)); @@ -397,9 +401,16 @@ spu_elf_relink (void) argv[my_argc++] = "-T"; argv[my_argc++] = auto_overlay_file; argv[my_argc] = 0; - execvp (argv[0], (char *const *) argv); - perror (argv[0]); - _exit (127); + + pex_return = pex_one (PEX_SEARCH | PEX_LAST, (const char *) argv[0], + (char * const *) argv, (const char *) argv[0], + NULL, NULL, & status, & errno); + if (pex_return != NULL) + { + perror (pex_return); + _exit (127); + } + exit (status); } /* Final emulation specific call. */ -- cgit v1.1