[committed] Update symbol class decoding in som.c

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[committed] Update symbol class decoding in som.c

John David Anglin-4
This patch changes the symbol class decoding for weak symbols
when using SOM to be the same as bfd_decode_symclass.  This provides
more information and is a step toward fixing the gas weakref
testsuite failures on this target.

Tested on hppa2.0w-hp-hpux11.11.

Dave
--
J. David Anglin                                  [hidden email]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2005-11-20  John David Anglin  <[hidden email]>

        * som.c (som_decode_symclass): Decode BSF_WEAK symbols in the same
        manner as bfd_decode_symclass.

Index: som.c
===================================================================
RCS file: /cvs/src/src/bfd/som.c,v
retrieving revision 1.58
diff -u -3 -p -r1.58 som.c
--- som.c 15 Jun 2005 00:16:10 -0000 1.58
+++ som.c 20 Nov 2005 18:21:15 -0000
@@ -5355,11 +5355,30 @@ som_decode_symclass (asymbol *symbol)
   if (bfd_is_com_section (symbol->section))
     return 'C';
   if (bfd_is_und_section (symbol->section))
-    return 'U';
+    {
+      if (symbol->flags & BSF_WEAK)
+ {
+  /* If weak, determine if it's specifically an object
+     or non-object weak.  */
+  if (symbol->flags & BSF_OBJECT)
+    return 'v';
+  else
+    return 'w';
+ }
+      else
+ return 'U';
+    }
   if (bfd_is_ind_section (symbol->section))
     return 'I';
   if (symbol->flags & BSF_WEAK)
-    return 'W';
+    {
+      /* If weak, determine if it's specifically an object
+ or non-object weak.  */
+      if (symbol->flags & BSF_OBJECT)
+ return 'V';
+      else
+ return 'W';
+    }
   if (!(symbol->flags & (BSF_GLOBAL | BSF_LOCAL)))
     return '?';