aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorPhil Blundell <philb@gnu.org>2009-06-12 14:26:08 +0000
committerPhil Blundell <philb@gnu.org>2009-06-12 14:26:08 +0000
commitdec9d5dfd7080bdb8937a3a17ff7befecbca40b4 (patch)
treed789eeaee65bdbeed5305cac7f2b9958663f8bfa /bfd/elf32-arm.c
parentf64fddf13afcb479b598e0d898fbb84b1da7474b (diff)
downloadgdb-dec9d5dfd7080bdb8937a3a17ff7befecbca40b4.zip
gdb-dec9d5dfd7080bdb8937a3a17ff7befecbca40b4.tar.gz
gdb-dec9d5dfd7080bdb8937a3a17ff7befecbca40b4.tar.bz2
2009-06-10 Philip Blundell <philb@gnu.org>
* elf32-arm.c (elf32_arm_fix_exidx_coverage): Avoid crash if elf_sec->this_hdr == NULL.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 2a2d461..df4be8b 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -3175,11 +3175,12 @@ arm_type_of_stub (struct bfd_link_info *info,
/* We have an extra 2-bytes reach because of
the mode change (bit 24 (H) of BLX encoding). */
- if (branch_offset > (ARM_MAX_FWD_BRANCH_OFFSET + 2)
- || (branch_offset < ARM_MAX_BWD_BRANCH_OFFSET)
- || ((r_type == R_ARM_CALL) && !globals->use_blx)
- || (r_type == R_ARM_JUMP24)
- || (r_type == R_ARM_PLT32))
+ if ((branch_offset > (ARM_MAX_FWD_BRANCH_OFFSET + 2)
+ || (branch_offset < ARM_MAX_BWD_BRANCH_OFFSET)
+ || ((r_type == R_ARM_CALL) && !globals->use_blx)
+ || (r_type == R_ARM_JUMP24)
+ || (r_type == R_ARM_PLT32))
+ && !use_plt)
{
stub_type = (info->shared | globals->pic_veneer)
/* PIC stubs. */
@@ -8960,7 +8961,7 @@ elf32_arm_fix_exidx_coverage (asection **text_section_order,
struct bfd_elf_section_data *elf_sec = elf_section_data (sec);
Elf_Internal_Shdr *hdr = &elf_sec->this_hdr;
- if (hdr->sh_type != SHT_ARM_EXIDX)
+ if (!hdr || hdr->sh_type != SHT_ARM_EXIDX)
continue;
if (elf_sec->linked_to)