aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-m68k.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2010-08-20 21:06:30 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2010-08-20 21:06:30 +0000
commitb1345da313436ded1bc8328b21a283dc4d65a9a4 (patch)
tree8ba97743cc5199136eb1d09f98cc1975b37888f3 /bfd/elf32-m68k.c
parent0982e15774ff2baa92f4d595266eb29c154a8037 (diff)
downloadgdb-b1345da313436ded1bc8328b21a283dc4d65a9a4.zip
gdb-b1345da313436ded1bc8328b21a283dc4d65a9a4.tar.gz
gdb-b1345da313436ded1bc8328b21a283dc4d65a9a4.tar.bz2
* elf32-m68k.c (bfd_elf_m68k_set_target_options): Don't set GOT
options unless an m68k hash table has been found.
Diffstat (limited to 'bfd/elf32-m68k.c')
-rw-r--r--bfd/elf32-m68k.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index c0a5ef1..975207f 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -4745,34 +4745,44 @@ void
bfd_elf_m68k_set_target_options (struct bfd_link_info *info, int got_handling)
{
struct elf_m68k_link_hash_table *htab;
-
- htab = elf_m68k_hash_table (info);
+ bfd_boolean use_neg_got_offsets_p;
+ bfd_boolean allow_multigot_p;
+ bfd_boolean local_gp_p;
switch (got_handling)
{
case 0:
/* --got=single. */
- htab->local_gp_p = FALSE;
- htab->use_neg_got_offsets_p = FALSE;
- htab->allow_multigot_p = FALSE;
+ local_gp_p = FALSE;
+ use_neg_got_offsets_p = FALSE;
+ allow_multigot_p = FALSE;
break;
case 1:
/* --got=negative. */
- htab->local_gp_p = TRUE;
- htab->use_neg_got_offsets_p = TRUE;
- htab->allow_multigot_p = FALSE;
+ local_gp_p = TRUE;
+ use_neg_got_offsets_p = TRUE;
+ allow_multigot_p = FALSE;
break;
case 2:
/* --got=multigot. */
- htab->local_gp_p = TRUE;
- htab->use_neg_got_offsets_p = TRUE;
- htab->allow_multigot_p = TRUE;
+ local_gp_p = TRUE;
+ use_neg_got_offsets_p = TRUE;
+ allow_multigot_p = TRUE;
break;
default:
BFD_ASSERT (FALSE);
+ return;
+ }
+
+ htab = elf_m68k_hash_table (info);
+ if (htab != NULL)
+ {
+ htab->local_gp_p = local_gp_p;
+ htab->use_neg_got_offsets_p = use_neg_got_offsets_p;
+ htab->allow_multigot_p = allow_multigot_p;
}
}