| OLD | NEW |
| 1 /* BFD back-end for Renesas H8/300 COFF binaries. | 1 /* BFD back-end for Renesas H8/300 COFF binaries. |
| 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
| 3 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2012 | 3 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2012 |
| 4 Free Software Foundation, Inc. | 4 Free Software Foundation, Inc. |
| 5 Written by Steve Chamberlain, <sac@cygnus.com>. | 5 Written by Steve Chamberlain, <sac@cygnus.com>. |
| 6 | 6 |
| 7 This file is part of BFD, the Binary File Descriptor library. | 7 This file is part of BFD, the Binary File Descriptor library. |
| 8 | 8 |
| 9 This program is free software; you can redistribute it and/or modify | 9 This program is free software; you can redistribute it and/or modify |
| 10 it under the terms of the GNU General Public License as published by | 10 it under the terms of the GNU General Public License as published by |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 /* Create the derived linker hash table. We use a derived hash table | 166 /* Create the derived linker hash table. We use a derived hash table |
| 167 basically to hold "static" information during an H8/300 coff link | 167 basically to hold "static" information during an H8/300 coff link |
| 168 without using static variables. */ | 168 without using static variables. */ |
| 169 | 169 |
| 170 static struct bfd_link_hash_table * | 170 static struct bfd_link_hash_table * |
| 171 h8300_coff_link_hash_table_create (bfd *abfd) | 171 h8300_coff_link_hash_table_create (bfd *abfd) |
| 172 { | 172 { |
| 173 struct h8300_coff_link_hash_table *ret; | 173 struct h8300_coff_link_hash_table *ret; |
| 174 bfd_size_type amt = sizeof (struct h8300_coff_link_hash_table); | 174 bfd_size_type amt = sizeof (struct h8300_coff_link_hash_table); |
| 175 | 175 |
| 176 ret = (struct h8300_coff_link_hash_table *) bfd_malloc (amt); | 176 ret = (struct h8300_coff_link_hash_table *) bfd_zmalloc (amt); |
| 177 if (ret == NULL) | 177 if (ret == NULL) |
| 178 return NULL; | 178 return NULL; |
| 179 if (!_bfd_link_hash_table_init (&ret->root.root, abfd, | 179 if (!_bfd_link_hash_table_init (&ret->root.root, abfd, |
| 180 _bfd_generic_link_hash_newfunc, | 180 _bfd_generic_link_hash_newfunc, |
| 181 sizeof (struct generic_link_hash_entry))) | 181 sizeof (struct generic_link_hash_entry))) |
| 182 { | 182 { |
| 183 free (ret); | 183 free (ret); |
| 184 return NULL; | 184 return NULL; |
| 185 } | 185 } |
| 186 | 186 |
| 187 /* Initialize our data. */ | |
| 188 ret->vectors_sec = NULL; | |
| 189 ret->funcvec_hash_table = NULL; | |
| 190 | |
| 191 /* OK. Everything's initialized, return the base pointer. */ | |
| 192 return &ret->root.root; | 187 return &ret->root.root; |
| 193 } | 188 } |
| 194 | 189 |
| 195 /* Special handling for H8/300 relocs. | 190 /* Special handling for H8/300 relocs. |
| 196 We only come here for pcrel stuff and return normally if not an -r link. | 191 We only come here for pcrel stuff and return normally if not an -r link. |
| 197 When doing -r, we can't do any arithmetic for the pcrel stuff, because | 192 When doing -r, we can't do any arithmetic for the pcrel stuff, because |
| 198 the code in reloc.c assumes that we can manipulate the targets of | 193 the code in reloc.c assumes that we can manipulate the targets of |
| 199 the pcrel branches. This isn't so, since the H8/300 can do relaxing, | 194 the pcrel branches. This isn't so, since the H8/300 can do relaxing, |
| 200 which means that the gap after the instruction may not be enough to | 195 which means that the gap after the instruction may not be enough to |
| 201 contain the offset required for the branch, so we have to use only | 196 contain the offset required for the branch, so we have to use only |
| (...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1415 | 1410 |
| 1416 #include "coffcode.h" | 1411 #include "coffcode.h" |
| 1417 | 1412 |
| 1418 #undef coff_bfd_get_relocated_section_contents | 1413 #undef coff_bfd_get_relocated_section_contents |
| 1419 #undef coff_bfd_relax_section | 1414 #undef coff_bfd_relax_section |
| 1420 #define coff_bfd_get_relocated_section_contents \ | 1415 #define coff_bfd_get_relocated_section_contents \ |
| 1421 bfd_coff_reloc16_get_relocated_section_contents | 1416 bfd_coff_reloc16_get_relocated_section_contents |
| 1422 #define coff_bfd_relax_section bfd_coff_reloc16_relax_section | 1417 #define coff_bfd_relax_section bfd_coff_reloc16_relax_section |
| 1423 | 1418 |
| 1424 CREATE_BIG_COFF_TARGET_VEC (h8300coff_vec, "coff-h8300", BFD_IS_RELAXABLE, 0, '_
', NULL, COFF_SWAP_TABLE) | 1419 CREATE_BIG_COFF_TARGET_VEC (h8300coff_vec, "coff-h8300", BFD_IS_RELAXABLE, 0, '_
', NULL, COFF_SWAP_TABLE) |
| OLD | NEW |