From 87f1617a4f71347db8f9bd7f257f729bc08f2d31 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 1 Dec 2011 11:38:32 +0000 Subject: [PATCH] * emultempl/spuelf.em (spu_elf_relink): Use pex_one in place of execvp. --- ld/ChangeLog | 5 +++++ ld/emultempl/spuelf.em | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 0d6bd931d9d..25d2f236332 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2011-12-01 Nick Clifton + + * emultempl/spuelf.em (spu_elf_relink): Use pex_one in place + of execvp. + 2011-11-25 John Tytgat * emultempl/armelf.em: Update copyright to 2010 and 2011. diff --git a/ld/emultempl/spuelf.em b/ld/emultempl/spuelf.em index 92f2d163d3d..714d33d8033 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. */ -- 2.30.2