aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-08-26 20:12:42 +0930
committerAlan Modra <amodra@gmail.com>2020-08-26 23:23:45 +0930
commit32168ca6c361175af68b1858ddf889b5dc44512b (patch)
treeb22a49da8951153ecbd32f25459409f9b3fccb13 /ld
parent2d0ce6779c25fb28b3b35cee02871b9a8d4cd29b (diff)
downloadgdb-32168ca6c361175af68b1858ddf889b5dc44512b.zip
gdb-32168ca6c361175af68b1858ddf889b5dc44512b.tar.gz
gdb-32168ca6c361175af68b1858ddf889b5dc44512b.tar.bz2
PR26499 UBSAN: eelf32_spu.c:537 member access null pointer
Another &p->field. PR 26499 * emultempl/spuelf.em (spu_elf_relink): Check for NULL tmp_file_list.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/emultempl/spuelf.em2
2 files changed, 6 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 882e1c9..6624608 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,10 @@
2020-08-26 Alan Modra <amodra@gmail.com>
+ PR 26499
+ * emultempl/spuelf.em (spu_elf_relink): Check for NULL tmp_file_list.
+
+2020-08-26 Alan Modra <amodra@gmail.com>
+
PR 26431
* pe-dll.c (auto_export): Don't call bsearch with zero count.
diff --git a/ld/emultempl/spuelf.em b/ld/emultempl/spuelf.em
index 56beb84..fc80a40 100644
--- a/ld/emultempl/spuelf.em
+++ b/ld/emultempl/spuelf.em
@@ -395,7 +395,7 @@ spu_elf_relink (void)
memcpy (argv, my_argv, my_argc * sizeof (*argv));
argv[my_argc++] = "--no-auto-overlay";
- if (tmp_file_list->name == auto_overlay_file)
+ if (tmp_file_list != NULL && tmp_file_list->name == auto_overlay_file)
argv[my_argc - 1] = concat (argv[my_argc - 1], "=",
auto_overlay_file, (const char *) NULL);
argv[my_argc++] = "-T";