aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2003-07-23 19:40:23 +0000
committerStephane Carrez <stcarrez@nerim.fr>2003-07-23 19:40:23 +0000
commit7f88833084f5b830a5166b0b7678279c64506135 (patch)
tree9b83d977f667b6dcee2fd40531a43e188a0ff1ff
parent494fee87a7c1231994f2e62844191bdb2fc6b55e (diff)
downloadgdb-7f88833084f5b830a5166b0b7678279c64506135.zip
gdb-7f88833084f5b830a5166b0b7678279c64506135.tar.gz
gdb-7f88833084f5b830a5166b0b7678279c64506135.tar.bz2
* elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Avoid crash when
we have a local symbol in common section.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-m68hc1x.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b3617b2..d599c40 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2003-07-23 Stephane Carrez <stcarrez@nerim.fr>
+
+ * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Avoid crash when
+ we have a local symbol in common section.
+
2003-07-22 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (_bfd_elf_dynamic_symbol_p): Don't return TRUE for
diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c
index a3def11..7733f05 100644
--- a/bfd/elf32-m68hc1x.c
+++ b/bfd/elf32-m68hc1x.c
@@ -512,11 +512,12 @@ elf32_m68hc11_size_stubs (output_bfd, stub_bfd, info, add_stub_section)
bfd_boolean is_far;
sym = local_syms + r_indx;
- hdr = elf_elfsections (input_bfd)[sym->st_shndx];
- sym_sec = hdr->bfd_section;
is_far = (sym && (sym->st_other & STO_M68HC12_FAR));
if (!is_far)
continue;
+
+ hdr = elf_elfsections (input_bfd)[sym->st_shndx];
+ sym_sec = hdr->bfd_section;
stub_name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link,
sym->st_name));