diff options
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r-- | bfd/elflink.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c index 9eb1122..a498dbb 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -8819,6 +8819,8 @@ bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2, symp->name = bfd_elf_string_from_elf_section (bfd1, hdr1->sh_link, ssym->st_name); + if (symp->name == NULL) + goto done; symp++; } @@ -8832,6 +8834,8 @@ bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2, symp->name = bfd_elf_string_from_elf_section (bfd2, hdr2->sh_link, ssym->st_name); + if (symp->name == NULL) + goto done; symp++; } @@ -8878,14 +8882,22 @@ bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2, goto done; for (i = 0; i < count1; i++) - symtable1[i].name - = bfd_elf_string_from_elf_section (bfd1, hdr1->sh_link, - symtable1[i].u.isym->st_name); + { + symtable1[i].name + = bfd_elf_string_from_elf_section (bfd1, hdr1->sh_link, + symtable1[i].u.isym->st_name); + if (symtable1[i].name == NULL) + goto done; + } for (i = 0; i < count2; i++) - symtable2[i].name - = bfd_elf_string_from_elf_section (bfd2, hdr2->sh_link, - symtable2[i].u.isym->st_name); + { + symtable2[i].name + = bfd_elf_string_from_elf_section (bfd2, hdr2->sh_link, + symtable2[i].u.isym->st_name); + if (symtable2[i].name == NULL) + goto done; + } /* Sort symbol by name. */ qsort (symtable1, count1, sizeof (struct elf_symbol), |