* ecoff.c (ecoff_symbol_clone_hook): New function.
authorAlan Modra <amodra@gmail.com>
Mon, 2 Nov 2009 11:49:48 +0000 (11:49 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 2 Nov 2009 11:49:48 +0000 (11:49 +0000)
* ecoff.h (ecoff_symbol_clone_hook): Declare.
* obj.h (struct format_ops): Add symbol_clone_hook.
* config/obj-aout.c (aout_format_ops): Init new field.
* config/obj-coff.c (coff_format_ops): Likewise.
* config/obj-ecoff.c (ecoff_format_ops): Likewise.
* config/obj-elf.c (elf_format_ops): Likewise.
* config/obj-ecoff.h (obj_symbol_clone_hook): Define.
* config/obj-multi.h (obj_symbol_clone_hook): Define.

gas/ChangeLog
gas/config/obj-aout.c
gas/config/obj-coff.c
gas/config/obj-ecoff.c
gas/config/obj-ecoff.h
gas/config/obj-elf.c
gas/config/obj-multi.h
gas/ecoff.c
gas/ecoff.h

index ae6ceb8800cf9dcd1ad45bf2a99eee421aea4ea9..3eb9ce08df5e1e19e33621463cfc70d75283fcd6 100644 (file)
@@ -1,3 +1,15 @@
+2009-11-02  Alan Modra  <amodra@bigpond.net.au>
+
+       * ecoff.c (ecoff_symbol_clone_hook): New function.
+       * ecoff.h (ecoff_symbol_clone_hook): Declare.
+       * obj.h (struct format_ops): Add symbol_clone_hook.
+       * config/obj-aout.c (aout_format_ops): Init new field.
+       * config/obj-coff.c (coff_format_ops): Likewise.
+       * config/obj-ecoff.c (ecoff_format_ops): Likewise.
+       * config/obj-elf.c (elf_format_ops): Likewise.
+       * config/obj-ecoff.h (obj_symbol_clone_hook): Define.
+       * config/obj-multi.h (obj_symbol_clone_hook): Define.
+
 2009-11-02  Alan Modra  <amodra@bigpond.net.au>
 
        * messages.c (as_fatal): Apply 2001-01-15 change and followup
index daba73d7490e907c8c3481a99ad697cdc2514a04..c60cff1f2b62fd61aa84da548d0a9667718f3b23 100644 (file)
@@ -310,7 +310,8 @@ const struct format_ops aout_format_ops =
   aout_pop_insert,
   0,   /* ecoff_set_ext.  */
   0,   /* read_begin_hook.  */
-  0    /* symbol_new_hook.  */
+  0,   /* symbol_new_hook.  */
+  0    /* symbol_clone_hook.  */
 };
 
 const pseudo_typeS aout_pseudo_table[] =
index 271b01ef3dc3ff3163f4b791ee135de5a169a6f0..d4fb10dbceabe02929dd20bdd6399e8c28bb0780 100644 (file)
@@ -1930,5 +1930,6 @@ const struct format_ops coff_format_ops =
   coff_pop_insert,
   0,   /* ecoff_set_ext */
   coff_obj_read_begin_hook,
-  coff_obj_symbol_new_hook
+  coff_obj_symbol_new_hook,
+  coff_obj_symbol_clone_hook
 };
index 5bee7acbef84e2eef298da1222ee11a36be37d2a..ad9f2502cf0519afe31a997f51f4558cc4349880 100644 (file)
@@ -314,5 +314,6 @@ const struct format_ops ecoff_format_ops =
   ecoff_pop_insert,
   ecoff_set_ext,
   ecoff_read_begin_hook,
-  ecoff_symbol_new_hook
+  ecoff_symbol_new_hook,
+  ecoff_symbol_clone_hook
 };
index fae84ae90c2c7a2afc836737fa2d13854b5187fc..1d93dd963698349c4e0a6ca6ccf3b89c9578ffef 100644 (file)
@@ -1,6 +1,6 @@
 /* ECOFF object file format header file.
    Copyright 1993, 1994, 1995, 1996, 1997, 1999, 2002, 2004, 2005,
-   2007 Free Software Foundation, Inc.
+   2007, 2009 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
@@ -59,6 +59,7 @@ struct ecoff_sy_obj
 /* We use the ECOFF functions as our hooks.  */
 #define obj_read_begin_hook ecoff_read_begin_hook
 #define obj_symbol_new_hook ecoff_symbol_new_hook
+#define obj_symbol_clone_hook ecoff_symbol_clone_hook
 
 /* Record file switches in the ECOFF symbol table.  */
 #define obj_app_file(name, app) ecoff_new_file (name, app)
index dfe7ce3b9057e00a7cb02a11d171e6e3c28f51df..1cc11ece24df4f984b236ccf65289fdc82bca3df 100644 (file)
@@ -2424,5 +2424,6 @@ const struct format_ops elf_format_ops =
   0,   /* ecoff_set_ext */
 #endif
   elf_obj_read_begin_hook,
-  elf_obj_symbol_new_hook
+  elf_obj_symbol_new_hook,
+  0
 };
index fe3c3e712ca8f883955d1d61ef4b8e24f2b31781..b78e836ce0b1f10b5861ee164817e1ee6022a4c2 100644 (file)
         ? (*this_format->symbol_new_hook) (S)          \
         : (void) 0)
 
+#define obj_symbol_clone_hook(N, O)                    \
+       (this_format->symbol_clone_hook                 \
+        ? (*this_format->symbol_clone_hook) (N, O)     \
+        : (void) 0)
+
 #define obj_sec_sym_ok_for_reloc(A)                    \
        (this_format->sec_sym_ok_for_reloc              \
         ? (*this_format->sec_sym_ok_for_reloc) (A)     \
index a3413caa99e388e9436e030187dd0b814a3af32e..f4e22ac2e8c1d1e17c689c24f1802c023fab3d45 100644 (file)
@@ -1506,6 +1506,16 @@ ecoff_symbol_new_hook (symbolS *symbolP)
   obj->ecoff_symbol = NULL;
   obj->ecoff_extern_size = 0;
 }
+
+void
+ecoff_symbol_clone_hook (symbolS *newsymP, symbolS *orgsymP)
+{
+  OBJ_SYMFIELD_TYPE *n, *o;
+
+  n = symbol_get_obj (newsymP);
+  o = symbol_get_obj (orgsymP);
+  memcpy (n, o, sizeof *n);
+}
 \f
 /* Add a page to a varray object.  */
 
index 983011313bc606d1263fa78406e4b542302fda27..f4f83561471e50d1509b8aa90151dd6492def075 100644 (file)
@@ -1,6 +1,6 @@
 /* ecoff.h -- header file for ECOFF debugging support
-   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2004, 2005, 2007
-   Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2004, 2005,
+   2007, 2009 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    Put together by Ian Lance Taylor <ian@cygnus.com>.
 
@@ -44,6 +44,8 @@ extern void ecoff_new_file (const char *, int);
    obj_symbol_new_hook.  */
 extern void ecoff_symbol_new_hook (symbolS *);
 
+extern void ecoff_symbol_clone_hook (symbolS *, symbolS *);
+
 /* This function should be called by the obj_frob_symbol hook.  */
 extern void ecoff_frob_symbol (symbolS *);