diff options
author | Nick Clifton <nickc@redhat.com> | 2011-12-01 11:38:32 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2011-12-01 11:38:32 +0000 |
commit | 87f1617a4f71347db8f9bd7f257f729bc08f2d31 (patch) | |
tree | 69bdfebda250a06aff3ef24f98049e41ad05a6b3 | |
parent | fc0ae648aa229713c8c2f104dc413db8019ec899 (diff) | |
download | gdb-87f1617a4f71347db8f9bd7f257f729bc08f2d31.zip gdb-87f1617a4f71347db8f9bd7f257f729bc08f2d31.tar.gz gdb-87f1617a4f71347db8f9bd7f257f729bc08f2d31.tar.bz2 |
* emultempl/spuelf.em (spu_elf_relink): Use pex_one in place
of execvp.
-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 0d6bd93..25d2f23 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 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 <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. */ |