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]

[patch] More on HP weak symbols


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.

Index: tc-hppa.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gas/config/tc-hppa.c,v
retrieving revision 1.163
diff -p -r1.163 tc-hppa.c
*** tc-hppa.c   1998/05/29 22:25:43     1.163
- - --- tc-hppa.c   2000/06/01 22:23:48
*************** pa_export (unused)
*** 4635,4642 ****
      }
    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 ())
- - --- 4635,4647 ----
      }
    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->bsym->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]