From f6d250ce5c780e6b43ea4b658d6037be34eb91bd Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 1 Oct 2010 11:22:40 +0000 Subject: [PATCH] 2010-10-01 Thomas Schwinge * elf32-arm.c (elf32_arm_size_stubs): Don't choke on local symbols in SHN_UNDEF, SHN_ABS, SHN_COMMON. --- bfd/ChangeLog | 5 +++++ bfd/elf32-arm.c | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 2b0b5b0ad20..f9aba1cddf4 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2010-10-01 Thomas Schwinge + + * elf32-arm.c (elf32_arm_size_stubs): Don't choke on local symbols in + SHN_UNDEF, SHN_ABS, SHN_COMMON. + 2010-09-30 H.J. Lu PR ld/11812 diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 2125582ee8a..fb3e0a3a234 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -4486,7 +4486,6 @@ elf32_arm_size_stubs (bfd *output_bfd, { /* It's a local symbol. */ Elf_Internal_Sym *sym; - Elf_Internal_Shdr *hdr; if (local_syms == NULL) { @@ -4502,8 +4501,16 @@ elf32_arm_size_stubs (bfd *output_bfd, } sym = local_syms + r_indx; - hdr = elf_elfsections (input_bfd)[sym->st_shndx]; - sym_sec = hdr->bfd_section; + if (sym->st_shndx == SHN_UNDEF) + sym_sec = bfd_und_section_ptr; + else if (sym->st_shndx == SHN_ABS) + sym_sec = bfd_abs_section_ptr; + else if (sym->st_shndx == SHN_COMMON) + sym_sec = bfd_com_section_ptr; + else + sym_sec = + bfd_section_from_elf_index (input_bfd, sym->st_shndx); + if (!sym_sec) /* This is an undefined symbol. It can never be resolved. */ -- 2.30.2