* sh.h: Split out various bits to bfd/elf32-sh64.h.
include/opcode/ChangeLog
* m68hc11.h (cpu6812s): Define.
bfd/ChangeLog
* elf-bfd.h (struct bfd_elf_section_data): Remove tdata. Change
dynindx to an int. Rearrange for better packing.
* elf.c (_bfd_elf_new_section_hook): Don't alloc if already done.
* elf32-mips.c (bfd_elf32_new_section_hook): Define.
* elf32-sh64.h: New. Split out from include/elf/sh.h.
(struct _sh64_elf_section_data): New struct.
(sh64_elf_section_data): Don't dereference sh64_info (was tdata).
* elf32-sh64-com.c: Include elf32-sh64.h.
* elf32-sh64.c: Likewise.
(sh64_elf_new_section_hook): New function.
(bfd_elf32_new_section_hook): Define.
(sh64_elf_fake_sections): Adjust for sh64_elf_section_data change.
(sh64_bfd_elf_copy_private_section_data): Likewise.
(sh64_elf_final_write_processing): Likewise.
* elf32-sparc.c (struct elf32_sparc_section_data): New.
(elf32_sparc_new_section_hook): New function.
(SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
(sec_do_relax): Define.
(elf32_sparc_relax_section): Adjust to use sec_do_relax.
(elf32_sparc_relocate_section): Likewise.
* elf64-mips.c (bfd_elf64_new_section_hook): Define.
* elf64-mmix.c (struct _mmix_elf_section_data): New.
(mmix_elf_section_data): Define. Use throughout file.
(mmix_elf_new_section_hook): New function.
(bfd_elf64_new_section_hook): Define.
* elf64-ppc.c (struct _ppc64_elf_section_data): New.
(ppc64_elf_section_data): Define. Use throughout.
(ppc64_elf_new_section_hook): New function.
(bfd_elf64_new_section_hook): Define.
* elf64-sparc.c (struct sparc64_elf_section_data): New.
(sparc64_elf_new_section_hook): New function.
(SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
(sec_do_relax): Define.
(sparc64_elf_relax_section): Adjust to use sec_do_relax.
(sparc64_elf_relocate_section): Likewise.
(bfd_elf64_new_section_hook): Define.
* elfn32-mips.c (bfd_elf32_new_section_hook): Define.
* elfxx-mips.c (struct _mips_elf_section_data): New.
(mips_elf_section_data): Define. Use throughout.
(_bfd_mips_elf_new_section_hook): New function.
(mips_elf_create_got_section): Don't alloc used_by_bfd.
* elfxx-mips.h (_bfd_mips_elf_new_section_hook): Declare.
* elfxx-target.h (bfd_elfNN_new_section_hook): Add #ifndef.
* Makefile.am: Run "make dep-am".
* Makefile.in: Regenerate.
opcodes/ChangeLog
* sh64-dis.c: Include elf32-sh64.h.
* Makefile.am: Run "make dep-am".
* Makefile.in: Regenerate.
gas/ChangeLog
* config/tc-sh64.c (shmedia_frob_section_type): Adjust for changed
sh64_elf_section_data.
* config/tc-sh64.h: Include elf32-sh64.h.
* config/tc-m68hc11.c: Don't include stdio.h.
(md_show_usage): Fix missing continuation.
* Makefile.am: Run "make dep-am".
* Makefile.in: Regenerate.
ld/ChangeLog
* emultempl/sh64elf.em: Include elf32-sh64.h.
(sh64_elf_${EMULATION_NAME}_before_allocation): Adjust for changed
sh64_elf_section_data.
(sh64_elf_${EMULATION_NAME}_after_allocation): Likewise.
+2003-01-23 Alan Modra <amodra@bigpond.net.au>
+
+ * elf-bfd.h (struct bfd_elf_section_data): Remove tdata. Change
+ dynindx to an int. Rearrange for better packing.
+ * elf.c (_bfd_elf_new_section_hook): Don't alloc if already done.
+ * elf32-mips.c (bfd_elf32_new_section_hook): Define.
+ * elf32-sh64.h: New. Split out from include/elf/sh.h.
+ (struct _sh64_elf_section_data): New struct.
+ (sh64_elf_section_data): Don't dereference sh64_info (was tdata).
+ * elf32-sh64-com.c: Include elf32-sh64.h.
+ * elf32-sh64.c: Likewise.
+ (sh64_elf_new_section_hook): New function.
+ (bfd_elf32_new_section_hook): Define.
+ (sh64_elf_fake_sections): Adjust for sh64_elf_section_data change.
+ (sh64_bfd_elf_copy_private_section_data): Likewise.
+ (sh64_elf_final_write_processing): Likewise.
+ * elf32-sparc.c (struct elf32_sparc_section_data): New.
+ (elf32_sparc_new_section_hook): New function.
+ (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
+ (sec_do_relax): Define.
+ (elf32_sparc_relax_section): Adjust to use sec_do_relax.
+ (elf32_sparc_relocate_section): Likewise.
+ * elf64-mips.c (bfd_elf64_new_section_hook): Define.
+ * elf64-mmix.c (struct _mmix_elf_section_data): New.
+ (mmix_elf_section_data): Define. Use throughout file.
+ (mmix_elf_new_section_hook): New function.
+ (bfd_elf64_new_section_hook): Define.
+ * elf64-ppc.c (struct _ppc64_elf_section_data): New.
+ (ppc64_elf_section_data): Define. Use throughout.
+ (ppc64_elf_new_section_hook): New function.
+ (bfd_elf64_new_section_hook): Define.
+ * elf64-sparc.c (struct sparc64_elf_section_data): New.
+ (sparc64_elf_new_section_hook): New function.
+ (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete.
+ (sec_do_relax): Define.
+ (sparc64_elf_relax_section): Adjust to use sec_do_relax.
+ (sparc64_elf_relocate_section): Likewise.
+ (bfd_elf64_new_section_hook): Define.
+ * elfn32-mips.c (bfd_elf32_new_section_hook): Define.
+ * elfxx-mips.c (struct _mips_elf_section_data): New.
+ (mips_elf_section_data): Define. Use throughout.
+ (_bfd_mips_elf_new_section_hook): New function.
+ (mips_elf_create_got_section): Don't alloc used_by_bfd.
+ * elfxx-mips.h (_bfd_mips_elf_new_section_hook): Declare.
+ * elfxx-target.h (bfd_elfNN_new_section_hook): Add #ifndef.
+ * Makefile.am: Run "make dep-am".
+ * Makefile.in: Regenerate.
+
2003-01-21 Richard Henderson <rth@redhat.com>
* elf64-alpha.c (ALPHA_ELF_LINK_HASH_PLT_LOC): New.
elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
- elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+ elf32-sh64.h elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h \
- $(INCDIR)/elf/reloc-macros.h $(srcdir)/../opcodes/sh64-opc.h
+ $(INCDIR)/elf/reloc-macros.h elf32-sh64.h $(srcdir)/../opcodes/sh64-opc.h
elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \
elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
- elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+ elf32-sh64.h elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
elf32-target.h
elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h \
- $(INCDIR)/elf/reloc-macros.h $(srcdir)/../opcodes/sh64-opc.h
+ $(INCDIR)/elf/reloc-macros.h elf32-sh64.h $(srcdir)/../opcodes/sh64-opc.h
elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \
/* BFD back-end data structures for ELF files.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002 Free Software Foundation, Inc.
+ 2002, 2003 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
/* The number of relocations currently assigned to REL_HDR2. */
unsigned int rel_count2;
- /* A pointer to a linked list tracking dynamic relocs copied for
- local symbols. */
- PTR local_dynrel;
-
- /* A pointer to the bfd section used for dynamic relocs. */
- asection *sreloc;
-
/* The ELF section number of this section. Only used for an output
file. */
int this_idx;
REL_HDR2 if any. Only used for an output file. */
int rel_idx2;
+ /* Used by the backend linker when generating a shared library to
+ record the dynamic symbol index for a section symbol
+ corresponding to this section. A value of 0 means that there is
+ no dynamic symbol for this section. */
+ int dynindx;
+
/* Used by the backend linker to store the symbol hash table entries
associated with relocs against global symbols. */
struct elf_link_hash_entry **rel_hashes;
pointer may be NULL. It is used by the backend linker. */
Elf_Internal_Rela *relocs;
- /* Used by the backend linker when generating a shared library to
- record the dynamic symbol index for a section symbol
- corresponding to this section. A value of 0 means that there is
- no dynamic symbol for this section. */
- long dynindx;
-
- /* A pointer used for various section optimizations. */
- PTR sec_info;
+ /* A pointer to a linked list tracking dynamic relocs copied for
+ local symbols. */
+ PTR local_dynrel;
- /* Type of that information. */
- enum elf_link_info_type sec_info_type;
+ /* A pointer to the bfd section used for dynamic relocs. */
+ asection *sreloc;
union {
/* Group name, if this section is a member of a group. */
the linker. */
asection *next_in_group;
- /* A pointer available for the processor specific ELF backend. */
- PTR tdata;
+ /* A pointer used for various section optimizations. */
+ PTR sec_info;
+
+ /* Type of sec_info information. */
+ enum elf_link_info_type sec_info_type;
/* Nonzero if this section uses RELA relocations, rather than REL. */
unsigned int use_rela_p:1;
/* ELF executable support for BFD.
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
asection *sec;
{
struct bfd_elf_section_data *sdata;
- bfd_size_type amt = sizeof (*sdata);
- sdata = (struct bfd_elf_section_data *) bfd_zalloc (abfd, amt);
- if (!sdata)
- return FALSE;
- sec->used_by_bfd = (PTR) sdata;
+ sdata = (struct bfd_elf_section_data *) sec->used_by_bfd;
+ if (sdata == NULL)
+ {
+ bfd_size_type amt = sizeof (*sdata);
+ sdata = (struct bfd_elf_section_data *) bfd_zalloc (abfd, amt);
+ if (sdata == NULL)
+ return FALSE;
+ sec->used_by_bfd = (PTR) sdata;
+ }
/* Indicate whether or not this section should use RELA relocations. */
sdata->use_rela_p
/* MIPS-specific support for 32-bit ELF
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003 Free Software Foundation, Inc.
Most of the information added by Ian Lance Taylor, Cygnus Support,
<ian@cygnus.com>.
#define bfd_elf32_bfd_is_local_label_name \
mips_elf_is_local_label_name
#define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line
+#define bfd_elf32_new_section_hook _bfd_mips_elf_new_section_hook
#define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents
#define bfd_elf32_bfd_get_relocated_section_contents \
_bfd_elf_mips_get_relocated_section_contents
/* Hitachi SH64-specific support for 32-bit ELF
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/sh.h"
+#include "elf32-sh64.h"
#include "../opcodes/sh64-opc.h"
static bfd_boolean sh64_address_in_cranges
#include "sysdep.h"
#include "elf-bfd.h"
#include "../opcodes/sh64-opc.h"
+#include "elf32-sh64.h"
/* Add a suffix for datalabel indirection symbols. It must not match any
other symbols; user symbols with or without version or other
bfd_vma addr;
};
+static bfd_boolean sh64_elf_new_section_hook
+ PARAMS ((bfd *, asection *));
static bfd_boolean sh64_elf_copy_private_data
PARAMS ((bfd *, bfd *));
static bfd_boolean sh64_elf_merge_private_data
#define elf_backend_final_write_processing sh64_elf_final_write_processing
#define elf_backend_section_from_shdr sh64_backend_section_from_shdr
+#define bfd_elf32_new_section_hook sh64_elf_new_section_hook
+
/* For objcopy, we need to set up sh64_elf_section_data (asection *) from
incoming section flags. This is otherwise done in sh64elf.em when
linking or tc-sh64.c when assembling. */
#define INCLUDE_SHMEDIA
#include "elf32-sh.c"
+/* Tack some extra info on struct bfd_elf_section_data. */
+
+static bfd_boolean
+sh64_elf_new_section_hook (abfd, sec)
+ bfd *abfd;
+ asection *sec;
+{
+ struct _sh64_elf_section_data *sdata;
+ bfd_size_type amt = sizeof (*sdata);
+
+ sdata = (struct _sh64_elf_section_data *) bfd_zalloc (abfd, amt);
+ if (sdata == NULL)
+ return FALSE;
+ sec->used_by_bfd = (PTR) sdata;
+
+ return _bfd_elf_new_section_hook (abfd, sec);
+}
+
/* Set the SHF_SH5_ISA32 flag for ISA SHmedia code sections, and pass
through SHT_SH5_CR_SORTED on a sorted .cranges section. */
Elf_Internal_Shdr *elf_section_hdr;
asection *asect;
{
- if (sh64_elf_section_data (asect) != NULL)
+ if (sh64_elf_section_data (asect)->sh64_info != NULL)
elf_section_hdr->sh_flags
- |= sh64_elf_section_data (asect)->contents_flags;
+ |= sh64_elf_section_data (asect)->sh64_info->contents_flags;
/* If this section has the SEC_SORT_ENTRIES flag set, it is a sorted
.cranges section passing through objcopy. */
if (! _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec))
return FALSE;
- sh64_sec_data = sh64_elf_section_data (isec);
+ sh64_sec_data = sh64_elf_section_data (isec)->sh64_info;
if (sh64_sec_data == NULL)
{
sh64_sec_data = bfd_zmalloc (sizeof (struct sh64_section_data));
= (elf_section_data (isec)->this_hdr.sh_flags
& (SHF_SH5_ISA32 | SHF_SH5_ISA32_MIXED));
- sh64_elf_section_data (osec) = sh64_sec_data;
+ sh64_elf_section_data (osec)->sh64_info = sh64_sec_data;
}
return TRUE;
&& cranges != NULL
&& elf_elfheader (abfd)->e_type != ET_EXEC
&& (ld_generated_cranges_size
- = sh64_elf_section_data (cranges)->cranges_growth) != 0)
+ = sh64_elf_section_data (cranges)->sh64_info->cranges_growth) != 0)
{
bfd_vma incoming_cranges_size
= ((cranges->_cooked_size != 0
--- /dev/null
+/* SH ELF support for BFD.
+ Copyright 2003 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef ELF32_SH64_H
+#define ELF32_SH64_H
+
+#define SH64_CRANGES_SECTION_NAME ".cranges"
+enum sh64_elf_cr_type {
+ CRT_NONE = 0,
+ CRT_DATA = 1,
+ CRT_SH5_ISA16 = 2,
+ CRT_SH5_ISA32 = 3
+};
+
+/* The official definition is this:
+
+ typedef struct {
+ Elf32_Addr cr_addr;
+ Elf32_Word cr_size;
+ Elf32_Half cr_type;
+ } Elf32_CRange;
+
+ but we have no use for that exact type. Instead we use this struct for
+ the internal representation. */
+typedef struct {
+ bfd_vma cr_addr;
+ bfd_size_type cr_size;
+ enum sh64_elf_cr_type cr_type;
+} sh64_elf_crange;
+
+#define SH64_CRANGE_SIZE (4 + 4 + 2)
+#define SH64_CRANGE_CR_ADDR_OFFSET 0
+#define SH64_CRANGE_CR_SIZE_OFFSET 4
+#define SH64_CRANGE_CR_TYPE_OFFSET (4 + 4)
+
+/* Get the contents type of an arbitrary address, or return CRT_NONE. */
+extern enum sh64_elf_cr_type sh64_get_contents_type
+ PARAMS ((asection *, bfd_vma, sh64_elf_crange *));
+
+/* Simpler interface.
+ FIXME: This seems redundant now that we export the interface above. */
+extern bfd_boolean sh64_address_is_shmedia PARAMS ((asection *, bfd_vma));
+
+extern int _bfd_sh64_crange_qsort_cmpb PARAMS ((const void *, const void *));
+extern int _bfd_sh64_crange_qsort_cmpl PARAMS ((const void *, const void *));
+extern int _bfd_sh64_crange_bsearch_cmpb PARAMS ((const void *, const void *));
+extern int _bfd_sh64_crange_bsearch_cmpl PARAMS ((const void *, const void *));
+
+struct sh64_section_data
+{
+ flagword contents_flags;
+
+ /* Only used in the cranges section, but we don't have an official
+ backend-specific bfd field. */
+ bfd_size_type cranges_growth;
+};
+
+struct _sh64_elf_section_data
+{
+ struct bfd_elf_section_data elf;
+ struct sh64_section_data *sh64_info;
+};
+
+#define sh64_elf_section_data(sec) \
+ ((struct _sh64_elf_section_data *) elf_section_data (sec))
+
+#endif /* ELF32_SH64_H */
/* SPARC-specific support for 32-bit ELF
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
static bfd_boolean elf32_sparc_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
+static bfd_boolean elf32_sparc_new_section_hook
+ PARAMS ((bfd *, asection *));
static bfd_boolean elf32_sparc_relax_section
PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *));
static bfd_boolean elf32_sparc_relocate_section
return TRUE;
}
-#define SET_SEC_DO_RELAX(section) do { elf_section_data(section)->tdata = (void *)1; } while (0)
-#define SEC_DO_RELAX(section) (elf_section_data(section)->tdata == (void *)1)
+struct elf32_sparc_section_data
+{
+ struct bfd_elf_section_data elf;
+ unsigned int do_relax;
+};
+
+#define sec_do_relax(sec) \
+ ((struct elf32_sparc_section_data *) (sec)->used_by_bfd)->do_relax
+
+static bfd_boolean
+elf32_sparc_new_section_hook (abfd, sec)
+ bfd *abfd;
+ asection *sec;
+{
+ struct elf32_sparc_section_data *sdata;
+ bfd_size_type amt = sizeof (*sdata);
+
+ sdata = (struct elf32_sparc_section_data *) bfd_zalloc (abfd, amt);
+ if (sdata == NULL)
+ return FALSE;
+ sec->used_by_bfd = (PTR) sdata;
+
+ return _bfd_elf_new_section_hook (abfd, sec);
+}
static bfd_boolean
elf32_sparc_relax_section (abfd, section, link_info, again)
bfd_boolean *again;
{
*again = FALSE;
- SET_SEC_DO_RELAX (section);
+ sec_do_relax (section) = 1;
return TRUE;
}
r = bfd_reloc_ok;
}
else if ((r_type == R_SPARC_WDISP30 || r_type == R_SPARC_WPLT30)
- && SEC_DO_RELAX (input_section)
+ && sec_do_relax (input_section)
&& rel->r_offset + 4 < input_section->_raw_size)
{
#define G0 0
/* MIPS-specific support for 64-bit ELF
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Ian Lance Taylor, Cygnus Support
Linker support added by Mark Mitchell, CodeSourcery, LLC.
MIPS-specific function only applies to IRIX5, which had no 64-bit
ABI. */
#define bfd_elf64_find_nearest_line _bfd_mips_elf_find_nearest_line
+#define bfd_elf64_new_section_hook _bfd_mips_elf_new_section_hook
#define bfd_elf64_set_section_contents _bfd_mips_elf_set_section_contents
#define bfd_elf64_bfd_get_relocated_section_contents \
_bfd_elf_mips_get_relocated_section_contents
/* MMIX-specific support for 64-bit ELF.
- Copyright 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Hans-Peter Nilsson <hp@bitrange.com>
This file is part of BFD, the Binary File Descriptor library.
_bfd_abort (__FILE__, __LINE__, \
"bad case for " #x)
+struct _mmix_elf_section_data
+{
+ struct bfd_elf_section_data elf;
+ union
+ {
+ struct bpo_reloc_section_info *reloc;
+ struct bpo_greg_section_info *greg;
+ } bpo;
+};
+
+#define mmix_elf_section_data(sec) \
+ ((struct _mmix_elf_section_data *) (sec)->used_by_bfd)
+
/* For each section containing a base-plus-offset (BPO) reloc, we attach
- this struct as elf_section_data (section)->tdata, which is otherwise
+ this struct as mmix_elf_section_data (section)->bpo, which is otherwise
NULL. */
struct bpo_reloc_section_info
{
bfd_boolean valid;
};
-/* We attach this as elf_section_data (sec)->tdata in the linker-allocated
+/* We attach this as mmix_elf_section_data (sec)->bpo in the linker-allocated
greg contents section (MMIX_LD_ALLOCATED_REG_CONTENTS_SECTION_NAME),
which is linked into the register contents section
(MMIX_REG_CONTENTS_SECTION_NAME). This section is created by the
static int mmix_elf_sort_relocs PARAMS ((const PTR, const PTR));
+static bfd_boolean mmix_elf_new_section_hook
+ PARAMS ((bfd *, asection *));
+
static bfd_boolean mmix_elf_check_relocs
PARAMS ((bfd *, struct bfd_link_info *, asection *,
const Elf_Internal_Rela *));
return NULL;
}
+static bfd_boolean
+mmix_elf_new_section_hook (abfd, sec)
+ bfd *abfd;
+ asection *sec;
+{
+ struct _mmix_elf_section_data *sdata;
+ bfd_size_type amt = sizeof (*sdata);
+
+ sdata = (struct _mmix_elf_section_data *) bfd_zalloc (abfd, amt);
+ if (sdata == NULL)
+ return FALSE;
+ sec->used_by_bfd = (PTR) sdata;
+
+ return _bfd_elf_new_section_hook (abfd, sec);
+}
+
/* This function performs the actual bitfiddling and sanity check for a
final relocation. Each relocation gets its *worst*-case expansion
case R_MMIX_BASE_PLUS_OFFSET:
{
struct bpo_reloc_section_info *bpodata
- = (struct bpo_reloc_section_info *)
- elf_section_data (isec)->tdata;
+ = mmix_elf_section_data (isec)->bpo.reloc;
asection *bpo_greg_section
= bpodata->bpo_greg_section;
struct bpo_greg_section_info *gregdata
- = (struct bpo_greg_section_info *)
- elf_section_data (bpo_greg_section)->tdata;
+ = mmix_elf_section_data (bpo_greg_section)->bpo.greg;
size_t bpo_index
= gregdata->bpo_reloc_indexes[bpodata->bpo_index++];
const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED;
{
struct bpo_reloc_section_info *bpodata
- = (struct bpo_reloc_section_info *)
- elf_section_data (sec)->tdata;
+ = mmix_elf_section_data (sec)->bpo.reloc;
asection *allocated_gregs_section;
/* If no bpodata here, we have nothing to do. */
allocated_gregs_section = bpodata->bpo_greg_section;
- ((struct bpo_greg_section_info *)
- elf_section_data (allocated_gregs_section)->tdata)
- ->n_bpo_relocs
+ mmix_elf_section_data (allocated_gregs_section)->bpo.greg->n_bpo_relocs
-= bpodata->n_bpo_relocs_this_section;
return TRUE;
bfd_zalloc (bpo_greg_owner, sizeof (struct bpo_greg_section_info));
if (gregdata == NULL)
return FALSE;
- elf_section_data (allocated_gregs_section)->tdata = gregdata;
+ mmix_elf_section_data (allocated_gregs_section)->bpo.greg
+ = gregdata;
}
else if (gregdata == NULL)
- gregdata = elf_section_data (allocated_gregs_section)->tdata;
+ gregdata
+ = mmix_elf_section_data (allocated_gregs_section)->bpo.greg;
/* Get ourselves some auxiliary info for the BPO-relocs. */
if (bpodata == NULL)
* (sec->reloc_count + 1));
if (bpodata == NULL)
return FALSE;
- elf_section_data (sec)->tdata = bpodata;
+ mmix_elf_section_data (sec)->bpo.reloc = bpodata;
bpodata->first_base_plus_offset_reloc
= bpodata->bpo_index
= gregdata->n_max_bpo_relocs;
return TRUE;
/* We use the target-data handle in the ELF section data. */
- gregdata = (struct bpo_greg_section_info *)
- elf_section_data (bpo_gregs_section)->tdata;
+ gregdata = mmix_elf_section_data (bpo_gregs_section)->bpo.greg;
if (gregdata == NULL)
return FALSE;
/* We use the target-data handle in the ELF section data. */
- gregdata = (struct bpo_greg_section_info *)
- elf_section_data (bpo_gregs_section)->tdata;
+ gregdata = mmix_elf_section_data (bpo_gregs_section)->bpo.greg;
if (gregdata == NULL)
return FALSE;
if (bpo_gregs_section == NULL)
return;
- gregdata = (struct bpo_greg_section_info *)
- elf_section_data (bpo_gregs_section)->tdata;
+ gregdata = mmix_elf_section_data (bpo_gregs_section)->bpo.greg;
if (gregdata == NULL)
return;
asection *bpo_gregs_section = NULL;
struct bpo_greg_section_info *gregdata;
struct bpo_reloc_section_info *bpodata
- = (struct bpo_reloc_section_info *)
- elf_section_data (sec)->tdata;
+ = mmix_elf_section_data (sec)->bpo.reloc;
size_t bpono;
bfd *bpo_greg_owner;
Elf_Internal_Sym *isymbuf = NULL;
bpo_greg_owner = (bfd *) link_info->base_file;
bpo_gregs_section = bpodata->bpo_greg_section;
- gregdata = (struct bpo_greg_section_info *)
- elf_section_data (bpo_gregs_section)->tdata;
+ gregdata = mmix_elf_section_data (bpo_gregs_section)->bpo.greg;
bpono = bpodata->first_base_plus_offset_reloc;
#define elf_backend_section_from_bfd_section \
mmix_elf_section_from_bfd_section
+#define bfd_elf64_new_section_hook mmix_elf_new_section_hook
#define bfd_elf64_bfd_final_link mmix_elf_final_link
#define bfd_elf64_bfd_relax_section mmix_elf_relax_section
PARAMS ((bfd *));
static bfd_boolean ppc64_elf_merge_private_bfd_data
PARAMS ((bfd *, bfd *));
+static bfd_boolean ppc64_elf_new_section_hook
+ PARAMS ((bfd *, asection *));
/* The name of the dynamic interpreter. This is put in the .interp
return TRUE;
}
+
+struct _ppc64_elf_section_data
+{
+ struct bfd_elf_section_data elf;
+ union
+ {
+ asection **func_sec;
+ long *adjust;
+ } opd;
+};
+
+#define ppc64_elf_section_data(sec) \
+ ((struct _ppc64_elf_section_data *) (sec)->used_by_bfd)
+
+static bfd_boolean
+ppc64_elf_new_section_hook (abfd, sec)
+ bfd *abfd;
+ asection *sec;
+{
+ struct _ppc64_elf_section_data *sdata;
+ bfd_size_type amt = sizeof (*sdata);
+
+ sdata = (struct _ppc64_elf_section_data *) bfd_zalloc (abfd, amt);
+ if (sdata == NULL)
+ return FALSE;
+ sec->used_by_bfd = (PTR) sdata;
+
+ return _bfd_elf_new_section_hook (abfd, sec);
+}
\f
/* The following functions are specific to the ELF linker, while
functions above are used generally. Those named ppc64_elf_* are
opd_sym_map = (asection **) bfd_zalloc (abfd, amt);
if (opd_sym_map == NULL)
return FALSE;
- elf_section_data (sec)->tdata = opd_sym_map;
+ ppc64_elf_section_data (sec)->opd.func_sec = opd_sym_map;
}
if (htab->elf.dynobj == NULL)
sections, as all functions are referenced in .opd. */
else if ((fdh->oh != NULL
&& ((struct ppc_link_hash_entry *) fdh->oh)->is_entry)
- || elf_section_data (sec)->tdata == NULL)
+ || ppc64_elf_section_data (sec)->opd.func_sec == NULL)
rsec = h->root.u.def.section;
break;
asection **opd_sym_section;
rsec = bfd_section_from_elf_index (sec->owner, sym->st_shndx);
- opd_sym_section = (asection **) elf_section_data (rsec)->tdata;
+ opd_sym_section = ppc64_elf_section_data (rsec)->opd.func_sec;
if (opd_sym_section != NULL)
rsec = opd_sym_section[sym->st_value / 24];
- else if (elf_section_data (sec)->tdata != NULL)
+ else if (ppc64_elf_section_data (sec)->opd.func_sec != NULL)
rsec = NULL;
}
continue;
amt = sec->_raw_size * sizeof (long) / 24;
- adjust = (long *) elf_section_data (sec)->tdata;
+ adjust = ppc64_elf_section_data (sec)->opd.adjust;
if (adjust == NULL)
{
/* Must be a ld -r link. ie. check_relocs hasn't been
called. */
adjust = (long *) bfd_zalloc (obfd, amt);
- elf_section_data (sec)->tdata = adjust;
+ ppc64_elf_section_data (sec)->opd.adjust = adjust;
}
memset (adjust, 0, (size_t) amt);
TOCstart = elf_gp (output_bfd);
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (input_bfd);
- is_opd = elf_section_data (input_section)->tdata != NULL;
+ is_opd = ppc64_elf_section_data (input_section)->opd.adjust != NULL;
rel = relocs;
relend = relocs + input_section->reloc_count;
{
long *opd_sym_adjust;
- opd_sym_adjust = (long *) elf_section_data (sec)->tdata;
+ opd_sym_adjust = ppc64_elf_section_data (sec)->opd.adjust;
if (opd_sym_adjust != NULL && sym->st_value % 24 == 0)
relocation += opd_sym_adjust[sym->st_value / 24];
}
#define bfd_elf64_bfd_reloc_type_lookup ppc64_elf_reloc_type_lookup
#define bfd_elf64_bfd_merge_private_bfd_data ppc64_elf_merge_private_bfd_data
+#define bfd_elf64_new_section_hook ppc64_elf_new_section_hook
#define bfd_elf64_bfd_link_hash_table_create ppc64_elf_link_hash_table_create
#define bfd_elf64_bfd_link_hash_table_free ppc64_elf_link_hash_table_free
/* SPARC-specific support for 64-bit ELF
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
static const char *sparc64_elf_print_symbol_all
PARAMS ((bfd *, PTR, asymbol *));
+static bfd_boolean sparc64_elf_new_section_hook
+ PARAMS ((bfd *, asection *));
static bfd_boolean sparc64_elf_relax_section
PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *));
static bfd_boolean sparc64_elf_relocate_section
return TRUE;
}
\f
-#define SET_SEC_DO_RELAX(section) do { elf_section_data(section)->tdata = (void *)1; } while (0)
-#define SEC_DO_RELAX(section) (elf_section_data(section)->tdata == (void *)1)
+struct sparc64_elf_section_data
+{
+ struct bfd_elf_section_data elf;
+ unsigned int do_relax;
+};
+
+#define sec_do_relax(sec) \
+ ((struct sparc64_elf_section_data *) (sec)->used_by_bfd)->do_relax
+
+static bfd_boolean
+sparc64_elf_new_section_hook (abfd, sec)
+ bfd *abfd;
+ asection *sec;
+{
+ struct sparc64_elf_section_data *sdata;
+ bfd_size_type amt = sizeof (*sdata);
+
+ sdata = (struct sparc64_elf_section_data *) bfd_zalloc (abfd, amt);
+ if (sdata == NULL)
+ return FALSE;
+ sec->used_by_bfd = (PTR) sdata;
+
+ return _bfd_elf_new_section_hook (abfd, sec);
+}
static bfd_boolean
sparc64_elf_relax_section (abfd, section, link_info, again)
bfd_boolean *again;
{
*again = FALSE;
- SET_SEC_DO_RELAX (section);
+ sec_do_relax (section) = 1;
return TRUE;
}
\f
case R_SPARC_WDISP30:
do_wplt30:
- if (SEC_DO_RELAX (input_section)
+ if (sec_do_relax (input_section)
&& rel->r_offset + 4 < input_section->_raw_size)
{
#define G0 0
sparc64_elf_reloc_type_lookup
#define bfd_elf64_bfd_relax_section \
sparc64_elf_relax_section
+#define bfd_elf64_new_section_hook \
+ sparc64_elf_new_section_hook
#define elf_backend_create_dynamic_sections \
_bfd_elf_create_dynamic_sections
#define elf_backend_mips_irix_compat elf_n32_mips_irix_compat
#define elf_backend_mips_rtype_to_howto mips_elf_n32_rtype_to_howto
#define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line
+#define bfd_elf32_new_section_hook _bfd_mips_elf_new_section_hook
#define bfd_elf32_set_section_contents _bfd_mips_elf_set_section_contents
#define bfd_elf32_bfd_get_relocated_section_contents \
_bfd_elf_mips_get_relocated_section_contents
unsigned long gotidx;
};
-/* This structure is used to hold .got information when linking. It
- is stored in the tdata field of the bfd_elf_section_data structure. */
+/* This structure is used to hold .got information when linking. */
struct mips_got_info
{
struct htab *got_entries;
};
+struct _mips_elf_section_data
+{
+ struct bfd_elf_section_data elf;
+ union
+ {
+ struct mips_got_info *got_info;
+ bfd_byte *tdata;
+ } u;
+};
+
+#define mips_elf_section_data(sec) \
+ ((struct _mips_elf_section_data *) (sec)->used_by_bfd)
+
/* This structure is passed to mips_elf_sort_hash_table_f when sorting
the dynamic symbols. */
return (struct bfd_hash_entry *) ret;
}
+
+bfd_boolean
+_bfd_mips_elf_new_section_hook (abfd, sec)
+ bfd *abfd;
+ asection *sec;
+{
+ struct _mips_elf_section_data *sdata;
+ bfd_size_type amt = sizeof (*sdata);
+
+ sdata = (struct _mips_elf_section_data *) bfd_zalloc (abfd, amt);
+ if (sdata == NULL)
+ return FALSE;
+ sec->used_by_bfd = (PTR) sdata;
+
+ return _bfd_elf_new_section_hook (abfd, sec);
+}
\f
/* Read ECOFF debugging information from a .mdebug section into a
ecoff_debug_info structure. */
sgot = mips_elf_got_section (abfd);
BFD_ASSERT (sgot != NULL);
- BFD_ASSERT (elf_section_data (sgot) != NULL);
- g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
+ BFD_ASSERT (mips_elf_section_data (sgot) != NULL);
+ g = mips_elf_section_data (sgot)->u.got_info;
BFD_ASSERT (g != NULL);
if (sgotp)
(htab_del) NULL);
if (g->got_entries == NULL)
return FALSE;
- if (elf_section_data (s) == NULL)
- {
- amt = sizeof (struct bfd_elf_section_data);
- s->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
- if (elf_section_data (s) == NULL)
- return FALSE;
- }
- elf_section_data (s)->tdata = (PTR) g;
- elf_section_data (s)->this_hdr.sh_flags
+ mips_elf_section_data (s)->u.got_info = g;
+ mips_elf_section_data (s)->elf.this_hdr.sh_flags
|= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
return TRUE;
if (hdr->sh_type == SHT_MIPS_OPTIONS
&& hdr->bfd_section != NULL
- && elf_section_data (hdr->bfd_section) != NULL
- && elf_section_data (hdr->bfd_section)->tdata != NULL)
+ && mips_elf_section_data (hdr->bfd_section) != NULL
+ && mips_elf_section_data (hdr->bfd_section)->u.tdata != NULL)
{
bfd_byte *contents, *l, *lend;
- /* We stored the section contents in the elf_section_data tdata
- field in the set_section_contents routine. We save the
- section contents so that we don't have to read them again.
+ /* We stored the section contents in the tdata field in the
+ set_section_contents routine. We save the section contents
+ so that we don't have to read them again.
At this point we know that elf_gp is set, so we can look
through the section contents to see if there is an
ODK_REGINFO structure. */
- contents = (bfd_byte *) elf_section_data (hdr->bfd_section)->tdata;
+ contents = mips_elf_section_data (hdr->bfd_section)->u.tdata;
l = contents;
lend = contents + hdr->sh_size;
while (l + sizeof (Elf_External_Options) <= lend)
g = NULL;
else
{
- BFD_ASSERT (elf_section_data (sgot) != NULL);
- g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
+ BFD_ASSERT (mips_elf_section_data (sgot) != NULL);
+ g = mips_elf_section_data (sgot)->u.got_info;
BFD_ASSERT (g != NULL);
}
}
bfd_size_type local_gotno;
bfd *sub;
- BFD_ASSERT (elf_section_data (s) != NULL);
- g = (struct mips_got_info *) elf_section_data (s)->tdata;
+ BFD_ASSERT (mips_elf_section_data (s) != NULL);
+ g = mips_elf_section_data (s)->u.got_info;
BFD_ASSERT (g != NULL);
/* Calculate the total loadable size of the output. That
sgot = mips_elf_got_section (dynobj);
BFD_ASSERT (sgot != NULL);
BFD_ASSERT (elf_section_data (sgot) != NULL);
- g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
+ g = mips_elf_section_data (sgot)->u.got_info;
BFD_ASSERT (g != NULL);
/* Run through the global symbol table, creating GOT entries for all
else
{
BFD_ASSERT (elf_section_data (sgot) != NULL);
- g = (struct mips_got_info *) elf_section_data (sgot)->tdata;
+ g = mips_elf_section_data (sgot)->u.got_info;
BFD_ASSERT (g != NULL);
}
dynobj = elf_hash_table (info)->dynobj;
got = bfd_get_section_by_name (dynobj, ".got");
- g = (struct mips_got_info *) elf_section_data (got)->tdata;
+ g = mips_elf_section_data (got)->u.got_info;
_bfd_elf_link_hash_hide_symbol (info, &h->root, force_local);
if (skip != 0)
{
- elf_section_data (o)->tdata = tdata;
+ mips_elf_section_data (o)->u.tdata = tdata;
o->_cooked_size = o->_raw_size - skip * PDR_SIZE;
ret = TRUE;
}
if (strcmp (sec->name, ".pdr") != 0)
return FALSE;
- if (elf_section_data (sec)->tdata == NULL)
+ if (mips_elf_section_data (sec)->u.tdata == NULL)
return FALSE;
to = contents;
from < end;
from += PDR_SIZE, i++)
{
- if (((unsigned char *) elf_section_data (sec)->tdata)[i] == 1)
+ if ((mips_elf_section_data (sec)->u.tdata)[i] == 1)
continue;
if (to != from)
memcpy (to, from, PDR_SIZE);
if (elf_section_data (section) == NULL)
return FALSE;
}
- c = (bfd_byte *) elf_section_data (section)->tdata;
+ c = mips_elf_section_data (section)->u.tdata;
if (c == NULL)
{
bfd_size_type size;
c = (bfd_byte *) bfd_zalloc (abfd, size);
if (c == NULL)
return FALSE;
- elf_section_data (section)->tdata = (PTR) c;
+ mips_elf_section_data (section)->u.tdata = c;
}
memcpy (c + offset, location, (size_t) count);
/* Make sure we didn't grow the global .got region. */
dynobj = elf_hash_table (info)->dynobj;
got = bfd_get_section_by_name (dynobj, ".got");
- g = (struct mips_got_info *) elf_section_data (got)->tdata;
+ g = mips_elf_section_data (got)->u.got_info;
if (g->global_gotsym != NULL)
BFD_ASSERT ((elf_hash_table (info)->dynsymcount
/* MIPS ELF specific backend routines.
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#include "elf/common.h"
#include "elf/internal.h"
+extern bfd_boolean _bfd_mips_elf_new_section_hook
+ PARAMS ((bfd *, asection *));
extern void _bfd_mips_elf_symbol_processing
PARAMS ((bfd *, asymbol *));
extern bfd_boolean _bfd_mips_elf_section_processing
/* Target definitions for NN-bit ELF
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#define bfd_elfNN_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol
#endif
#define bfd_elfNN_make_empty_symbol _bfd_elf_make_empty_symbol
+#ifndef bfd_elfNN_new_section_hook
#define bfd_elfNN_new_section_hook _bfd_elf_new_section_hook
+#endif
#define bfd_elfNN_set_arch_mach _bfd_elf_set_arch_mach
#ifndef bfd_elfNN_set_section_contents
#define bfd_elfNN_set_section_contents _bfd_elf_set_section_contents
+2003-01-23 Alan Modra <amodra@bigpond.net.au>
+
+ * config/tc-sh64.c (shmedia_frob_section_type): Adjust for changed
+ sh64_elf_section_data.
+ * config/tc-sh64.h: Include elf32-sh64.h.
+ * config/tc-m68hc11.c: Don't include stdio.h.
+ (md_show_usage): Fix missing continuation.
+ * Makefile.am: Run "make dep-am".
+ * Makefile.in: Regenerate.
+
2003-01-22 Nick Clifton <nickc@redhat.com>
* as.h: Include fopen-bin.h not fopen-same.h for mingw32 hosts.
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
- $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \
+ $(BFDDIR)/elf32-sh64.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \
$(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \
$(srcdir)/../opcodes/sh-opc.h struc-symbol.h dwarf2dbg.h
DEPTC_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \
DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
- $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h
+ $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+ $(BFDDIR)/elf32-sh64.h
DEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
DEP_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
$(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
- $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \
+ $(BFDDIR)/elf32-sh64.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \
$(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \
$(srcdir)/../opcodes/sh-opc.h struc-symbol.h dwarf2dbg.h
DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \
$(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
$(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \
- $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h
+ $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+ $(BFDDIR)/elf32-sh64.h
DEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "as.h"
#include "safe-ctype.h"
#include "subsegs.h"
get_default_target ();
fprintf (stream, _("\
Motorola 68HC11/68HC12/68HCS12 options:\n\
- -m68hc11 | -m68hc12 |
+ -m68hc11 | -m68hc12 |\n\
-m68hcs12 specify the processor [default %s]\n\
-mshort use 16-bit int ABI (default)\n\
-mlong use 32-bit int ABI\n\
/* tc-sh64.c -- Assemble code for the Hitachi Super-H SHcompact and SHmedia.
- Copyright 2000, 2001, 2002 Free Software Foundation.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation.
This file is part of GAS, the GNU Assembler.
else if (seginfo->tc_segment_info_data.contents_type == CRT_SH5_ISA32)
sec_type = SHF_SH5_ISA32;
- sec_elf_data = sh64_elf_section_data (sec);
+ sec_elf_data = sh64_elf_section_data (sec)->sh64_info;
if (sec_elf_data == NULL)
{
sec_elf_data = xcalloc (1, sizeof (*sec_elf_data));
- sh64_elf_section_data (sec) = sec_elf_data;
+ sh64_elf_section_data (sec)->sh64_info = sec_elf_data;
}
sec_elf_data->contents_flags = sec_type;
/* This file is tc-sh64.h
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
#define TC_SH64
#include "config/tc-sh.h"
#include "elf/sh.h"
+#include "elf32-sh64.h"
/* We need to override the tc-sh.h settings of HANDLE_ALIGN and
MAX_MEM_FOR_RS_ALIGN_CODE; we might need to put in SHmedia NOP:s, not
+2003-01-23 Alan Modra <amodra@bigpond.net.au>
+
+ * sh.h: Split out various bits to bfd/elf32-sh64.h.
+
2003-01-20 Martin Schwidefsky <schwidefsky@de.ibm.com>
* s390.h: Rename R_390_GOTOFF to R_390_GOTOFF32. Add new gotoff,
/* SH ELF support for BFD.
- Copyright 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
symbols). */
#define STT_DATALABEL STT_LOPROC
-#define SH64_CRANGES_SECTION_NAME ".cranges"
-enum sh64_elf_cr_type {
- CRT_NONE = 0,
- CRT_DATA = 1,
- CRT_SH5_ISA16 = 2,
- CRT_SH5_ISA32 = 3
-};
-
-/* The official definition is this:
-
- typedef struct {
- Elf32_Addr cr_addr;
- Elf32_Word cr_size;
- Elf32_Half cr_type;
- } Elf32_CRange;
-
- but we have no use for that exact type. Instead we use this struct for
- the internal representation. */
-typedef struct {
- bfd_vma cr_addr;
- bfd_size_type cr_size;
- enum sh64_elf_cr_type cr_type;
-} sh64_elf_crange;
-
-#define SH64_CRANGE_SIZE (4 + 4 + 2)
-#define SH64_CRANGE_CR_ADDR_OFFSET 0
-#define SH64_CRANGE_CR_SIZE_OFFSET 4
-#define SH64_CRANGE_CR_TYPE_OFFSET (4 + 4)
-
-/* Get the contents type of an arbitrary address, or return CRT_NONE. */
-extern enum sh64_elf_cr_type sh64_get_contents_type
- PARAMS ((asection *, bfd_vma, sh64_elf_crange *));
-
-/* Simpler interface.
- FIXME: This seems redundant now that we export the interface above. */
-extern bfd_boolean sh64_address_is_shmedia PARAMS ((asection *, bfd_vma));
-
-extern int _bfd_sh64_crange_qsort_cmpb PARAMS ((const void *, const void *));
-extern int _bfd_sh64_crange_qsort_cmpl PARAMS ((const void *, const void *));
-extern int _bfd_sh64_crange_bsearch_cmpb PARAMS ((const void *, const void *));
-extern int _bfd_sh64_crange_bsearch_cmpl PARAMS ((const void *, const void *));
-
-/* We put this in elf_section_data (section)->tdata. */
-struct sh64_section_data
-{
- flagword contents_flags;
-
- /* Only used in the cranges section, but we don't have an official
- backend-specific bfd field. */
- bfd_size_type cranges_growth;
-};
-
-#define sh64_elf_section_data(sec) \
- ((struct sh64_section_data *) ((elf_section_data (sec))->tdata))
-
#include "elf/reloc-macros.h"
/* Relocations. */
+2003-01-23 Alan Modra <amodra@bigpond.net.au>
+
+ * m68hc11.h (cpu6812s): Define.
+
2003-01-07 Chris Demetriou <cgd@broadcom.com>
* mips.h: Fix missing space in comment.
/* m68hc11.h -- Header file for Motorola 68HC11 & 68HC12 opcode table
- Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@nerim.fr)
This file is part of GDB, GAS, and the GNU binutils.
/* CPU identification. */
#define cpu6811 0x01
#define cpu6812 0x02
+#define cpu6812s 0x04
/* The opcode table is an array of struct m68hc11_opcode. */
struct m68hc11_opcode {
extern const int m68hc12_num_alias;
#endif /* _OPCODE_M68HC11_H */
-
+2003-01-23 Alan Modra <amodra@bigpond.net.au>
+
+ * emultempl/sh64elf.em: Include elf32-sh64.h.
+ (sh64_elf_${EMULATION_NAME}_before_allocation): Adjust for changed
+ sh64_elf_section_data.
+ (sh64_elf_${EMULATION_NAME}_after_allocation): Likewise.
+
2003-01-23 Wu Yongwei <adah@netstd.com>
* ld.texinfo: Remove an extra "i" in --dll-search-prefix.
# This shell script emits a C file. -*- C -*-
-# Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GLD, the Gnu Linker.
#
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/sh.h"
+#include "elf32-sh64.h"
static void sh64_elf_${EMULATION_NAME}_before_allocation PARAMS ((void));
static void sh64_elf_${EMULATION_NAME}_after_allocation PARAMS ((void));
if (bfd_get_flavour (output_bfd) != bfd_target_elf_flavour)
einfo (_("%FError: non-ELF output formats are not supported by this target's linker.\n"));
- sh64_sec_data = sh64_elf_section_data (osec);
+ sh64_sec_data = sh64_elf_section_data (osec)->sh64_info;
/* Omit excluded or garbage-collected sections. */
if (bfd_get_section_flags (output_bfd, osec) & SEC_EXCLUDE)
if (sh64_sec_data == NULL)
{
sh64_sec_data = xcalloc (1, sizeof (struct sh64_section_data));
- sh64_elf_section_data (osec) = sh64_sec_data;
+ sh64_elf_section_data (osec)->sh64_info = sh64_sec_data;
}
/* First find an input section so we have flags to compare with; the
{
oflags_isa = SHF_SH5_ISA32_MIXED;
- BFD_ASSERT (sh64_elf_section_data (osec) != NULL);
+ BFD_ASSERT (sh64_elf_section_data (osec)->sh64_info);
- sh64_elf_section_data (osec)->contents_flags
+ sh64_elf_section_data (osec)->sh64_info->contents_flags
= SHF_SH5_ISA32_MIXED;
need_check_cranges = TRUE;
goto break_2;
}
BFD_ASSERT (cranges->contents == NULL);
- BFD_ASSERT (sh64_elf_section_data (cranges) != NULL);
+ BFD_ASSERT (sh64_elf_section_data (cranges)->sh64_info != NULL);
/* Make sure we have .cranges in memory even if there were only
assembler-generated .cranges. */
out the number of generated .cranges. */
if (new_cranges == 0)
{
- sh64_elf_section_data (cranges)->cranges_growth = 0;
+ sh64_elf_section_data (cranges)->sh64_info->cranges_growth = 0;
return;
}
/* Omit excluded or garbage-collected sections, and output sections
which were not marked as needing further processing. */
if ((bfd_get_section_flags (output_bfd, osec) & SEC_EXCLUDE) != 0
- || (sh64_elf_section_data (osec)->contents_flags
+ || (sh64_elf_section_data (osec)->sh64_info->contents_flags
!= SHF_SH5_ISA32_MIXED))
continue;
Sorting before writing is done by sh64_elf_final_write_processing. */
cranges->_cooked_size = crangesp - cranges->contents;
- sh64_elf_section_data (cranges)->cranges_growth
+ sh64_elf_section_data (cranges)->sh64_info->cranges_growth
= cranges->_cooked_size - cranges->_raw_size;
cranges->_raw_size = cranges->_cooked_size;
}
+2003-01-23 Alan Modra <amodra@bigpond.net.au>
+
+ * sh64-dis.c: Include elf32-sh64.h.
+ * Makefile.am: Run "make dep-am".
+ * Makefile.in: Regenerate.
+
2003-01-17 Richard Henderson <rth@redhat.com>
* alpha-opc.c (alpha_opcodes): Add bugchk, rduniq, wruniq, gentrap
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h sysdep.h config.h \
sh64-opc.h $(INCDIR)/libiberty.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h
+ $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+ $(BFDDIR)/elf32-sh64.h
sh64-opc.lo: sh64-opc.c sh64-opc.h
sparc-dis.lo: sparc-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/opcode/sparc.h $(INCDIR)/dis-asm.h $(BFD_H) \
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h sysdep.h config.h \
sh64-opc.h $(INCDIR)/libiberty.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h
+ $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+ $(BFDDIR)/elf32-sh64.h
sh64-opc.lo: sh64-opc.c sh64-opc.h
sparc-dis.lo: sparc-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/opcode/sparc.h $(INCDIR)/dis-asm.h $(BFD_H) \
/* Disassemble SH64 instructions.
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* We need to refer to the ELF header structure. */
#include "elf-bfd.h"
#include "elf/sh.h"
+#include "elf32-sh64.h"
#define ELF_MODE32_CODE_LABEL_P(SYM) \
(((elf_symbol_type *) (SYM))->internal_elf_sym.st_other & STO_SH5_ISA32)