This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fixes to BFD for all-targets build


Hi Guys,

  I am about to check in the following patches to fix building BFD
  with --enable-targets=all.

Cheers
	Nick

2000-02-29  H.J. Lu  <hjl@gnu.org>

	* peicode.h (jtab): Make it static.

	* coff-sh.c (sh_align_load_span): Declared if COFF_WITH_PE is
	defined and COFF_IMAGE_WITH_PE is not defined.
	(_bfd_sh_align_load_span): Defined as sh_align_load_span if
	COFF_WITH_PE is defined and COFF_IMAGE_WITH_PE is not defined.

Index: peicode.h
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/peicode.h,v
retrieving revision 1.1.1.7
retrieving revision 1.2
diff -u -p -r1.1.1.7 -r1.2
--- peicode.h	2000/02/29 19:00:23	1.1.1.7
+++ peicode.h	2000/03/01 16:25:54	1.2
@@ -697,7 +697,7 @@ typedef struct
 }
 jump_table;
 
-jump_table jtab[] =
+static jump_table jtab[] =
 {
 #ifdef I386MAGIC
   { I386MAGIC,

Index: coff-sh.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/coff-sh.c,v
retrieving revision 1.1.1.8
retrieving revision 1.3
diff -u -p -r1.1.1.8 -r1.3
--- coff-sh.c	2000/02/29 19:00:06	1.1.1.8
+++ coff-sh.c	2000/03/01 18:00:35	1.3
@@ -29,7 +29,16 @@ Foundation, Inc., 59 Temple Place - Suit
 
 #ifdef COFF_WITH_PE
 #include "coff/pe.h"
+
+#ifndef COFF_IMAGE_WITH_PE
+static boolean sh_align_load_span 
+  PARAMS ((bfd *, asection *, bfd_byte *,
+	   boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma),
+	   PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, boolean *));
+
+#define _bfd_sh_align_load_span sh_align_load_span
 #endif
+#endif
 
 #include "libcoff.h"
 
@@ -2395,6 +2404,9 @@ sh_load_use (i1, op1, i2, op2)
    STOP are the range of memory to examine.  If a swap is made,
    *PSWAPPED is set to true.  */
 
+#ifdef COFF_WITH_PE
+static
+#endif
 boolean
 _bfd_sh_align_load_span (abfd, sec, contents, swap, relocs,
 			 plabel, label_end, start, stop, pswapped)


2000-03-01  Nick Clifton  <nickc@cygnus.com>

	* coff-arm.c (bfd_arm_process_before_allocation): Make
	'symndx' signed to prevent compile time warning.

	* coff-mcore.c: Remove unused prototype for pe_object_p.

	* coff-sh.c: Add "#ifndef COFF_IMAGE_WITH_PE" around static
	functions that are not used when COFF_IMAGE_WITH_PE is
	defined.
	(struct sh_opcode): Change type of 'flags' field to unsigned
	long so that it can hold the USESAS flag.

	* coffcode.h (styp_to_sec_flags): Initialise 'target_name'.

	* elf-m10300.c (mn10300_elf_relax_section): Initialise
        'sym_sec'.

	* elf32-i370.c: Add ATTRIBUTE_UNUSED to unused function
	parameters.
	Remove unusued variables and code.
	(elf_backend_add_symbol_hook): Fix prototype.

	* elf32-m68k.c (elf_m68k_gc_sweep_hook): Initialise 'sgot' and
	'srelgot'.

	* elf32-mcore.c (mcore_elf_relocate_section): Initialise
	'oldinst'. 

	* elf32-mips.c: Add ATTRIBUTE_UNUSED to unused function
	parameters.
	Remove unusued variables and code.
	(elf_backend_add_symbol_hook): Fix prototype.

	* elf32-sh.c (sh_elf_set_mach_from_flags): Use 'flags'.

	* elflink.h (elf_bfd_link_add_symbols): Add ATTRIBUTE_UNUSED
	to unused function parameter.
	
	* pe-mips.c: Add ATTRIBUTE_UNUSED to unused function
	parameters.
	Use EMPTY_HOWTO to initialise empty howto slots.
	Remove unused variables.

	* peicode.h (pe_ILF_build_a_bfd): Initialise id6.	

Index: coff-arm.c
===================================================================
RCS file: /cvs/src//src/bfd/coff-arm.c,v
retrieving revision 1.14
diff -p -r1.14 coff-arm.c
*** coff-arm.c	2000/02/28 18:56:10	1.14
--- coff-arm.c	2000/03/01 19:31:01
*************** bfd_arm_process_before_allocation (abfd,
*** 2045,2051 ****
        for (rel = i; rel < i + sec->reloc_count; ++rel) 
  	{
  	  unsigned short                 r_type  = rel->r_type;
! 	  unsigned long                  symndx;
  	  struct coff_link_hash_entry *  h;
  
  	  symndx = rel->r_symndx;
--- 2045,2051 ----
        for (rel = i; rel < i + sec->reloc_count; ++rel) 
  	{
  	  unsigned short                 r_type  = rel->r_type;
! 	  long                           symndx;
  	  struct coff_link_hash_entry *  h;
  
  	  symndx = rel->r_symndx;

Index: coff-mcore.c
===================================================================
RCS file: /cvs/src//src/bfd/coff-mcore.c,v
retrieving revision 1.13
diff -p -r1.13 coff-mcore.c
*** coff-mcore.c	2000/01/20 19:08:42	1.13
--- coff-mcore.c	2000/03/01 19:31:01
*************** static reloc_howto_type *           mcor
*** 52,61 ****
  static reloc_howto_type *           coff_mcore_rtype_to_howto
    PARAMS ((bfd *, asection *, struct internal_reloc *,
  	   struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *));
- static const bfd_target *           pe_object_p
-   PARAMS ((bfd *));
- 
- 
  
  /* The NT loader points the toc register to &toc + 32768, in order to
     use the complete range of a 16-bit displacement. We have to adjust
--- 52,57 ----

Index: coff-sh.c
===================================================================
RCS file: /cvs/src//src/bfd/coff-sh.c,v
retrieving revision 1.9
diff -p -r1.9 coff-sh.c
*** coff-sh.c	2000/02/28 18:56:10	1.9
--- coff-sh.c	2000/03/01 19:31:01
*************** static boolean sh_relax_section
*** 41,47 ****
--- 50,58 ----
    PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *));
  static boolean sh_relax_delete_bytes
    PARAMS ((bfd *, asection *, bfd_vma, int));
+ #ifndef COFF_IMAGE_WITH_PE
  static const struct sh_opcode *sh_insn_info PARAMS ((unsigned int));
+ #endif
  static boolean sh_align_loads
    PARAMS ((bfd *, asection *, struct internal_reloc *, bfd_byte *, boolean *));
  static boolean sh_swap_insns
*************** static boolean sh_relocate_section
*** 52,58 ****
  static bfd_byte *sh_coff_get_relocated_section_contents
    PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
  	   bfd_byte *, boolean, asymbol **));
! 
  #ifdef COFF_WITH_PE
  /* Can't build import tables with 2**4 alignment.  */
  #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER	2
--- 63,69 ----
  static bfd_byte *sh_coff_get_relocated_section_contents
    PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
  	   bfd_byte *, boolean, asymbol **));
!  
  #ifdef COFF_WITH_PE
  /* Can't build import tables with 2**4 alignment.  */
  #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER	2
*************** get_symbol_value (symbol)       
*** 402,408 ****
  
  static reloc_howto_type *
  coff_sh_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
!      bfd * abfd;
       asection * sec;
       struct internal_reloc * rel;
       struct coff_link_hash_entry * h;
--- 413,419 ----
  
  static reloc_howto_type *
  coff_sh_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
!      bfd * abfd ATTRIBUTE_UNUSED;
       asection * sec;
       struct internal_reloc * rel;
       struct coff_link_hash_entry * h;
*************** struct sh_opcode
*** 1547,1553 ****
       mask value in the sh_major_opcode structure.  */
    unsigned short opcode;
    /* Flags for this instruction.  */
!   unsigned short flags;
  };
  
  /* Flag which appear in the sh_opcode structure.  */
--- 1558,1564 ----
       mask value in the sh_major_opcode structure.  */
    unsigned short opcode;
    /* Flags for this instruction.  */
!   unsigned long flags;
  };
  
  /* Flag which appear in the sh_opcode structure.  */
*************** struct sh_opcode
*** 1620,1625 ****
--- 1631,1637 ----
  #define SETSAS (0x40000)
  #define SETSAS_REG(x) USESAS_REG (x)
  
+ #ifndef COFF_IMAGE_WITH_PE
  static boolean sh_insn_uses_reg
    PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
  static boolean sh_insn_sets_reg
*************** static boolean sh_insns_conflict
*** 1638,1644 ****
  static boolean sh_load_use
    PARAMS ((unsigned int, const struct sh_opcode *, unsigned int,
  	   const struct sh_opcode *));
! 
  /* The opcode maps.  */
  
  #define MAP(a) a, sizeof a / sizeof a[0]
--- 1650,1656 ----
  static boolean sh_load_use
    PARAMS ((unsigned int, const struct sh_opcode *, unsigned int,
  	   const struct sh_opcode *));
! #endif
  /* The opcode maps.  */
  
  #define MAP(a) a, sizeof a / sizeof a[0]
*************** static const struct sh_minor_opcode sh_d
*** 2101,2106 ****
--- 2113,2119 ----
    { MAP (sh_dsp_opcodef0), 0xfc0d }
  };
  
+ #ifndef COFF_IMAGE_WITH_PE
  /* Given an instruction, return a pointer to the corresponding
     sh_opcode structure.  Return NULL if the instruction is not
     recognized.  */
*************** sh_load_use (i1, op1, i2, op2)
*** 2384,2390 ****
    return false;
  }
  
- #ifndef COFF_IMAGE_WITH_PE
  /* Try to align loads and stores within a span of memory.  This is
     called by both the ELF and the COFF sh targets.  ABFD and SEC are
     the BFD and section we are examining.  CONTENTS is the contents of
--- 2397,2402 ----
*************** sh_load_use (i1, op1, i2, op2)
*** 2395,2400 ****
--- 2407,2415 ----
     STOP are the range of memory to examine.  If a swap is made,
     *PSWAPPED is set to true.  */
  
+ #ifdef COFF_WITH_PE
+ static
+ #endif
  boolean
  _bfd_sh_align_load_span (abfd, sec, contents, swap, relocs,
  			 plabel, label_end, start, stop, pswapped)
*************** _bfd_sh_align_load_span (abfd, sec, cont
*** 2604,2610 ****
  
    return true;
  }
! #endif
  
  /* Look for loads and stores which we can align to four byte
     boundaries.  See the longer comment above sh_relax_section for why
--- 2619,2626 ----
  
    return true;
  }
! #endif /* not COFF_IMAGE_WITH_PE */
! 
  
  /* Look for loads and stores which we can align to four byte
     boundaries.  See the longer comment above sh_relax_section for why

Index: coffcode.h
===================================================================
RCS file: /cvs/src//src/bfd/coffcode.h,v
retrieving revision 1.32
diff -p -r1.32 coffcode.h
*** coffcode.h	2000/02/28 18:56:10	1.32
--- coffcode.h	2000/03/01 19:31:01
*************** styp_to_sec_flags (abfd, hdr, name, sect
*** 760,766 ****
  	{
  	  bfd_byte *esymstart, *esym, *esymend;
  	  int seen_state = 0;
! 	  char *target_name;
  
  	  esymstart = esym = (bfd_byte *) obj_coff_external_syms (abfd);
  	  esymend = esym + obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd);
--- 760,766 ----
  	{
  	  bfd_byte *esymstart, *esym, *esymend;
  	  int seen_state = 0;
! 	  char *target_name = NULL;
  
  	  esymstart = esym = (bfd_byte *) obj_coff_external_syms (abfd);
  	  esymend = esym + obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd);

Index: elf-m10300.c
===================================================================
RCS file: /cvs/src//src/bfd/elf-m10300.c,v
retrieving revision 1.4
diff -p -r1.4 elf-m10300.c
*** elf-m10300.c	1999/12/01 10:14:02	1.4
--- elf-m10300.c	2000/03/01 19:31:02
*************** mn10300_elf_relax_section (abfd, sec, li
*** 849,855 ****
  	    {
  	      struct elf32_mn10300_link_hash_entry *hash;
  	      Elf_Internal_Sym *sym;
! 	      asection *sym_sec;
  	      const char *sym_name;
  	      char *new_name;
  
--- 849,855 ----
  	    {
  	      struct elf32_mn10300_link_hash_entry *hash;
  	      Elf_Internal_Sym *sym;
! 	      asection *sym_sec = NULL;
  	      const char *sym_name;
  	      char *new_name;
  
*************** mn10300_elf_relax_section (abfd, sec, li
*** 930,936 ****
  			    sym_sec = bfd_abs_section_ptr;
  			  else if (isym.st_shndx == SHN_COMMON)
  			    sym_sec = bfd_com_section_ptr;
! 
  			  sym_name = bfd_elf_string_from_elf_section (input_bfd,
  							   symtab_hdr->sh_link,
  							   isym.st_name);
--- 930,936 ----
  			    sym_sec = bfd_abs_section_ptr;
  			  else if (isym.st_shndx == SHN_COMMON)
  			    sym_sec = bfd_com_section_ptr;
! 			  
  			  sym_name = bfd_elf_string_from_elf_section (input_bfd,
  							   symtab_hdr->sh_link,
  							   isym.st_name);
*************** mn10300_elf_relax_section (abfd, sec, li
*** 1193,1199 ****
  		{
  		  Elf_Internal_Sym isym;
  		  struct elf32_mn10300_link_hash_entry *sym_hash;
! 		  asection *sym_sec;
  		  const char *sym_name;
  		  char *new_name;
  
--- 1193,1199 ----
  		{
  		  Elf_Internal_Sym isym;
  		  struct elf32_mn10300_link_hash_entry *sym_hash;
! 		  asection *sym_sec = NULL;
  		  const char *sym_name;
  		  char *new_name;
  
*************** mn10300_elf_relax_section (abfd, sec, li
*** 1211,1217 ****
  		    sym_sec = bfd_abs_section_ptr;
  		  else if (isym.st_shndx == SHN_COMMON)
  		    sym_sec = bfd_com_section_ptr;
! 
  		  sym_name = bfd_elf_string_from_elf_section (input_bfd,
  							symtab_hdr->sh_link,
  							isym.st_name);
--- 1211,1219 ----
  		    sym_sec = bfd_abs_section_ptr;
  		  else if (isym.st_shndx == SHN_COMMON)
  		    sym_sec = bfd_com_section_ptr;
! 		  else
! 		    abort ();
! 		  
  		  sym_name = bfd_elf_string_from_elf_section (input_bfd,
  							symtab_hdr->sh_link,
  							isym.st_name);
*************** mn10300_elf_relax_section (abfd, sec, li
*** 1461,1467 ****
        if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
  	{
  	  Elf_Internal_Sym isym;
! 	  asection *sym_sec;
  	  const char *sym_name;
  	  char *new_name;
  
--- 1463,1469 ----
        if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
  	{
  	  Elf_Internal_Sym isym;
! 	  asection *sym_sec = NULL;
  	  const char *sym_name;
  	  char *new_name;
  
*************** mn10300_elf_relax_section (abfd, sec, li
*** 1478,1484 ****
  	    sym_sec = bfd_abs_section_ptr;
  	  else if (isym.st_shndx == SHN_COMMON)
  	    sym_sec = bfd_com_section_ptr;
! 
  	  symval = (isym.st_value
  		    + sym_sec->output_section->vma
  		    + sym_sec->output_offset);
--- 1480,1488 ----
  	    sym_sec = bfd_abs_section_ptr;
  	  else if (isym.st_shndx == SHN_COMMON)
  	    sym_sec = bfd_com_section_ptr;
! 	  else
! 	    abort ();
! 	  
  	  symval = (isym.st_value
  		    + sym_sec->output_section->vma
  		    + sym_sec->output_offset);
Index: elf32-i370.c
===================================================================
RCS file: /cvs/src//src/bfd/elf32-i370.c,v
retrieving revision 1.1
diff -p -r1.1 elf32-i370.c
*** elf32-i370.c	2000/02/23 13:52:20	1.1
--- elf32-i370.c	2000/03/01 19:31:02
*************** i370_elf_howto_init ()
*** 280,286 ****
  
  static reloc_howto_type *
  i370_elf_reloc_type_lookup (abfd, code)
!      bfd *abfd;
       bfd_reloc_code_real_type code;
  {
    enum i370_reloc_type i370_reloc = R_I370_NONE;
--- 280,286 ----
  
  static reloc_howto_type *
  i370_elf_reloc_type_lookup (abfd, code)
!      bfd *abfd ATTRIBUTE_UNUSED;
       bfd_reloc_code_real_type code;
  {
    enum i370_reloc_type i370_reloc = R_I370_NONE;
*************** static boolean i370_elf_section_from_shd
*** 325,336 ****
  static boolean i370_elf_fake_sections PARAMS ((bfd *,
  					       Elf32_Internal_Shdr *,
  					       asection *));
! 
  static elf_linker_section_t *i370_elf_create_linker_section
    PARAMS ((bfd *abfd,
  	   struct bfd_link_info *info,
  	   enum elf_linker_section_enum));
! 
  static boolean i370_elf_check_relocs PARAMS ((bfd *,
  					     struct bfd_link_info *,
  					     asection *,
--- 325,336 ----
  static boolean i370_elf_fake_sections PARAMS ((bfd *,
  					       Elf32_Internal_Shdr *,
  					       asection *));
! #if 0
  static elf_linker_section_t *i370_elf_create_linker_section
    PARAMS ((bfd *abfd,
  	   struct bfd_link_info *info,
  	   enum elf_linker_section_enum));
! #endif
  static boolean i370_elf_check_relocs PARAMS ((bfd *,
  					     struct bfd_link_info *,
  					     asection *,
*************** static boolean i370_elf_finish_dynamic_s
*** 355,361 ****
  
  static void
  i370_elf_info_to_howto (abfd, cache_ptr, dst)
!      bfd *abfd;
       arelent *cache_ptr;
       Elf32_Internal_Rela *dst;
  {
--- 355,361 ----
  
  static void
  i370_elf_info_to_howto (abfd, cache_ptr, dst)
!      bfd *abfd ATTRIBUTE_UNUSED;
       arelent *cache_ptr;
       Elf32_Internal_Rela *dst;
  {
*************** i370_elf_section_from_shdr (abfd, hdr, n
*** 482,488 ****
  
  static boolean
  i370_elf_fake_sections (abfd, shdr, asect)
!      bfd *abfd;
       Elf32_Internal_Shdr *shdr;
       asection *asect;
  {
--- 482,488 ----
  
  static boolean
  i370_elf_fake_sections (abfd, shdr, asect)
!      bfd *abfd ATTRIBUTE_UNUSED;
       Elf32_Internal_Shdr *shdr;
       asection *asect;
  {
*************** i370_elf_fake_sections (abfd, shdr, asec
*** 496,501 ****
--- 496,502 ----
  }
  
  
+ #if 0
  /* Create a special linker section */
  /* XXX hack alert bogus This routine is mostly all junk and almost
   * certainly does the wrong thing.  Its here simply because it does
*************** i370_elf_create_linker_section (abfd, in
*** 571,577 ****
  
    return lsect;
  }
! 
  
  /* We have to create .dynsbss and .rela.sbss here so that they get mapped
     to output sections (just like _bfd_elf_create_dynamic_sections has
--- 572,578 ----
  
    return lsect;
  }
! #endif
  
  /* We have to create .dynsbss and .rela.sbss here so that they get mapped
     to output sections (just like _bfd_elf_create_dynamic_sections has
*************** i370_elf_adjust_dynamic_symbol (info, h)
*** 636,642 ****
    bfd *dynobj = elf_hash_table (info)->dynobj;
    asection *s;
    unsigned int power_of_two;
-   bfd_vma plt_offset;
  
  #ifdef DEBUG
    fprintf (stderr, "i370_elf_adjust_dynamic_symbol called for %s\n",
--- 637,642 ----
*************** i370_elf_check_relocs (abfd, info, sec, 
*** 1024,1034 ****
    const Elf_Internal_Rela *rel;
    const Elf_Internal_Rela *rel_end;
    bfd_vma *local_got_offsets;
-   elf_linker_section_t *sdata;
-   elf_linker_section_t *sdata2;
    asection *sreloc;
-   asection *sgot;
-   asection *srelgot = NULL;
  
    if (info->relocateable)
      return true;
--- 1024,1030 ----
*************** int i370_noop()
*** 1731,1738 ****
  
  #define elf_backend_add_symbol_hook \
    (boolean (*) PARAMS ((bfd *, struct bfd_link_info *, \
! 			const char *, Elf_Internal_Sym *, \
! 			asection *))) 				i370_noop
  #define elf_backend_finish_dynamic_symbol \
    (boolean (*) PARAMS ((bfd *, struct bfd_link_info *, \
  			struct elf_link_hash_entry *, \
--- 1727,1734 ----
  
  #define elf_backend_add_symbol_hook \
    (boolean (*) PARAMS ((bfd *, struct bfd_link_info *, \
! 			const Elf_Internal_Sym *, const char **, flagword *, \
! 			asection **, bfd_vma *))) 		i370_noop
  #define elf_backend_finish_dynamic_symbol \
    (boolean (*) PARAMS ((bfd *, struct bfd_link_info *, \
  			struct elf_link_hash_entry *, \

Index: elf32-m68k.c
===================================================================
RCS file: /cvs/src//src/bfd/elf32-m68k.c,v
retrieving revision 1.10
diff -p -r1.10 elf32-m68k.c
*** elf32-m68k.c	2000/02/13 22:45:29	1.10
--- elf32-m68k.c	2000/03/01 19:31:02
*************** elf_m68k_gc_sweep_hook (abfd, info, sec,
*** 847,854 ****
    unsigned long r_symndx;
    struct elf_link_hash_entry *h;
    bfd *dynobj;
!   asection *sgot;
!   asection *srelgot;
  
    symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
    sym_hashes = elf_sym_hashes (abfd);
--- 847,854 ----
    unsigned long r_symndx;
    struct elf_link_hash_entry *h;
    bfd *dynobj;
!   asection *sgot = NULL;
!   asection *srelgot = NULL;
  
    symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
    sym_hashes = elf_sym_hashes (abfd);

Index: elf32-mcore.c
===================================================================
RCS file: /cvs/src//src/bfd/elf32-mcore.c,v
retrieving revision 1.5
diff -p -r1.5 elf32-mcore.c
*** elf32-mcore.c	1999/07/12 10:29:24	1.5
--- elf32-mcore.c	2000/03/01 19:31:02
*************** mcore_elf_relocate_section (output_bfd, 
*** 454,460 ****
        Elf_Internal_Sym *           sym = (Elf_Internal_Sym *) 0;
        unsigned long                r_symndx;
        struct elf_link_hash_entry * h = (struct elf_link_hash_entry *) 0;
!       unsigned short               oldinst;
        
        /* Unknown relocation handling */
        if ((unsigned) r_type >= (unsigned) R_MCORE_max
--- 454,460 ----
        Elf_Internal_Sym *           sym = (Elf_Internal_Sym *) 0;
        unsigned long                r_symndx;
        struct elf_link_hash_entry * h = (struct elf_link_hash_entry *) 0;
!       unsigned short               oldinst = 0;
        
        /* Unknown relocation handling */
        if ((unsigned) r_type >= (unsigned) R_MCORE_max

Index: elf32-mips.c
===================================================================
RCS file: /cvs/src//src/bfd/elf32-mips.c,v
retrieving revision 1.56
diff -p -r1.56 elf32-mips.c
*** elf32-mips.c	2000/02/13 22:45:29	1.56
--- elf32-mips.c	2000/03/01 19:31:02
*************** static void bfd_mips_elf32_swap_gptab_in
*** 108,115 ****
--- 108,117 ----
    PARAMS ((bfd *, const Elf32_External_gptab *, Elf32_gptab *));
  static void bfd_mips_elf32_swap_gptab_out
    PARAMS ((bfd *, const Elf32_gptab *, Elf32_External_gptab *));
+ #if 0
  static void bfd_mips_elf_swap_msym_in 
    PARAMS ((bfd *, const Elf32_External_Msym *, Elf32_Internal_Msym *));
+ #endif
  static void bfd_mips_elf_swap_msym_out
    PARAMS ((bfd *, const Elf32_Internal_Msym *, Elf32_External_Msym *));
  static boolean mips_elf_sym_is_global PARAMS ((bfd *, asymbol *));
*************** bfd_mips_elf_swap_options_out (abfd, in,
*** 2115,2121 ****
    bfd_h_put_16 (abfd, in->section, ex->section);
    bfd_h_put_32 (abfd, in->info, ex->info);
  }
! 
  /* Swap in an MSYM entry.  */
  
  static void
--- 2117,2123 ----
    bfd_h_put_16 (abfd, in->section, ex->section);
    bfd_h_put_32 (abfd, in->info, ex->info);
  }
! #if 0
  /* Swap in an MSYM entry.  */
  
  static void
*************** bfd_mips_elf_swap_msym_in (abfd, ex, in)
*** 2127,2133 ****
    in->ms_hash_value = bfd_h_get_32 (abfd, ex->ms_hash_value);
    in->ms_info = bfd_h_get_32 (abfd, ex->ms_info);
  }
! 
  /* Swap out an MSYM entry.  */
  
  static void
--- 2129,2135 ----
    in->ms_hash_value = bfd_h_get_32 (abfd, ex->ms_hash_value);
    in->ms_info = bfd_h_get_32 (abfd, ex->ms_info);
  }
! #endif
  /* Swap out an MSYM entry.  */
  
  static void
*************** mips_elf_got_page (abfd, info, value, of
*** 5360,5366 ****
    struct mips_got_info *g;
    bfd_byte *entry;
    bfd_byte *last_entry;
!   bfd_vma index;
    bfd_vma address;
  
    g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
--- 5362,5368 ----
    struct mips_got_info *g;
    bfd_byte *entry;
    bfd_byte *last_entry;
!   bfd_vma index = 0;
    bfd_vma address;
  
    g = mips_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
*************** mips_elf_got16_entry (abfd, info, value)
*** 5409,5415 ****
    struct mips_got_info *g;
    bfd_byte *entry;
    bfd_byte *last_entry;
!   bfd_vma index;
    bfd_vma address;
  
    /* Although the ABI says that it is "the high-order 16 bits" that we
--- 5411,5417 ----
    struct mips_got_info *g;
    bfd_byte *entry;
    bfd_byte *last_entry;
!   bfd_vma index = 0;
    bfd_vma address;
  
    /* Although the ABI says that it is "the high-order 16 bits" that we
*************** _bfd_mips_elf_relocate_section (output_b
*** 6413,6419 ****
  {
    Elf_Internal_Rela *rel;
    const Elf_Internal_Rela *relend;
!   bfd_vma addend;
    boolean use_saved_addend_p = false;
    struct elf_backend_data *bed;
  
--- 6415,6421 ----
  {
    Elf_Internal_Rela *rel;
    const Elf_Internal_Rela *relend;
!   bfd_vma addend = 0;
    boolean use_saved_addend_p = false;
    struct elf_backend_data *bed;
  
Index: elf32-sh.c
===================================================================
RCS file: /cvs/src//src/bfd/elf32-sh.c,v
retrieving revision 1.7
diff -p -r1.7 elf32-sh.c
*** elf32-sh.c	2000/02/17 00:33:34	1.7
--- elf32-sh.c	2000/03/01 19:31:02
*************** sh_elf_set_mach_from_flags (abfd)
*** 2101,2107 ****
  {
    flagword flags = elf_elfheader (abfd)->e_flags;
  
!   switch (elf_elfheader (abfd)->e_flags & EF_SH_MACH_MASK)
      {
      case EF_SH1:
        bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh);
--- 2101,2107 ----
  {
    flagword flags = elf_elfheader (abfd)->e_flags;
  
!   switch (flags & EF_SH_MACH_MASK)
      {
      case EF_SH1:
        bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh);

Index: elflink.h
===================================================================
RCS file: /cvs/src//src/bfd/elflink.h,v
retrieving revision 1.49
diff -p -r1.49 elflink.h
*** elflink.h	2000/02/22 08:06:01	1.49
--- elflink.h	2000/03/01 19:31:03
*************** elf_bfd_link_add_symbols (abfd, info)
*** 83,89 ****
  /* Return true iff this is a non-common definition of a symbol.  */
  static boolean
  is_global_symbol_definition (abfd, sym)
!      bfd * abfd;
       Elf_Internal_Sym * sym;
  {
    /* Local symbols do not count, but target specific ones might.  */
--- 83,89 ----
  /* Return true iff this is a non-common definition of a symbol.  */
  static boolean
  is_global_symbol_definition (abfd, sym)
!      bfd * abfd ATTRIBUTE_UNUSED;
       Elf_Internal_Sym * sym;
  {
    /* Local symbols do not count, but target specific ones might.  */

Index: pe-mips.c
===================================================================
RCS file: /cvs/src//src/bfd/pe-mips.c,v
retrieving revision 1.1
diff -p -r1.1 pe-mips.c
*** pe-mips.c	2000/02/28 18:56:11	1.1
--- pe-mips.c	2000/03/01 19:31:03
*************** static reloc_howto_type *coff_mips_rtype
*** 41,47 ****
  	   struct coff_link_hash_entry *, struct internal_syment *,
  
  	   bfd_vma *));
! 
  static void mips_ecoff_swap_reloc_in PARAMS ((bfd *, PTR,
  					      struct internal_reloc *));
  static void mips_ecoff_swap_reloc_out PARAMS ((bfd *,
--- 41,47 ----
  	   struct coff_link_hash_entry *, struct internal_syment *,
  
  	   bfd_vma *));
! #if 0
  static void mips_ecoff_swap_reloc_in PARAMS ((bfd *, PTR,
  					      struct internal_reloc *));
  static void mips_ecoff_swap_reloc_out PARAMS ((bfd *,
*************** static void mips_adjust_reloc_in PARAMS 
*** 52,58 ****
  					  arelent *));
  static void mips_adjust_reloc_out PARAMS ((bfd *, const arelent *,
  					   struct internal_reloc *));
! 
  #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
  /* The page size is a guess based on ELF.  */
  
--- 52,58 ----
  					  arelent *));
  static void mips_adjust_reloc_out PARAMS ((bfd *, const arelent *,
  					   struct internal_reloc *));
! #endif
  #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
  /* The page size is a guess based on ELF.  */
  
*************** coff_mips_reloc (abfd, reloc_entry, symb
*** 74,82 ****
       arelent *reloc_entry;
       asymbol *symbol;
       PTR data;
!      asection *input_section;
       bfd *output_bfd;
!      char **error_message;
  {
    symvalue diff;
  
--- 74,82 ----
       arelent *reloc_entry;
       asymbol *symbol;
       PTR data;
!      asection *input_section ATTRIBUTE_UNUSED;
       bfd *output_bfd;
!      char **error_message ATTRIBUTE_UNUSED;
  {
    symvalue diff;
  
*************** coff_mips_reloc (abfd, reloc_entry, symb
*** 169,175 ****
     appear in the output .reloc section. */
  
  static boolean in_reloc_p(abfd, howto)
!      bfd * abfd;
       reloc_howto_type *howto;
  {
    return ! howto->pc_relative && howto->type != MIPS_R_RVA;
--- 169,175 ----
     appear in the output .reloc section. */
  
  static boolean in_reloc_p(abfd, howto)
!      bfd * abfd ATTRIBUTE_UNUSED;
       reloc_howto_type *howto;
  {
    return ! howto->pc_relative && howto->type != MIPS_R_RVA;
*************** static reloc_howto_type howto_table[] = 
*** 310,341 ****
  	 0xffff,		/* dst_mask */
  	 false),		/* pcrel_offset */
  
!   { 8 },
!   { 9 },
!   { 10 },
!   { 11 },
!   { 12 },
!   { 13 },
!   { 14 },
!   { 15 },
!   { 16 },
!   { 17 },
!   { 18 },
!   { 19 },
!   { 20 },
!   { 21 },
!   { 22 },
!   { 23 },
!   { 24 },
!   { 25 },
!   { 26 },
!   { 27 },
!   { 28 },
!   { 29 },
!   { 30 },
!   { 31 },
!   { 32 },
!   { 33 },
    HOWTO (MIPS_R_RVA,            /* type */                                 
  	 0,	                /* rightshift */                           
  	 2,	                /* size (0 = byte, 1 = short, 2 = long) */ 
--- 310,341 ----
  	 0xffff,		/* dst_mask */
  	 false),		/* pcrel_offset */
  
!   EMPTY_HOWTO (8),
!   EMPTY_HOWTO (9),
!   EMPTY_HOWTO (10),
!   EMPTY_HOWTO (11),
!   EMPTY_HOWTO (12),
!   EMPTY_HOWTO (13),
!   EMPTY_HOWTO (14),
!   EMPTY_HOWTO (15),
!   EMPTY_HOWTO (16),
!   EMPTY_HOWTO (17),
!   EMPTY_HOWTO (18),
!   EMPTY_HOWTO (19),
!   EMPTY_HOWTO (20),
!   EMPTY_HOWTO (21),
!   EMPTY_HOWTO (22),
!   EMPTY_HOWTO (23),
!   EMPTY_HOWTO (24),
!   EMPTY_HOWTO (25),
!   EMPTY_HOWTO (26),
!   EMPTY_HOWTO (27),
!   EMPTY_HOWTO (28),
!   EMPTY_HOWTO (29),
!   EMPTY_HOWTO (30),
!   EMPTY_HOWTO (31),
!   EMPTY_HOWTO (32),
!   EMPTY_HOWTO (33),
    HOWTO (MIPS_R_RVA,            /* type */                                 
  	 0,	                /* rightshift */                           
  	 2,	                /* size (0 = byte, 1 = short, 2 = long) */ 
*************** static reloc_howto_type howto_table[] = 
*** 349,356 ****
  	 0xffffffff,            /* src_mask */                             
  	 0xffffffff,            /* dst_mask */                             
  	 false),                /* pcrel_offset */
!   { 35 },
!   { 36 },
    HOWTO (MIPS_R_PAIR,           /* type */                                 
  	 0,	                /* rightshift */                           
  	 2,	                /* size (0 = byte, 1 = short, 2 = long) */ 
--- 349,356 ----
  	 0xffffffff,            /* src_mask */                             
  	 0xffffffff,            /* dst_mask */                             
  	 false),                /* pcrel_offset */
!   EMPTY_HOWTO (35),
!   EMPTY_HOWTO (36),
    HOWTO (MIPS_R_PAIR,           /* type */                                 
  	 0,	                /* rightshift */                           
  	 2,	                /* size (0 = byte, 1 = short, 2 = long) */ 
*************** static reloc_howto_type howto_table[] = 
*** 413,419 ****
  
  static reloc_howto_type *
  coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
!      bfd *abfd;
       asection *sec;
       struct internal_reloc *rel;
       struct coff_link_hash_entry *h;
--- 413,419 ----
  
  static reloc_howto_type *
  coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp)
!      bfd *abfd ATTRIBUTE_UNUSED;
       asection *sec;
       struct internal_reloc *rel;
       struct coff_link_hash_entry *h;
*************** coff_mips_rtype_to_howto (abfd, sec, rel
*** 497,503 ****
  
  static reloc_howto_type *
  coff_mips_reloc_type_lookup (abfd, code)
!      bfd *abfd;
       bfd_reloc_code_real_type code;
  {
    int mips_type;
--- 497,503 ----
  
  static reloc_howto_type *
  coff_mips_reloc_type_lookup (abfd, code)
!      bfd *abfd ATTRIBUTE_UNUSED;
       bfd_reloc_code_real_type code;
  {
    int mips_type;
*************** coff_pe_mips_relocate_section (output_bf
*** 644,661 ****
       struct internal_syment *syms;
       asection **sections;
  {
-   asection **symndx_to_section;
-   struct ecoff_link_hash_entry **sym_hashes;
-   struct coff_link_hash_entry *h;
    bfd_vma gp;
    boolean gp_undefined;
    size_t adjust;
-   long *offsets;
    struct internal_reloc *rel;
    struct internal_reloc *rel_end;
    unsigned int i;
    boolean got_lo;
-   struct internal_reloc lo_int_rel;
  
    if (info->relocateable)
    {
--- 644,656 ----
*************** coff_pe_mips_relocate_section (output_bf
*** 695,701 ****
        bfd_vma addend = 0;
        bfd_vma val, tmp, targ, src, low;
        reloc_howto_type *howto;
-       bfd_reloc_status_type rstat;
        unsigned char *mem = contents + rel->r_vaddr;
  
        symndx = rel->r_symndx;
--- 690,695 ----
*************** coff_pe_mips_relocate_section (output_bf
*** 821,827 ****
  	case MIPS_R_JMPADDR:
  	  tmp = bfd_get_32(input_bfd, mem);
  	  targ = val + (tmp&0x03ffffff)*4;
! 	  if (src & 0xf0000000 != targ & 0xf0000000)
  	    {
  	      (*_bfd_error_handler)(_("%s: jump too far away\n"),
  				    bfd_get_filename (input_bfd));
--- 815,821 ----
  	case MIPS_R_JMPADDR:
  	  tmp = bfd_get_32(input_bfd, mem);
  	  targ = val + (tmp&0x03ffffff)*4;
! 	  if ((src & 0xf0000000) != (targ & 0xf0000000))
  	    {
  	      (*_bfd_error_handler)(_("%s: jump too far away\n"),
  				    bfd_get_filename (input_bfd));
Index: peicode.h
===================================================================
RCS file: /cvs/src//src/bfd/peicode.h,v
retrieving revision 1.17
diff -p -r1.17 peicode.h
*** peicode.h	2000/02/28 18:56:11	1.17
--- peicode.h	2000/03/01 19:31:03
*************** typedef struct
*** 697,703 ****
  }
  jump_table;
  
! jump_table jtab[] =
  {
  #ifdef I386MAGIC
    { I386MAGIC,
--- 697,703 ----
  }
  jump_table;
  
! static jump_table jtab[] =
  {
  #ifdef I386MAGIC
    { I386MAGIC,
*************** pe_ILF_build_a_bfd (bfd *           abfd
*** 761,767 ****
    struct internal_filehdr  internal_f;
    unsigned int             import_type;
    unsigned int             import_name_type;
!   asection_ptr             id2, id4, id5, id6, id7, text;
  
    text = NULL;
    
--- 761,767 ----
    struct internal_filehdr  internal_f;
    unsigned int             import_type;
    unsigned int             import_name_type;
!   asection_ptr             id2, id4, id5, id6 = NULL, id7, text;
  
    text = NULL;
    
*************** _("%s: Recognised but unhandled machine 
*** 1197,1203 ****
    source_dll  = ptr + strlen (ptr) + 1;
    
    /* Verify that the strings are null terminated.  */
!   if (ptr[size - 1] != 0 || ((source_dll - ptr) >= size))
      {
        _bfd_error_handler
  	(_("%s: string not null terminated in ILF object file."),
--- 1197,1203 ----
    source_dll  = ptr + strlen (ptr) + 1;
    
    /* Verify that the strings are null terminated.  */
!   if (ptr[size - 1] != 0 || ((unsigned long)(source_dll - ptr) >= size))
      {
        _bfd_error_handler
  	(_("%s: string not null terminated in ILF object file."),

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]