diff options
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/emultempl/spuelf.em | 17 |
2 files changed, 19 insertions, 3 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 0d6bd931d9..25d2f23633 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2011-12-01 Nick Clifton <nickc@redhat.com> + + * emultempl/spuelf.em (spu_elf_relink): Use pex_one in place + of execvp. + 2011-11-25 John Tytgat <john@bass-software.com> * emultempl/armelf.em: Update copyright to 2010 and 2011. diff --git a/ld/emultempl/spuelf.em b/ld/emultempl/spuelf.em index 92f2d163d3..714d33d803 100644 --- a/ld/emultempl/spuelf.em +++ b/ld/emultempl/spuelf.em @@ -384,9 +384,13 @@ spu_elf_open_overlay_script (void) return script; } +#include <errno.h> + 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. */ |