aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2001-08-21 01:02:41 +0000
committerH.J. Lu <hjl.tools@gmail.com>2001-08-21 01:02:41 +0000
commit4e89ac30f3bf3708a601009e42e8b5570abf1f9e (patch)
tree154af44cedc457af55fb1cfdeb940f20e29fa850 /bfd/elf.c
parenta6bacc8047a87ce89059ea0c0b393a501419af17 (diff)
downloadfsf-binutils-gdb-4e89ac30f3bf3708a601009e42e8b5570abf1f9e.zip
fsf-binutils-gdb-4e89ac30f3bf3708a601009e42e8b5570abf1f9e.tar.gz
fsf-binutils-gdb-4e89ac30f3bf3708a601009e42e8b5570abf1f9e.tar.bz2
2001-08-20 H.J. Lu <hjl@gnu.org>
* elf-bfd.h (elf_obj_tdata): Add num_section_syms. (elf_num_section_syms): New for num_section_syms. * elf.c (elf_map_symbols): Set num_section_syms. (_bfd_elf_symbol_from_bfd_symbol): Check num_section_syms for the section symbol index.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 8ff3ec8..7999803 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -2091,6 +2091,7 @@ elf_map_symbols (abfd)
if (sect_syms == NULL)
return false;
elf_section_syms (abfd) = sect_syms;
+ elf_num_section_syms (abfd) = max_index;
for (idx = 0; idx < symcount; idx++)
{
@@ -3651,7 +3652,8 @@ _bfd_elf_symbol_from_bfd_symbol (abfd, asym_ptr_ptr)
indx = asym_ptr->section->output_section->index;
else
indx = asym_ptr->section->index;
- if (elf_section_syms (abfd)[indx])
+ if (indx < elf_num_section_syms (abfd)
+ && elf_section_syms (abfd)[indx] != NULL)
asym_ptr->udata.i = elf_section_syms (abfd)[indx]->udata.i;
}