This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

[patch] Copy symbol type in linker script assignments.


On some targets (in particular ARM) the type of a symbol is important. 
Currently symbols created be the linker script are given no type, which means 
these can't be used for function symbols. The attached patch makes a linker 
script assignment of the form "foo = bar" copy the type of the symbol, in 
addition to the address.

Obviously there are things that still don't work, but this at least means it's 
possible to create simple symbol aliases via a linker script.

Tested on arm-none-eabi, arm-coff and x86_64-linux-gnu

Ok?

Paul

2009-02-02  Paul Brook  <paul@codesourcery.com>

	ld/
	* ldexp.c: Copy symbol type for simle assignments.

	bfd/
	* libbfd-in.h (_bfd_generic_copy_link_hash_symbol_type): Add
	prototype.
	* elf-bfd.h (_bfd_elf_copy_link_hash_symbol_type): Add prototype.
	* linker.c (_bfd_generic_copy_link_hash_symbol_type): New function.
	* elflink.c (_bfd_elf_copy_link_hash_symbol_type): New function.
	* targets.c (BFD_JUMP_TABLE_LINK, struct bfd_target): Add
	_copy_link_hash_symbol_type.
	* bfd/coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Add
	_bfd_generic_copy_link_hash_symbol_type.
	* bfd/coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Add
	_bfd_generic_copy_link_hash_symbol_type.
	 * aout-adobe.c (aout_32_bfd_copy_link_hash_symbol_type): Define.
	 * aout-target.h (MY_bfd_copy_link_hash_symbol_type): Define.
	 * aout-tic30.c (MY_bfd_copy_link_hash_symbol_type): Define.
	 * binary.c (binary_bfd_copy_link_hash_symbol_type): Define.
	 * bout.c (b_out_bfd_copy_link_hash_symbol_type): Define.
	 * coffcode.h (coff_bfd_copy_link_hash_symbol_type): Define.
	 * elfxx-target.h (bfd_elfNN_bfd_copy_link_hash_symbol_type): Define.
	 * i386msdos.c (msdos_bfd_copy_link_hash_symbol_type): Define.
	 * i386os9k.c (os9k_bfd_copy_link_hash_symbol_type): Define.
	 * ieee.c (ieee_bfd_copy_link_hash_symbol_type): Define.
	 * ihex.c (ihex_bfd_copy_link_hash_symbol_type): Define.
	 * libecoff.h (_bfd_ecoff_bfd_copy_link_hash_symbol_type): Define.
	 * mach-o.c (bfd_mach_o_bfd_copy_link_hash_symbol_type): Define.
	 * mmo.c (mmo_bfd_copy_link_hash_symbol_type): Define.
	 * nlm-target.h (nlm_bfd_copy_link_hash_symbol_type): Define.
	 * oasys.c (oasys_bfd_copy_link_hash_symbol_type): Define.
	 * pef.c (bfd_pef_bfd_copy_link_hash_symbol_type): Define.
	 * ppcboot.c (ppcboot_bfd_copy_link_hash_symbol_type): Define.
	 * som.c (som_bfd_copy_link_hash_symbol_type): Define.
	 * srec.c (srec_bfd_copy_link_hash_symbol_type): Define.
	 * tekhex.c (tekhex_bfd_copy_link_hash_symbol_type): Define.
	 * versados.c (versados_bfd_copy_link_hash_symbol_type): Define.
	 * vms.c (vms_bfd_copy_link_hash_symbol_type): Define.
	 * xsym.c (bfd_sym_bfd_copy_link_hash_symbol_type): Define.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.

	ld/testsuite
	* ld-arm/script-type.sym: New test.
	* ld-arm/script-type.s: New test.
	* ld-arm/script-type.s: New test.
Index: ld/testsuite/ld-arm/script-type.s
===================================================================
--- ld/testsuite/ld-arm/script-type.s	(revision 0)
+++ ld/testsuite/ld-arm/script-type.s	(revision 0)
@@ -0,0 +1,20 @@
+.syntax unified
+.text
+.global bar_a
+.type bar_a %function
+bar_a:
+bx lr
+
+.p2align 4
+.global bar_o
+.type bar_o %object
+bar_o:
+.word 0
+
+.p2align 4
+.thumb
+.global bar_t
+.type bar_t %function
+bar_t:
+bx lr
+
Index: ld/testsuite/ld-arm/script-type.ld
===================================================================
--- ld/testsuite/ld-arm/script-type.ld	(revision 0)
+++ ld/testsuite/ld-arm/script-type.ld	(revision 0)
@@ -0,0 +1,7 @@
+SECTIONS {
+  foo_a = bar_a;
+  foo_t = bar_t;
+  foo_o = bar_o;
+  .text : { *(.text) }
+  .ARM.attribues 0 : { *(.ARM.attributes) }
+}
Index: ld/testsuite/ld-arm/script-type.sym
===================================================================
--- ld/testsuite/ld-arm/script-type.sym	(revision 0)
+++ ld/testsuite/ld-arm/script-type.sym	(revision 0)
@@ -0,0 +1,15 @@
+
+Symbol table '.symtab' contains 12 entries:
+   Num:    Value  Size Type    Bind   Vis      Ndx Name
+     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
+     1: 00000000     0 SECTION LOCAL  DEFAULT    1 
+     2: 00000000     0 SECTION LOCAL  DEFAULT    2 
+     3: 00000000     0 NOTYPE  LOCAL  DEFAULT    1 \$a
+     4: 00000010     0 NOTYPE  LOCAL  DEFAULT    1 \$d
+     5: 00000020     0 NOTYPE  LOCAL  DEFAULT    1 \$t
+     6: 00000010     0 OBJECT  GLOBAL DEFAULT    1 bar_o
+     7: 00000021     0 FUNC    GLOBAL DEFAULT    1 bar_t
+     8: 00000000     0 FUNC    GLOBAL DEFAULT    1 foo_a
+     9: 00000021     0 FUNC    GLOBAL DEFAULT    1 foo_t
+    10: 00000010     0 OBJECT  GLOBAL DEFAULT    1 foo_o
+    11: 00000000     0 FUNC    GLOBAL DEFAULT    1 bar_a
Index: ld/ldexp.c
===================================================================
--- ld/ldexp.c	(revision 235534)
+++ ld/ldexp.c	(working copy)
@@ -815,6 +815,20 @@ exp_fold_tree_1 (etree_type *tree)
 	      h->u.def.section = expld.result.section;
 	      if (tree->type.node_class == etree_provide)
 		tree->type.node_class = etree_provided;
+
+	      /* Copy the symbol type if this is a simple assignment of
+	         one symbol to annother.  */
+	      if (tree->assign.src->type.node_class == etree_name)
+		{
+		  struct bfd_link_hash_entry *hsrc;
+
+		  hsrc = bfd_link_hash_lookup (link_info.hash,
+					       tree->assign.src->name.name,
+					       FALSE, FALSE, TRUE);
+		  if (hsrc)
+		    bfd_copy_link_hash_symbol_type (link_info.output_bfd,
+						    h, hsrc);
+		}
 	    }
 	}
       break;
Index: bfd/oasys.c
===================================================================
--- bfd/oasys.c	(revision 235534)
+++ bfd/oasys.c	(working copy)
@@ -1202,6 +1202,8 @@ oasys_sizeof_headers (bfd *abfd ATTRIBUT
 #define oasys_bfd_link_hash_table_free             _bfd_generic_link_hash_table_free
 #define oasys_bfd_link_add_symbols                 _bfd_generic_link_add_symbols
 #define oasys_bfd_link_just_syms                   _bfd_generic_link_just_syms
+#define oasys_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define oasys_bfd_final_link                       _bfd_generic_final_link
 #define oasys_bfd_link_split_section               _bfd_generic_link_split_section
 
Index: bfd/som.c
===================================================================
--- bfd/som.c	(revision 235534)
+++ bfd/som.c	(working copy)
@@ -6366,6 +6366,8 @@ som_bfd_link_split_section (bfd *abfd AT
 #define som_bfd_link_hash_table_free            _bfd_generic_link_hash_table_free
 #define som_bfd_link_add_symbols                _bfd_generic_link_add_symbols
 #define som_bfd_link_just_syms                  _bfd_generic_link_just_syms
+#define som_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define som_bfd_final_link                      _bfd_generic_final_link
 #define som_bfd_gc_sections		        bfd_generic_gc_sections
 #define som_bfd_merge_sections		        bfd_generic_merge_sections
Index: bfd/nlm-target.h
===================================================================
--- bfd/nlm-target.h	(revision 235534)
+++ bfd/nlm-target.h	(working copy)
@@ -53,6 +53,8 @@
 #define nlm_bfd_link_hash_table_free            _bfd_generic_link_hash_table_free
 #define nlm_bfd_link_add_symbols                _bfd_generic_link_add_symbols
 #define nlm_bfd_link_just_syms                  _bfd_generic_link_just_syms
+#define nlm_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define nlm_bfd_final_link                      _bfd_generic_final_link
 #define nlm_bfd_link_split_section              _bfd_generic_link_split_section
 
Index: bfd/aout-adobe.c
===================================================================
--- bfd/aout-adobe.c	(revision 235534)
+++ bfd/aout-adobe.c	(working copy)
@@ -467,6 +467,8 @@ aout_adobe_sizeof_headers (bfd *ignore_a
 #define aout_32_bfd_link_hash_table_free            _bfd_generic_link_hash_table_free
 #define aout_32_bfd_link_add_symbols	            _bfd_generic_link_add_symbols
 #define aout_32_bfd_link_just_syms	            _bfd_generic_link_just_syms
+#define aout_32_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define aout_32_bfd_final_link		            _bfd_generic_final_link
 #define aout_32_bfd_link_split_section	            _bfd_generic_link_split_section
 
Index: bfd/aout-tic30.c
===================================================================
--- bfd/aout-tic30.c	(revision 235534)
+++ bfd/aout-tic30.c	(working copy)
@@ -977,6 +977,10 @@ tic30_aout_set_arch_mach (bfd *abfd,
 #ifndef MY_bfd_link_just_syms
 #define MY_bfd_link_just_syms _bfd_generic_link_just_syms
 #endif
+#ifndef MY_bfd_copy_link_hash_symbol_type
+#define MY_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
+#endif
 #ifndef MY_bfd_link_split_section
 #define MY_bfd_link_split_section  _bfd_generic_link_split_section
 #endif
Index: bfd/vms.c
===================================================================
--- bfd/vms.c	(revision 235534)
+++ bfd/vms.c	(working copy)
@@ -30,6 +30,8 @@
 #define vms_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define vms_make_empty_symbol             _bfd_generic_make_empty_symbol
 #define vms_bfd_link_just_syms            _bfd_generic_link_just_syms
+#define vms_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define vms_bfd_is_group_section          bfd_generic_is_group_section
 #define vms_bfd_discard_group             bfd_generic_discard_group
 #define vms_section_already_linked        _bfd_generic_section_already_linked
Index: bfd/versados.c
===================================================================
--- bfd/versados.c	(revision 235534)
+++ bfd/versados.c	(working copy)
@@ -812,6 +812,8 @@ versados_canonicalize_reloc (bfd *abfd,
 #define versados_bfd_link_hash_table_free             _bfd_generic_link_hash_table_free
 #define versados_bfd_link_add_symbols                 _bfd_generic_link_add_symbols
 #define versados_bfd_link_just_syms                   _bfd_generic_link_just_syms
+#define versados_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define versados_bfd_final_link                       _bfd_generic_final_link
 #define versados_bfd_link_split_section               _bfd_generic_link_split_section
 
Index: bfd/i386os9k.c
===================================================================
--- bfd/i386os9k.c	(revision 235534)
+++ bfd/i386os9k.c	(working copy)
@@ -176,6 +176,8 @@ os9k_sizeof_headers (bfd *abfd ATTRIBUTE
 #define os9k_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
 #define os9k_bfd_link_add_symbols _bfd_generic_link_add_symbols
 #define os9k_bfd_link_just_syms _bfd_generic_link_just_syms
+#define os9k_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define os9k_bfd_final_link _bfd_generic_final_link
 #define os9k_bfd_link_split_section  _bfd_generic_link_split_section
 
Index: bfd/aout-target.h
===================================================================
--- bfd/aout-target.h	(revision 235534)
+++ bfd/aout-target.h	(working copy)
@@ -520,6 +520,10 @@ MY_bfd_final_link (bfd *abfd, struct bfd
 #ifndef MY_bfd_link_just_syms
 #define MY_bfd_link_just_syms _bfd_generic_link_just_syms
 #endif
+#ifndef MY_bfd_copy_link_hash_symbol_type
+#define MY_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
+#endif
 #ifndef MY_bfd_link_split_section
 #define MY_bfd_link_split_section  _bfd_generic_link_split_section
 #endif
Index: bfd/libecoff.h
===================================================================
--- bfd/libecoff.h	(revision 235534)
+++ bfd/libecoff.h	(working copy)
@@ -310,6 +310,8 @@ extern struct bfd_link_hash_table *_bfd_
 extern bfd_boolean _bfd_ecoff_bfd_link_add_symbols
   (bfd *, struct bfd_link_info *);
 #define _bfd_ecoff_bfd_link_just_syms _bfd_generic_link_just_syms
+#define _bfd_ecoff_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 extern bfd_boolean _bfd_ecoff_bfd_final_link
   (bfd *, struct bfd_link_info *);
 
Index: bfd/linker.c
===================================================================
--- bfd/linker.c	(revision 235534)
+++ bfd/linker.c	(working copy)
@@ -795,6 +795,17 @@ _bfd_generic_link_just_syms (asection *s
   sec->output_offset = sec->vma;
 }
 
+/* Copy the type of a symbol assiciated with a linker hast table entry.
+   Override this so that symbols created in linker scripts get their
+   type from the RHS of the assignment.
+   The default implementation does nothing.  */
+void
+_bfd_generic_copy_link_hash_symbol_type (bfd *abfd ATTRIBUTE_UNUSED,
+    struct bfd_link_hash_entry * hdest ATTRIBUTE_UNUSED,
+    struct bfd_link_hash_entry * hsrc ATTRIBUTE_UNUSED)
+{
+}
+
 /* Add symbols from an object file to the global hash table.  */
 
 static bfd_boolean
Index: bfd/mmo.c
===================================================================
--- bfd/mmo.c	(revision 235534)
+++ bfd/mmo.c	(working copy)
@@ -3199,6 +3199,8 @@ mmo_write_object_contents (bfd *abfd)
 #define mmo_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
 #define mmo_bfd_link_add_symbols _bfd_generic_link_add_symbols
 #define mmo_bfd_link_just_syms _bfd_generic_link_just_syms
+#define mmo_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define mmo_bfd_final_link _bfd_generic_final_link
 #define mmo_bfd_link_split_section _bfd_generic_link_split_section
 
Index: bfd/targets.c
===================================================================
--- bfd/targets.c	(revision 235534)
+++ bfd/targets.c	(working copy)
@@ -435,6 +435,7 @@ BFD_JUMP_TABLE macros.
 .  NAME##_bfd_link_hash_table_free, \
 .  NAME##_bfd_link_add_symbols, \
 .  NAME##_bfd_link_just_syms, \
+.  NAME##_bfd_copy_link_hash_symbol_type, \
 .  NAME##_bfd_final_link, \
 .  NAME##_bfd_link_split_section, \
 .  NAME##_bfd_gc_sections, \
@@ -465,6 +466,12 @@ BFD_JUMP_TABLE macros.
 .  {* Indicate that we are only retrieving symbol values from this section.  *}
 .  void        (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
 .
+.  {* Copy the symbol type of a linker hash table entry.  *}
+.#define bfd_copy_link_hash_symbol_type(b, t, f) \
+.  BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
+.  void (*_bfd_copy_link_hash_symbol_type)
+.    (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
+.
 .  {* Do a link based on the link_order structures attached to each
 .     section of the BFD.  *}
 .  bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
Index: bfd/tekhex.c
===================================================================
--- bfd/tekhex.c	(revision 235534)
+++ bfd/tekhex.c	(working copy)
@@ -947,6 +947,8 @@ tekhex_print_symbol (bfd *abfd,
 #define tekhex_bfd_link_hash_table_free             _bfd_generic_link_hash_table_free
 #define tekhex_bfd_link_add_symbols                 _bfd_generic_link_add_symbols
 #define tekhex_bfd_link_just_syms                   _bfd_generic_link_just_syms
+#define tekhex_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define tekhex_bfd_final_link                       _bfd_generic_final_link
 #define tekhex_bfd_link_split_section               _bfd_generic_link_split_section
 #define tekhex_get_section_contents_in_window       _bfd_generic_get_section_contents_in_window
Index: bfd/ppcboot.c
===================================================================
--- bfd/ppcboot.c	(revision 235534)
+++ bfd/ppcboot.c	(working copy)
@@ -479,6 +479,8 @@ ppcboot_bfd_print_private_bfd_data (abfd
 #define ppcboot_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
 #define ppcboot_bfd_link_add_symbols _bfd_generic_link_add_symbols
 #define ppcboot_bfd_link_just_syms _bfd_generic_link_just_syms
+#define ppcboot_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define ppcboot_bfd_final_link _bfd_generic_final_link
 #define ppcboot_bfd_link_split_section _bfd_generic_link_split_section
 #define ppcboot_get_section_contents_in_window \
Index: bfd/pef.c
===================================================================
--- bfd/pef.c	(revision 235534)
+++ bfd/pef.c	(working copy)
@@ -56,6 +56,8 @@
 #define bfd_pef_bfd_link_hash_table_free            _bfd_generic_link_hash_table_free
 #define bfd_pef_bfd_link_add_symbols                _bfd_generic_link_add_symbols
 #define bfd_pef_bfd_link_just_syms                  _bfd_generic_link_just_syms
+#define bfd_pef_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define bfd_pef_bfd_final_link                      _bfd_generic_final_link
 #define bfd_pef_bfd_link_split_section              _bfd_generic_link_split_section
 #define bfd_pef_get_section_contents_in_window      _bfd_generic_get_section_contents_in_window
Index: bfd/libbfd-in.h
===================================================================
--- bfd/libbfd-in.h	(revision 235534)
+++ bfd/libbfd-in.h	(working copy)
@@ -410,6 +410,9 @@ extern bfd_boolean _bfd_generic_set_sect
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
 #define _bfd_nolink_bfd_link_just_syms \
   ((void (*) (asection *, struct bfd_link_info *)) bfd_void)
+#define _bfd_nolink_bfd_copy_link_hash_symbol_type \
+  ((void (*) (bfd *, struct bfd_link_hash_entry *, \
+	      struct bfd_link_hash_entry *)) bfd_void)
 #define _bfd_nolink_bfd_final_link \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
 #define _bfd_nolink_bfd_link_split_section \
@@ -521,6 +524,10 @@ extern bfd_boolean _bfd_generic_link_add
 extern void _bfd_generic_link_just_syms
   (asection *, struct bfd_link_info *);
 
+/* Generic routine that does nothing.  */
+extern void _bfd_generic_copy_link_hash_symbol_type
+  (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
+
 /* Generic link routine.  */
 extern bfd_boolean _bfd_generic_final_link
   (bfd *, struct bfd_link_info *);
Index: bfd/mach-o.c
===================================================================
--- bfd/mach-o.c	(revision 235534)
+++ bfd/mach-o.c	(working copy)
@@ -60,6 +60,8 @@
 #define bfd_mach_o_bfd_link_hash_table_free           _bfd_generic_link_hash_table_free
 #define bfd_mach_o_bfd_link_add_symbols               _bfd_generic_link_add_symbols
 #define bfd_mach_o_bfd_link_just_syms                 _bfd_generic_link_just_syms
+#define bfd_mach_o_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define bfd_mach_o_bfd_final_link                     _bfd_generic_final_link
 #define bfd_mach_o_bfd_link_split_section             _bfd_generic_link_split_section
 #define bfd_mach_o_set_arch_mach                      bfd_default_set_arch_mach
Index: bfd/ieee.c
===================================================================
--- bfd/ieee.c	(revision 235534)
+++ bfd/ieee.c	(working copy)
@@ -3774,6 +3774,8 @@ ieee_sizeof_headers (bfd *abfd ATTRIBUTE
 #define ieee_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
 #define ieee_bfd_link_add_symbols _bfd_generic_link_add_symbols
 #define ieee_bfd_link_just_syms _bfd_generic_link_just_syms
+#define ieee_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define ieee_bfd_final_link _bfd_generic_final_link
 #define ieee_bfd_link_split_section  _bfd_generic_link_split_section
 
Index: bfd/elflink.c
===================================================================
--- bfd/elflink.c	(revision 235534)
+++ bfd/elflink.c	(working copy)
@@ -12502,3 +12502,15 @@ _bfd_elf_make_dynamic_reloc_section (ase
 
   return reloc_sec;
 }
+
+/* Copy the ELF symbol type associated with a linker hash entry.  */
+void
+_bfd_elf_copy_link_hash_symbol_type (bfd *abfd ATTRIBUTE_UNUSED,
+    struct bfd_link_hash_entry * hdest,
+    struct bfd_link_hash_entry * hsrc)
+{
+  struct elf_link_hash_entry *ehdest = (struct elf_link_hash_entry *)hdest;
+  struct elf_link_hash_entry *ehsrc = (struct elf_link_hash_entry *)hsrc;
+
+  ehdest->type = ehsrc->type;
+}
Index: bfd/xsym.c
===================================================================
--- bfd/xsym.c	(revision 235534)
+++ bfd/xsym.c	(working copy)
@@ -49,6 +49,8 @@
 #define bfd_sym_bfd_link_hash_table_free            _bfd_generic_link_hash_table_free
 #define bfd_sym_bfd_link_add_symbols                _bfd_generic_link_add_symbols
 #define bfd_sym_bfd_link_just_syms                  _bfd_generic_link_just_syms
+#define bfd_sym_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define bfd_sym_bfd_final_link                      _bfd_generic_final_link
 #define bfd_sym_bfd_link_split_section              _bfd_generic_link_split_section
 #define bfd_sym_get_section_contents_in_window      _bfd_generic_get_section_contents_in_window
Index: bfd/elf-bfd.h
===================================================================
--- bfd/elf-bfd.h	(revision 235534)
+++ bfd/elf-bfd.h	(working copy)
@@ -1705,6 +1705,8 @@ extern asection *_bfd_elf_check_kept_sec
   (asection *, struct bfd_link_info *);
 extern void _bfd_elf_link_just_syms
   (asection *, struct bfd_link_info *);
+extern void _bfd_elf_copy_link_hash_symbol_type
+  (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
 extern bfd_boolean _bfd_elf_copy_private_header_data
   (bfd *, bfd *);
 extern bfd_boolean _bfd_elf_copy_private_symbol_data
Index: bfd/bfd-in2.h
===================================================================
--- bfd/bfd-in2.h	(revision 235534)
+++ bfd/bfd-in2.h	(working copy)
@@ -5390,6 +5390,7 @@ typedef struct bfd_target
   NAME##_bfd_link_hash_table_free, \
   NAME##_bfd_link_add_symbols, \
   NAME##_bfd_link_just_syms, \
+  NAME##_bfd_copy_link_hash_symbol_type, \
   NAME##_bfd_final_link, \
   NAME##_bfd_link_split_section, \
   NAME##_bfd_gc_sections, \
@@ -5420,6 +5421,12 @@ typedef struct bfd_target
   /* Indicate that we are only retrieving symbol values from this section.  */
   void        (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
 
+  /* Copy the symbol type of a linker hash table entry.  */
+#define bfd_copy_link_hash_symbol_type(b, t, f) \
+  BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
+  void (*_bfd_copy_link_hash_symbol_type)
+    (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
+
   /* Do a link based on the link_order structures attached to each
      section of the BFD.  */
   bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
Index: bfd/i386msdos.c
===================================================================
--- bfd/i386msdos.c	(revision 235534)
+++ bfd/i386msdos.c	(working copy)
@@ -152,6 +152,8 @@ msdos_set_section_contents (bfd *abfd,
 #define msdos_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
 #define msdos_bfd_link_add_symbols _bfd_generic_link_add_symbols
 #define msdos_bfd_link_just_syms _bfd_generic_link_just_syms
+#define msdos_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define msdos_bfd_final_link _bfd_generic_final_link
 #define msdos_bfd_link_split_section _bfd_generic_link_split_section
 #define msdos_set_arch_mach _bfd_generic_set_arch_mach
Index: bfd/elfxx-target.h
===================================================================
--- bfd/elfxx-target.h	(revision 235534)
+++ bfd/elfxx-target.h	(working copy)
@@ -256,6 +256,11 @@
 #define bfd_elfNN_bfd_link_just_syms	_bfd_elf_link_just_syms
 #endif
 
+#ifndef bfd_elfNN_bfd_copy_link_hash_symbol_type
+#define bfd_elfNN_bfd_copy_link_hash_symbol_type \
+  _bfd_elf_copy_link_hash_symbol_type
+#endif
+
 #ifndef bfd_elfNN_bfd_link_split_section
 #define bfd_elfNN_bfd_link_split_section _bfd_generic_link_split_section
 #endif
Index: bfd/libbfd.h
===================================================================
--- bfd/libbfd.h	(revision 235534)
+++ bfd/libbfd.h	(working copy)
@@ -415,6 +415,9 @@ extern bfd_boolean _bfd_generic_set_sect
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
 #define _bfd_nolink_bfd_link_just_syms \
   ((void (*) (asection *, struct bfd_link_info *)) bfd_void)
+#define _bfd_nolink_bfd_copy_link_hash_symbol_type \
+  ((void (*) (bfd *, struct bfd_link_hash_entry *, \
+	      struct bfd_link_hash_entry *)) bfd_void)
 #define _bfd_nolink_bfd_final_link \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
 #define _bfd_nolink_bfd_link_split_section \
@@ -526,6 +529,10 @@ extern bfd_boolean _bfd_generic_link_add
 extern void _bfd_generic_link_just_syms
   (asection *, struct bfd_link_info *);
 
+/* Generic routine that does nothing.  */
+extern void _bfd_generic_copy_link_hash_symbol_type
+  (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
+
 /* Generic link routine.  */
 extern bfd_boolean _bfd_generic_final_link
   (bfd *, struct bfd_link_info *);
Index: bfd/srec.c
===================================================================
--- bfd/srec.c	(revision 235534)
+++ bfd/srec.c	(working copy)
@@ -1259,6 +1259,8 @@ srec_print_symbol (bfd *abfd,
 #define srec_bfd_link_hash_table_free             _bfd_generic_link_hash_table_free
 #define srec_bfd_link_add_symbols                 _bfd_generic_link_add_symbols
 #define srec_bfd_link_just_syms                   _bfd_generic_link_just_syms
+#define srec_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define srec_bfd_final_link                       _bfd_generic_final_link
 #define srec_bfd_link_split_section               _bfd_generic_link_split_section
 
Index: bfd/ihex.c
===================================================================
--- bfd/ihex.c	(revision 235534)
+++ bfd/ihex.c	(working copy)
@@ -937,6 +937,8 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE
 #define ihex_bfd_link_hash_table_free             _bfd_generic_link_hash_table_free
 #define ihex_bfd_link_add_symbols                 _bfd_generic_link_add_symbols
 #define ihex_bfd_link_just_syms                   _bfd_generic_link_just_syms
+#define ihex_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define ihex_bfd_final_link                       _bfd_generic_final_link
 #define ihex_bfd_link_split_section               _bfd_generic_link_split_section
 
Index: bfd/binary.c
===================================================================
--- bfd/binary.c	(revision 235534)
+++ bfd/binary.c	(working copy)
@@ -319,6 +319,8 @@ binary_sizeof_headers (bfd *abfd ATTRIBU
 #define binary_bfd_link_hash_table_create         _bfd_generic_link_hash_table_create
 #define binary_bfd_link_hash_table_free           _bfd_generic_link_hash_table_free
 #define binary_bfd_link_just_syms                 _bfd_generic_link_just_syms
+#define binary_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define binary_bfd_link_add_symbols               _bfd_generic_link_add_symbols
 #define binary_bfd_final_link                     _bfd_generic_final_link
 #define binary_bfd_link_split_section             _bfd_generic_link_split_section
Index: bfd/bout.c
===================================================================
--- bfd/bout.c	(revision 235534)
+++ bfd/bout.c	(working copy)
@@ -1382,6 +1382,8 @@ b_out_bfd_get_relocated_section_contents
 #define b_out_bfd_link_hash_table_free         _bfd_generic_link_hash_table_free
 #define b_out_bfd_link_add_symbols             _bfd_generic_link_add_symbols
 #define b_out_bfd_link_just_syms               _bfd_generic_link_just_syms
+#define b_out_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define b_out_bfd_final_link                   _bfd_generic_final_link
 #define b_out_bfd_link_split_section           _bfd_generic_link_split_section
 #define b_out_bfd_gc_sections                  bfd_generic_gc_sections
Index: bfd/coffcode.h
===================================================================
--- bfd/coffcode.h	(revision 235534)
+++ bfd/coffcode.h	(working copy)
@@ -5169,6 +5169,8 @@ dummy_reloc16_extra_cases (bfd *abfd ATT
 #endif /* ! defined (coff_relocate_section) */
 
 #define coff_bfd_link_just_syms      _bfd_generic_link_just_syms
+#define coff_bfd_copy_link_hash_symbol_type \
+  _bfd_generic_copy_link_hash_symbol_type
 #define coff_bfd_link_split_section  _bfd_generic_link_split_section
 
 #ifndef coff_start_final_link
Index: bfd/coff64-rs6000.c
===================================================================
--- bfd/coff64-rs6000.c	(revision 235534)
+++ bfd/coff64-rs6000.c	(working copy)
@@ -2762,6 +2762,7 @@ const bfd_target rs6000coff64_vec =
     _bfd_generic_link_hash_table_free,
     _bfd_xcoff_bfd_link_add_symbols,
     _bfd_generic_link_just_syms,
+    _bfd_generic_copy_link_hash_symbol_type,
     _bfd_xcoff_bfd_final_link,
     _bfd_generic_link_split_section,
     bfd_generic_gc_sections,
@@ -3015,6 +3016,7 @@ const bfd_target aix5coff64_vec =
     _bfd_generic_link_hash_table_free,
     _bfd_xcoff_bfd_link_add_symbols,
     _bfd_generic_link_just_syms,
+    _bfd_generic_copy_link_hash_symbol_type,
     _bfd_xcoff_bfd_final_link,
     _bfd_generic_link_split_section,
     bfd_generic_gc_sections,
Index: bfd/coff-rs6000.c
===================================================================
--- bfd/coff-rs6000.c	(revision 235534)
+++ bfd/coff-rs6000.c	(working copy)
@@ -4212,6 +4212,7 @@ const bfd_target rs6000coff_vec =
     _bfd_generic_link_hash_table_free,
     _bfd_xcoff_bfd_link_add_symbols,
     _bfd_generic_link_just_syms,
+    _bfd_generic_copy_link_hash_symbol_type,
     _bfd_xcoff_bfd_final_link,
     _bfd_generic_link_split_section,
     bfd_generic_gc_sections,
@@ -4464,6 +4465,7 @@ const bfd_target pmac_xcoff_vec =
     _bfd_generic_link_hash_table_free,
     _bfd_xcoff_bfd_link_add_symbols,
     _bfd_generic_link_just_syms,
+    _bfd_generic_copy_link_hash_symbol_type,
     _bfd_xcoff_bfd_final_link,
     _bfd_generic_link_split_section,
     bfd_generic_gc_sections,

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