aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-05-15 08:43:36 -0400
committerMike Frysinger <vapier@gentoo.org>2021-05-15 10:59:19 -0400
commitc5a2e0123b7241be6a2022f1acb8fa700dda628a (patch)
tree8418125810838d9bdb2970385d9672a907efc59c /sim/common
parentb9c0d703127de14cdbb32dc3607fd16cc427e352 (diff)
downloadgdb-c5a2e0123b7241be6a2022f1acb8fa700dda628a.zip
gdb-c5a2e0123b7241be6a2022f1acb8fa700dda628a.tar.gz
gdb-c5a2e0123b7241be6a2022f1acb8fa700dda628a.tar.bz2
sim: switch to libiberty environ.h
Drop our compat code and assume environ exists to simplify.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog6
-rw-r--r--sim/common/nrun.c9
2 files changed, 7 insertions, 8 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index b360ebd..b221166 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,9 @@
+2021-05-15 Mike Frysinger <vapier@gentoo.org>
+
+ * nrun.c: Include environ.h.
+ (environ): Delete prototype.
+ (main): Delete HAVE_ENVIRON check.
+
2021-05-14 Mike Frysinger <vapier@gentoo.org>
* callback.c (os_lseek): Change return and 3rd arg to int64_t.
diff --git a/sim/common/nrun.c b/sim/common/nrun.c
index 1ceb083..8a1b3c1 100644
--- a/sim/common/nrun.c
+++ b/sim/common/nrun.c
@@ -27,16 +27,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "sim-main.h"
#include "bfd.h"
+#include "environ.h"
#ifndef HAVE_STRSIGNAL
/* While libiberty provides a fallback, it doesn't provide a prototype. */
extern const char *strsignal (int);
#endif
-#ifdef HAVE_ENVIRON
-extern char **environ;
-#endif
-
#ifdef HAVE_UNISTD_H
/* For chdir. */
#include <unistd.h>
@@ -133,11 +130,7 @@ main (int argc, char **argv)
exit (1);
/* Prepare the program for execution. */
-#ifdef HAVE_ENVIRON
sim_create_inferior (sd, prog_bfd, prog_argv, environ);
-#else
- sim_create_inferior (sd, prog_bfd, prog_argv, NULL);
-#endif
/* To accommodate relative file paths, chdir to sysroot now. We
mustn't do this until BFD has opened the program, else we wouldn't