aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2007-06-18 10:58:07 +0000
committerAlan Modra <amodra@gmail.com>2007-06-18 10:58:07 +0000
commit42ba7415ccca9cf6b16c7127362b665cd312be63 (patch)
tree9dcd9826556d88f18bf7e2113e9293ca08b82264 /ld
parent628e8859461e0af7dcae8357032b19ccfe611ff6 (diff)
downloadgdb-42ba7415ccca9cf6b16c7127362b665cd312be63.zip
gdb-42ba7415ccca9cf6b16c7127362b665cd312be63.tar.gz
gdb-42ba7415ccca9cf6b16c7127362b665cd312be63.tar.bz2
* Makefile.am: Add eelf32_spu.o rule.
* Makefile.in: Regenerate. * emultempl/spuelf.em: Revert last change. Instead use EMBEDSPU defined in Makefile for embedspu name.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/Makefile.am4
-rw-r--r--ld/Makefile.in4
-rw-r--r--ld/emultempl/spuelf.em22
4 files changed, 17 insertions, 20 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index aaf35f5..f39b9c7 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,12 @@
2007-06-18 Alan Modra <amodra@bigpond.net.au>
+ * Makefile.am: Add eelf32_spu.o rule.
+ * Makefile.in: Regenerate.
+ * emultempl/spuelf.em: Revert last change. Instead use EMBEDSPU
+ defined in Makefile for embedspu name.
+
+2007-06-18 Alan Modra <amodra@bigpond.net.au>
+
* emultempl/spuelf.em (embedded_spu_file): Deduce embedspu program
name prefix from that of ld.
diff --git a/ld/Makefile.am b/ld/Makefile.am
index b7a4b80..c30bd28 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -468,6 +468,10 @@ ldmain.o: ldmain.c config.status
-DTARGET='"@target@"' @TARGET_SYSTEM_ROOT_DEFINE@ \
$(srcdir)/ldmain.c
+eelf32_spu.o: eelf32_spu.c
+ $(COMPILE) -c -DEMBEDSPU="\"`echo embedspu | sed '$(transform)'`\"" \
+ eelf32_spu.c
+
ldemul-list.h: Makefile
(echo "/* This file is automatically generated. DO NOT EDIT! */";\
for f in `echo " " ${EMULATION_OFILES} "" \
diff --git a/ld/Makefile.in b/ld/Makefile.in
index c609915..05fa46b 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -1301,6 +1301,10 @@ ldmain.o: ldmain.c config.status
-DTARGET='"@target@"' @TARGET_SYSTEM_ROOT_DEFINE@ \
$(srcdir)/ldmain.c
+eelf32_spu.o: eelf32_spu.c
+ $(COMPILE) -c -DEMBEDSPU="\"`echo embedspu | sed '$(transform)'`\"" \
+ eelf32_spu.c
+
ldemul-list.h: Makefile
(echo "/* This file is automatically generated. DO NOT EDIT! */";\
for f in `echo " " ${EMULATION_OFILES} "" \
diff --git a/ld/emultempl/spuelf.em b/ld/emultempl/spuelf.em
index 3266f65..252b90f 100644
--- a/ld/emultempl/spuelf.em
+++ b/ld/emultempl/spuelf.em
@@ -306,8 +306,6 @@ embedded_spu_file (lang_input_statement_type *entry, const char *flags)
union lang_statement_union **old_file_tail;
union lang_statement_union *new_ent;
lang_input_statement_type *search;
- const char *prefix;
- size_t prefix_len;
if (entry->the_bfd->format != bfd_object
|| strcmp (entry->the_bfd->xvec->name, "elf32-spu") != 0
@@ -362,23 +360,7 @@ embedded_spu_file (lang_input_statement_type *entry, const char *flags)
/* Use fork() and exec() rather than system() so that we don't
need to worry about quoting args. */
- prefix = base_name (program_name);
- prefix_len = strlen (prefix);
- if (prefix_len > 2
- && (prefix[prefix_len - 2] == 'l'
- || prefix[prefix_len - 2] == 'L')
- && (prefix[prefix_len - 1] == 'd'
- || prefix[prefix_len - 1] == 'D'))
- {
- cmd[0] = xmalloc (prefix_len + 7);
- memcpy (cmd[0], prefix, prefix_len - 2);
- memcpy (cmd[0] + prefix_len - 2, "embedspu", 9);
- }
- else
- {
- prefix_len = 0;
- cmd[0] = "embedspu";
- }
+ cmd[0] = EMBEDSPU;
cmd[1] = flags;
cmd[2] = handle;
cmd[3] = entry->the_bfd->filename;
@@ -397,7 +379,7 @@ embedded_spu_file (lang_input_statement_type *entry, const char *flags)
if (pid == 0)
{
execvp (cmd[0], (char *const *) cmd);
- if (prefix_len != 0)
+ if (strcmp ("embedspu", EMBEDSPU) != 0)
{
cmd[0] = "embedspu";
execvp (cmd[0], (char *const *) cmd);