aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-04-20 12:37:14 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-04-20 12:37:14 -0700
commite97029632cfacf9d8b65e2cf3051a932f19f9ebf (patch)
treeff07963abe3d74809c505215cf414258c3bcaa61 /bfd/elf.c
parentbe59ad3d96fa78d97193698eb7c6309489493712 (diff)
downloadgdb-e97029632cfacf9d8b65e2cf3051a932f19f9ebf.zip
gdb-e97029632cfacf9d8b65e2cf3051a932f19f9ebf.tar.gz
gdb-e97029632cfacf9d8b65e2cf3051a932f19f9ebf.tar.bz2
Always set up sh_name in assign_section_numbers
commit 9ad5cbcfb23cb74d34bd04f88f4e47c0f5de5155 added the initial support for more than 64k ELF sections with holes for reserved section indices in section header table and set entries of reserved section indices in section header table to index 0: for (secn = 1; secn < section_number; ++secn) - i_shdrp[secn]->sh_name = _bfd_elf_strtab_offset (elf_shstrtab (abfd), - i_shdrp[secn]->sh_name); - + 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); commit 4fbb74a6055f7d48f09c44064073d3b1e99c6642 removed holes in section header table. Check for i_shdrp[secn] == NULL is no longer needed now. This patch removes it. * elf.c (assign_section_numbers): Always set up sh_name.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 4258c6e..c60e1c8 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;
}