diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2014-12-09 17:57:18 +0800 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2014-12-09 19:50:14 +0800 |
commit | 5e8c1cf25beccac1d22d10dc866912394f42771b (patch) | |
tree | ee16b70f804484dc8e434e647e699ab50da2620f /binutils-2.25/bfd/elf32-m68hc1x.c | |
parent | 8eebd7953384e6662ca926b003f2cdda8ccd3ee5 (diff) | |
download | toolchain_binutils-5e8c1cf25beccac1d22d10dc866912394f42771b.tar.gz toolchain_binutils-5e8c1cf25beccac1d22d10dc866912394f42771b.tar.bz2 toolchain_binutils-5e8c1cf25beccac1d22d10dc866912394f42771b.zip |
[2.25] sync to a30720e3e633f275250e26f85ccae5dbdddfb6c6
local patches will be re-applied later
commit a30720e3e633f275250e26f85ccae5dbdddfb6c6
Author: Alan Modra <amodra@gmail.com>
Date: Wed Nov 19 10:30:16 2014 +1030
daily update
Change-Id: Ieb2a3f4dd2ecb289ac5305ff08d428b2847494ab
Diffstat (limited to 'binutils-2.25/bfd/elf32-m68hc1x.c')
-rw-r--r-- | binutils-2.25/bfd/elf32-m68hc1x.c | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/binutils-2.25/bfd/elf32-m68hc1x.c b/binutils-2.25/bfd/elf32-m68hc1x.c index 427e3cd2..c3a99df8 100644 --- a/binutils-2.25/bfd/elf32-m68hc1x.c +++ b/binutils-2.25/bfd/elf32-m68hc1x.c @@ -1,6 +1,5 @@ /* Motorola 68HC11/HC12-specific support for 32-bit ELF - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, - 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + Copyright (C) 1999-2014 Free Software Foundation, Inc. Contributed by Stephane Carrez (stcarrez@nerim.fr) This file is part of BFD, the Binary File Descriptor library. @@ -59,6 +58,19 @@ struct m68hc11_scan_param }; +/* Destroy a 68HC11/68HC12 ELF linker hash table. */ + +static void +m68hc11_elf_bfd_link_hash_table_free (bfd *obfd) +{ + struct m68hc11_elf_link_hash_table *ret + = (struct m68hc11_elf_link_hash_table *) obfd->link.hash; + + bfd_hash_table_free (ret->stub_hash_table); + free (ret->stub_hash_table); + _bfd_elf_link_hash_table_free (obfd); +} + /* Create a 68HC11/68HC12 ELF linker hash table. */ struct m68hc11_elf_link_hash_table* @@ -85,29 +97,21 @@ m68hc11_elf_hash_table_create (bfd *abfd) ret->stub_hash_table = (struct bfd_hash_table*) bfd_malloc (amt); if (ret->stub_hash_table == NULL) { - free (ret); + _bfd_elf_link_hash_table_free (abfd); return NULL; } if (!bfd_hash_table_init (ret->stub_hash_table, stub_hash_newfunc, sizeof (struct elf32_m68hc11_stub_hash_entry))) - return NULL; + { + free (ret->stub_hash_table); + _bfd_elf_link_hash_table_free (abfd); + return NULL; + } + ret->root.root.hash_table_free = m68hc11_elf_bfd_link_hash_table_free; return ret; } -/* Free the derived linker hash table. */ - -void -m68hc11_elf_bfd_link_hash_table_free (struct bfd_link_hash_table *hash) -{ - struct m68hc11_elf_link_hash_table *ret - = (struct m68hc11_elf_link_hash_table *) hash; - - bfd_hash_table_free (ret->stub_hash_table); - free (ret->stub_hash_table); - _bfd_elf_link_hash_table_free (hash); -} - /* Assorted hash table functions. */ /* Initialize an entry in the stub hash table. */ @@ -255,7 +259,7 @@ elf32_m68hc11_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info) text_section = 0; for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) { bfd_count += 1; for (section = input_bfd->sections; @@ -343,7 +347,7 @@ elf32_m68hc11_size_stubs (bfd *output_bfd, bfd *stub_bfd, /* Count the number of input BFDs and find the top input section id. */ for (input_bfd = info->input_bfds, bfd_count = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next) + input_bfd = input_bfd->link.next) bfd_count += 1; /* We want to read in symbol extension records only once. To do this @@ -357,7 +361,7 @@ elf32_m68hc11_size_stubs (bfd *output_bfd, bfd *stub_bfd, /* Walk over all the input BFDs, swapping in local symbols. */ for (input_bfd = info->input_bfds, bfd_indx = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) + input_bfd = input_bfd->link.next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; @@ -387,7 +391,7 @@ elf32_m68hc11_size_stubs (bfd *output_bfd, bfd *stub_bfd, for (input_bfd = info->input_bfds, bfd_indx = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, bfd_indx++) + input_bfd = input_bfd->link.next, bfd_indx++) { Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry ** sym_hashes; @@ -979,12 +983,12 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, } else { - bfd_boolean unresolved_reloc, warned; + bfd_boolean unresolved_reloc, warned, ignored; RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, r_symndx, symtab_hdr, sym_hashes, h, sec, relocation, unresolved_reloc, - warned); + warned, ignored); is_far = (h && (h->other & STO_M68HC12_FAR)); is_xgate_symbol = (h && (h->target_internal)); |