summaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2010-10-01 11:22:40 +0000
committerThomas Schwinge <tschwinge@gnu.org>2010-10-01 11:22:40 +0000
commit478c87008d96f08b441deeebd3f494978c930add (patch)
treeddcc6b1622d86c74f05375ecc3cf9a7d97101d4e /bfd/elf32-arm.c
parentdc027516e99b4795b1fba7179de6fe006069109b (diff)
downloadbinutils-redhat-478c87008d96f08b441deeebd3f494978c930add.tar.gz
2010-10-01 Thomas Schwinge <thomas@codesourcery.com>
* elf32-arm.c (elf32_arm_size_stubs): Don't choke on local symbols in SHN_UNDEF, SHN_ABS, SHN_COMMON.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 2125582ee8..fb3e0a3a23 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. */