diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 09231bf42f..1f95fd54c3 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2015-04-20 H.J. Lu + + * elf.c (assign_section_numbers): Always set up sh_name. + 2015-04-20 H.J. Lu * elf.c (assign_file_positions_for_non_load_sections): Iterate diff --git a/bfd/elf.c b/bfd/elf.c index 4258c6ee6a..c60e1c873a 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -3479,11 +3479,8 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) } for (secn = 1; secn < section_number; ++secn) - if (i_shdrp[secn] == NULL) - i_shdrp[secn] = i_shdrp[0]; - else - i_shdrp[secn]->sh_name = _bfd_elf_strtab_offset (elf_shstrtab (abfd), - i_shdrp[secn]->sh_name); + i_shdrp[secn]->sh_name = _bfd_elf_strtab_offset (elf_shstrtab (abfd), + i_shdrp[secn]->sh_name); return TRUE; }