aboutsummaryrefslogtreecommitdiff
path: root/gas/symbols.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2005-10-27 07:40:07 +0000
committerJan Beulich <jbeulich@novell.com>2005-10-27 07:40:07 +0000
commit6a2b6326c21eb3e45d366676e81935ad660a7101 (patch)
treee4b9e2834db9605456d62788952e5b4efbd194ba /gas/symbols.c
parent95560129db4891eb3341c02aedb2087e99176a76 (diff)
downloadgdb-6a2b6326c21eb3e45d366676e81935ad660a7101.zip
gdb-6a2b6326c21eb3e45d366676e81935ad660a7101.tar.gz
gdb-6a2b6326c21eb3e45d366676e81935ad660a7101.tar.bz2
gas/
2005-10-27 Jan Beulich <jbeulich@novell.com> * read.c (assign_symbol): Also consider equates already defined. * symbols.c (symbol_clone): Also clone the underlying BFD symbol. * config/obj-coff.h (obj_symbol_clone_hook): New. (coff_obj_symbol_clone_hook): Declare. * config/obj-coff.c (coff_obj_symbol_clone_hook): New. gas/testsuite/ 2005-10-27 Jan Beulich <jbeulich@novell.com> * gas/all/gas.exp: Don't xfail equiv1 test anymore.
Diffstat (limited to 'gas/symbols.c')
-rw-r--r--gas/symbols.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gas/symbols.c b/gas/symbols.c
index 0110f42..c42cd7c 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -542,6 +542,7 @@ symbolS *
symbol_clone (symbolS *orgsymP, int replace)
{
symbolS *newsymP;
+ asymbol *bsymorg, *bsymnew;
/* Running local_symbol_convert on a clone that's not the one currently
in local_hash would incorrectly replace the hash entry. Thus the
@@ -549,11 +550,30 @@ symbol_clone (symbolS *orgsymP, int replace)
depends on not encountering an unconverted symbol. */
if (LOCAL_SYMBOL_CHECK (orgsymP))
orgsymP = local_symbol_convert ((struct local_symbol *) orgsymP);
+ bsymorg = orgsymP->bsym;
know (S_IS_DEFINED (orgsymP));
newsymP = obstack_alloc (&notes, sizeof (*newsymP));
*newsymP = *orgsymP;
+ bsymnew = bfd_make_empty_symbol (bfd_asymbol_bfd (bsymorg));
+ if (bsymnew == NULL)
+ as_perror ("%s", "bfd_make_empty_symbol");
+ newsymP->bsym = bsymnew;
+ bsymnew->name = bsymorg->name;
+ bsymnew->flags = bsymorg->flags;
+ bsymnew->section = bsymorg->section;
+ bsymnew->udata.p = (PTR) newsymP;
+ bfd_copy_private_symbol_data (bfd_asymbol_bfd (bsymorg), bsymorg,
+ bfd_asymbol_bfd (bsymnew), bsymnew);
+
+#ifdef obj_symbol_clone_hook
+ obj_symbol_clone_hook (newsymP, orgsymP);
+#endif
+
+#ifdef tc_symbol_clone_hook
+ tc_symbol_clone_hook (newsymP, orgsymP);
+#endif
if (replace)
{