aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl/spuelf.em
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2007-07-11 22:58:09 +0000
committerAlan Modra <amodra@gmail.com>2007-07-11 22:58:09 +0000
commit80c4ed32bccc3bdd247e29628f7ccb40ff1ac21c (patch)
tree74dc9d7c67c50d128aa6bb85ceee405906ef2345 /ld/emultempl/spuelf.em
parent521ec47731af80caa4b88ebc9a5e62e42bad3613 (diff)
downloadgdb-80c4ed32bccc3bdd247e29628f7ccb40ff1ac21c.zip
gdb-80c4ed32bccc3bdd247e29628f7ccb40ff1ac21c.tar.gz
gdb-80c4ed32bccc3bdd247e29628f7ccb40ff1ac21c.tar.bz2
* emultempl/spuelf.em (embedded_spu_file): Test for NULL path
before calling base_name, not after.
Diffstat (limited to 'ld/emultempl/spuelf.em')
-rw-r--r--ld/emultempl/spuelf.em24
1 files changed, 12 insertions, 12 deletions
diff --git a/ld/emultempl/spuelf.em b/ld/emultempl/spuelf.em
index abcb6b5..2235143 100644
--- a/ld/emultempl/spuelf.em
+++ b/ld/emultempl/spuelf.em
@@ -345,19 +345,19 @@ embedded_spu_file (lang_input_statement_type *entry, const char *flags)
for (search = (lang_input_statement_type *) input_file_chain.head;
search != NULL;
search = (lang_input_statement_type *) search->next_real_file)
- {
- const char *infile = base_name (search->filename);
+ if (search->filename != NULL)
+ {
+ const char *infile = base_name (search->filename);
- if (infile != NULL
- && strncmp (infile, "crtbegin", 8) == 0)
- {
- if (infile[8] == 'S')
- flags = concat (flags, " -fPIC", NULL);
- else if (infile[8] == 'T')
- flags = concat (flags, " -fpie", NULL);
- break;
- }
- }
+ if (strncmp (infile, "crtbegin", 8) == 0)
+ {
+ if (infile[8] == 'S')
+ flags = concat (flags, " -fPIC", NULL);
+ else if (infile[8] == 'T')
+ flags = concat (flags, " -fpie", NULL);
+ break;
+ }
+ }
/* Use fork() and exec() rather than system() so that we don't
need to worry about quoting args. */