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]

Re: [patch] More on HP weak symbols



  In message <200006021609.JAA04650@cygint.cygnus.com> Catherine wrote:
  > A couple of months ago, I submitted some patches to support weak
  > symbols on hp platforms.  A problem was discovered where a weak
  > symbol in an archive was not being used to satisfy a reference.
  > 
  > For ELF, the scope of symbol can be GLOBAL, WEAK or LOCAL.  For
  > SOM, the scope is GLOBAL or LOCAL and weak is something else
  > altogether.  The routine S_SET_EXTERNAL in symbol.c assumes
  > that global symbols can't be weak.  This is wrong for this
  > platform.  
  > 
  > Okay to commit?
  > 
  > Thu Jun  1 15:32:54 2000  Catherine Moore <clm@redhat.com>
  > 
  > 	* config/tc-hppa.c (pa_export): Weak symbols can be global.
I mentioned to Catherine in person that this patch had a couple minor
problems (most importantly it didn't compile :-) and a couple minor
formatting problems.

I fixed those issues and installed the updated patch, which I'll append
for the sake of the archiver :-)

Index: tc-hppa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-hppa.c,v
retrieving revision 1.56
diff -c -3 -p -r1.56 tc-hppa.c
*** tc-hppa.c	2000/05/19 00:21:12	1.56
--- tc-hppa.c	2000/06/14 02:56:40
*************** pa_export (unused)
*** 6466,6473 ****
      }
    else
      {
!       /* OK.  Set the external bits and process argument relocations.  */
        S_SET_EXTERNAL (symbol);
        p = input_line_pointer;
        *p = c;
        if (!is_end_of_statement ())
--- 6466,6478 ----
      }
    else
      {
!       /* OK.  Set the external bits and process argument relocations.
!          For the HP, weak and global are not mutually exclusive. 
!          S_SET_EXTERNAL will not set BSF_GLOBAL if WEAK is set.
!          Call S_SET_EXTERNAL to get the other processing.  Manually
!          set BSF_GLOBAL when we get back.  */
        S_SET_EXTERNAL (symbol);
+       symbol_get_bfdsym (symbol)->flags |= BSF_GLOBAL;
        p = input_line_pointer;
        *p = c;
        if (!is_end_of_statement ())



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