aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-01-23 11:51:35 +0000
committerAlan Modra <amodra@gmail.com>2003-01-23 11:51:35 +0000
commitf0abc2a11f47c3ecdfe0b54421092d17c70fc5f2 (patch)
tree8e22fc0b8a4086a9c0f64272619db724cc6b1123
parent489d0400afe4b18c94ce8b6195fa3d91978ecb08 (diff)
downloadgdb-f0abc2a11f47c3ecdfe0b54421092d17c70fc5f2.zip
gdb-f0abc2a11f47c3ecdfe0b54421092d17c70fc5f2.tar.gz
gdb-f0abc2a11f47c3ecdfe0b54421092d17c70fc5f2.tar.bz2
include/elf/ChangeLog
* 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.
-rw-r--r--bfd/ChangeLog48
-rw-r--r--bfd/Makefile.am4
-rw-r--r--bfd/Makefile.in4
-rw-r--r--bfd/elf-bfd.h37
-rw-r--r--bfd/elf.c18
-rw-r--r--bfd/elf32-mips.c5
-rw-r--r--bfd/elf32-sh64-com.c3
-rw-r--r--bfd/elf32-sh64.c33
-rw-r--r--bfd/elf32-sh64.h83
-rw-r--r--bfd/elf32-sparc.c36
-rw-r--r--bfd/elf64-mips.c3
-rw-r--r--bfd/elf64-mmix.c75
-rw-r--r--bfd/elf64-ppc.c48
-rw-r--r--bfd/elf64-sparc.c38
-rw-r--r--bfd/elfn32-mips.c1
-rw-r--r--bfd/elfxx-mips.c85
-rw-r--r--bfd/elfxx-mips.h4
-rw-r--r--bfd/elfxx-target.h6
-rw-r--r--gas/ChangeLog10
-rw-r--r--gas/Makefile.am5
-rw-r--r--gas/Makefile.in5
-rw-r--r--gas/config/tc-m68hc11.c3
-rw-r--r--gas/config/tc-sh64.c6
-rw-r--r--gas/config/tc-sh64.h3
-rw-r--r--include/elf/ChangeLog4
-rw-r--r--include/elf/sh.h57
-rw-r--r--include/opcode/ChangeLog4
-rw-r--r--include/opcode/m68hc11.h4
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/emultempl/sh64elf.em19
-rw-r--r--opcodes/ChangeLog6
-rw-r--r--opcodes/Makefile.am3
-rw-r--r--opcodes/Makefile.in3
-rw-r--r--opcodes/sh64-dis.c3
34 files changed, 473 insertions, 200 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f292935..2bfec17 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,51 @@
+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.
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index d6c6aa0..bc92764 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -1253,12 +1253,12 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.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 \
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 1d6c04d..f3a9830 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -1786,12 +1786,12 @@ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.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 \
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 8e5e024..394f70c 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1,6 +1,6 @@
/* 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.
@@ -941,13 +941,6 @@ struct bfd_elf_section_data
/* 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;
@@ -960,6 +953,12 @@ struct bfd_elf_section_data
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;
@@ -969,17 +968,12 @@ struct bfd_elf_section_data
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. */
@@ -993,8 +987,11 @@ struct bfd_elf_section_data
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;
diff --git a/bfd/elf.c b/bfd/elf.c
index 22349bd..7c20971 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1,6 +1,6 @@
/* 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.
@@ -2136,12 +2136,16 @@ _bfd_elf_new_section_hook (abfd, sec)
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
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 485bd2c..1399f00 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -1,6 +1,6 @@
/* 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>.
@@ -1917,6 +1917,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
#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
diff --git a/bfd/elf32-sh64-com.c b/bfd/elf32-sh64-com.c
index d89d7c7..107e504 100644
--- a/bfd/elf32-sh64-com.c
+++ b/bfd/elf32-sh64-com.c
@@ -1,5 +1,5 @@
/* 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.
@@ -24,6 +24,7 @@
#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
diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c
index 492fd73..13953e6 100644
--- a/bfd/elf32-sh64.c
+++ b/bfd/elf32-sh64.c
@@ -23,6 +23,7 @@
#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
@@ -37,6 +38,8 @@ struct sh64_find_section_vma_data
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
@@ -85,6 +88,8 @@ static void sh64_find_section_for_address
#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. */
@@ -100,6 +105,24 @@ static void sh64_find_section_for_address
#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. */
@@ -109,9 +132,9 @@ sh64_elf_fake_sections (output_bfd, elf_section_hdr, asect)
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. */
@@ -300,7 +323,7 @@ sh64_bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec)
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));
@@ -312,7 +335,7 @@ sh64_bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec)
= (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;
@@ -656,7 +679,7 @@ sh64_elf_final_write_processing (abfd, linker)
&& 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
diff --git a/bfd/elf32-sh64.h b/bfd/elf32-sh64.h
new file mode 100644
index 0000000..87af05b
--- /dev/null
+++ b/bfd/elf32-sh64.h
@@ -0,0 +1,83 @@
+/* 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 */
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index 07137ba..93285f8 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -1,6 +1,6 @@
/* 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.
@@ -37,6 +37,8 @@ static bfd_boolean elf32_sparc_adjust_dynamic_symbol
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
@@ -1067,8 +1069,30 @@ elf32_sparc_size_dynamic_sections (output_bfd, info)
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)
@@ -1078,7 +1102,7 @@ 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;
}
@@ -1590,7 +1614,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
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
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index 50fcfba..d29f286 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -1,5 +1,5 @@
/* 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.
@@ -2746,6 +2746,7 @@ const struct elf_size_info mips_elf64_size_info =
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
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c
index 3cca228..a7b2806 100644
--- a/bfd/elf64-mmix.c
+++ b/bfd/elf64-mmix.c
@@ -1,5 +1,5 @@
/* 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.
@@ -41,8 +41,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
_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
{
@@ -83,7 +96,7 @@ struct bpo_reloc_request
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
@@ -135,6 +148,9 @@ static void mmix_info_to_howto_rela
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 *));
@@ -795,6 +811,22 @@ bfd_elf64_bfd_reloc_type_lookup (abfd, code)
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
@@ -983,13 +1015,11 @@ mmix_elf_perform_relocation (isec, howto, datap, addr, value)
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++];
@@ -1573,8 +1603,7 @@ mmix_elf_gc_sweep_hook (abfd, info, sec, relocs)
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. */
@@ -1583,9 +1612,7 @@ mmix_elf_gc_sweep_hook (abfd, info, sec, relocs)
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;
@@ -1698,10 +1725,12 @@ mmix_elf_check_common_relocs (abfd, info, sec, relocs)
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)
@@ -1714,7 +1743,7 @@ mmix_elf_check_common_relocs (abfd, info, sec, relocs)
* (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;
@@ -2084,8 +2113,7 @@ _bfd_mmix_prepare_linker_allocated_gregs (abfd, info)
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;
@@ -2163,8 +2191,7 @@ _bfd_mmix_finalize_linker_allocated_gregs (abfd, link_info)
/* 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;
@@ -2260,8 +2287,7 @@ mmix_dump_bpo_gregs (link_info, pf)
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;
@@ -2313,8 +2339,7 @@ mmix_elf_relax_section (abfd, sec, link_info, again)
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;
@@ -2343,8 +2368,7 @@ mmix_elf_relax_section (abfd, sec, link_info, again)
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;
@@ -2560,6 +2584,7 @@ mmix_elf_relax_section (abfd, sec, link_info, again)
#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
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index ec4032f..2ca139d 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -56,6 +56,8 @@ static bfd_boolean ppc64_elf_object_p
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
@@ -1675,6 +1677,35 @@ ppc64_elf_merge_private_bfd_data (ibfd, obfd)
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);
+}
/* The following functions are specific to the ELF linker, while
functions above are used generally. Those named ppc64_elf_* are
@@ -2564,7 +2595,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs)
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)
@@ -2939,7 +2970,7 @@ ppc64_elf_gc_mark_hook (sec, info, rel, h, sym)
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;
@@ -2957,10 +2988,10 @@ ppc64_elf_gc_mark_hook (sec, info, rel, h, sym)
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;
}
@@ -3563,13 +3594,13 @@ ppc64_elf_edit_opd (obfd, info)
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);
@@ -5305,7 +5336,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
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;
@@ -5361,7 +5392,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{
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];
}
@@ -6338,6 +6369,7 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info)
#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
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index c3a3f05..7e38d97 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -1,6 +1,6 @@
/* 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.
@@ -77,6 +77,8 @@ static bfd_boolean sparc64_elf_fake_sections
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
@@ -1868,8 +1870,30 @@ sparc64_elf_size_dynamic_sections (output_bfd, info)
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 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)
@@ -1879,7 +1903,7 @@ 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;
}
@@ -2456,7 +2480,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
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
@@ -3116,6 +3140,8 @@ const struct elf_size_info sparc64_elf_size_info =
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
diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c
index 269c98c..00a0e88 100644
--- a/bfd/elfn32-mips.c
+++ b/bfd/elfn32-mips.c
@@ -2199,6 +2199,7 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
#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
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 3164a2e..a2fcd03 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -61,8 +61,7 @@ struct mips_got_entry
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
{
@@ -79,6 +78,19 @@ 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. */
@@ -638,6 +650,22 @@ mips_elf_link_hash_newfunc (entry, table, string)
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);
+}
/* Read ECOFF debugging information from a .mdebug section into a
ecoff_debug_info structure. */
@@ -1467,8 +1495,8 @@ mips_elf_got_info (abfd, sgotp)
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)
@@ -1997,15 +2025,8 @@ mips_elf_create_got_section (abfd, info)
(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;
@@ -3310,19 +3331,19 @@ _bfd_mips_elf_section_processing (abfd, hdr)
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)
@@ -4289,8 +4310,8 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs)
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);
}
}
@@ -4803,8 +4824,8 @@ _bfd_mips_elf_size_dynamic_sections (output_bfd, info)
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
@@ -5527,7 +5548,7 @@ _bfd_mips_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
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
@@ -5675,7 +5696,7 @@ _bfd_mips_elf_finish_dynamic_sections (output_bfd, info)
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);
}
@@ -6504,7 +6525,7 @@ _bfd_mips_elf_hide_symbol (info, entry, force_local)
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);
@@ -6565,7 +6586,7 @@ _bfd_mips_elf_discard_info (abfd, cookie, info)
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;
}
@@ -6599,7 +6620,7 @@ _bfd_mips_elf_write_section (output_bfd, sec, contents)
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;
@@ -6608,7 +6629,7 @@ _bfd_mips_elf_write_section (output_bfd, sec, 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);
@@ -6758,7 +6779,7 @@ _bfd_mips_elf_set_section_contents (abfd, section, location, offset, count)
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;
@@ -6770,7 +6791,7 @@ _bfd_mips_elf_set_section_contents (abfd, section, location, offset, count)
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);
@@ -7070,7 +7091,7 @@ _bfd_mips_elf_final_link (abfd, info)
/* 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
diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h
index 9b935c6..3f77943 100644
--- a/bfd/elfxx-mips.h
+++ b/bfd/elfxx-mips.h
@@ -1,5 +1,5 @@
/* 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.
@@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#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
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index c3ff104..69e3782 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -1,6 +1,6 @@
/* 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.
@@ -53,7 +53,9 @@
#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
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 80db1d4..42973b8 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,13 @@
+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.
diff --git a/gas/Makefile.am b/gas/Makefile.am
index 11213bf..15f8f18 100644
--- a/gas/Makefile.am
+++ b/gas/Makefile.am
@@ -1398,7 +1398,7 @@ DEPTC_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.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
DEPTC_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \
@@ -2290,7 +2290,8 @@ DEP_sh_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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 \
diff --git a/gas/Makefile.in b/gas/Makefile.in
index 9828c78..75e8767 100644
--- a/gas/Makefile.in
+++ b/gas/Makefile.in
@@ -1188,7 +1188,7 @@ DEPTC_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.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
@@ -2312,7 +2312,8 @@ DEP_sh_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.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
diff --git a/gas/config/tc-m68hc11.c b/gas/config/tc-m68hc11.c
index a56ff04..da0f2ba 100644
--- a/gas/config/tc-m68hc11.c
+++ b/gas/config/tc-m68hc11.c
@@ -19,7 +19,6 @@
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"
@@ -376,7 +375,7 @@ md_show_usage (stream)
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\
diff --git a/gas/config/tc-sh64.c b/gas/config/tc-sh64.c
index c6321f2..aa5f71e 100644
--- a/gas/config/tc-sh64.c
+++ b/gas/config/tc-sh64.c
@@ -1,5 +1,5 @@
/* 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.
@@ -463,11 +463,11 @@ shmedia_frob_section_type (sec)
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;
diff --git a/gas/config/tc-sh64.h b/gas/config/tc-sh64.h
index ad631c5..c5758d2 100644
--- a/gas/config/tc-sh64.h
+++ b/gas/config/tc-sh64.h
@@ -1,5 +1,5 @@
/* 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.
@@ -21,6 +21,7 @@
#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
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index f0e71c5..110a72b 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,7 @@
+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,
diff --git a/include/elf/sh.h b/include/elf/sh.h
index 68a2c54..dd19b76 100644
--- a/include/elf/sh.h
+++ b/include/elf/sh.h
@@ -1,5 +1,5 @@
/* 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.
@@ -71,61 +71,6 @@
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. */
diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog
index e40f056..c7c4484 100644
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,7 @@
+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.
diff --git a/include/opcode/m68hc11.h b/include/opcode/m68hc11.h
index a538026..5d2fc9b 100644
--- a/include/opcode/m68hc11.h
+++ b/include/opcode/m68hc11.h
@@ -1,5 +1,5 @@
/* 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.
@@ -388,6 +388,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
/* CPU identification. */
#define cpu6811 0x01
#define cpu6812 0x02
+#define cpu6812s 0x04
/* The opcode table is an array of struct m68hc11_opcode. */
struct m68hc11_opcode {
@@ -424,4 +425,3 @@ extern const struct m68hc12_opcode_alias m68hc12_alias[];
extern const int m68hc12_num_alias;
#endif /* _OPCODE_M68HC11_H */
-
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 8bf5234..992a4b9 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+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.
diff --git a/ld/emultempl/sh64elf.em b/ld/emultempl/sh64elf.em
index 8ec2c31..066cab8 100644
--- a/ld/emultempl/sh64elf.em
+++ b/ld/emultempl/sh64elf.em
@@ -1,5 +1,5 @@
# 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.
#
@@ -31,6 +31,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
#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));
@@ -129,7 +130,7 @@ sh64_elf_${EMULATION_NAME}_before_allocation ()
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)
@@ -139,7 +140,7 @@ sh64_elf_${EMULATION_NAME}_before_allocation ()
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
@@ -330,9 +331,9 @@ sh64_elf_${EMULATION_NAME}_after_allocation ()
{
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;
@@ -378,7 +379,7 @@ sh64_elf_${EMULATION_NAME}_after_allocation ()
}
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. */
@@ -395,7 +396,7 @@ sh64_elf_${EMULATION_NAME}_after_allocation ()
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;
}
@@ -415,7 +416,7 @@ sh64_elf_${EMULATION_NAME}_after_allocation ()
/* 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;
@@ -561,7 +562,7 @@ sh64_elf_${EMULATION_NAME}_after_allocation ()
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;
}
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 2ad3f85..1cdad7f 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
index a25c248..d3ecd6f 100644
--- a/opcodes/Makefile.am
+++ b/opcodes/Makefile.am
@@ -766,7 +766,8 @@ sh64-dis.lo: sh64-dis.c $(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) \
diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in
index 8eed565..4939324 100644
--- a/opcodes/Makefile.in
+++ b/opcodes/Makefile.in
@@ -1262,7 +1262,8 @@ sh64-dis.lo: sh64-dis.c $(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) \
diff --git a/opcodes/sh64-dis.c b/opcodes/sh64-dis.c
index 631678c..063c261 100644
--- a/opcodes/sh64-dis.c
+++ b/opcodes/sh64-dis.c
@@ -1,5 +1,5 @@
/* 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
@@ -25,6 +25,7 @@
/* 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)