This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Weak symbol support on powerpc-ibm-aix5.2.0.0 (binutils 2.15)
- From: Nick Clifton <nickc at redhat dot com>
- To: Michael Klein <michael dot klein at fazi dot de>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 26 Jul 2004 17:04:24 +0100
- Subject: Re: Weak symbol support on powerpc-ibm-aix5.2.0.0 (binutils 2.15)
- References: <Pine.LNX.4.44.0407151735430.28013-100000@debian02.fuzzy-online.de>
Hi Michael,
Are weak symbols unsupported on AIX 5.2 or is this a gas/bfd bug?
It is a bug...
.csect .data[RW]
.globl g
g: .long 0
.weak w
w: .long 0
Please try the attached patch and let me know how you get on with it.
Cheers
Nick
gas/ChangeLog
2004-07-26 Nick Clifton <nickc@redhat.com>
* config/obj-coff.c (coff_frob_symbol): Skip weak symbols when
setting punt before calling SA_SET_SYM_ENDNDX for XCOFF format.
* config/tc-ppc.c (ppc_frob_symbol): Treat weak symbols like
external symbols.
Index: gas/config/obj-coff.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-coff.c,v
retrieving revision 1.72
diff -c -3 -p -r1.72 obj-coff.c
*** gas/config/obj-coff.c 6 Jul 2004 15:30:26 -0000 1.72
--- gas/config/obj-coff.c 26 Jul 2004 15:48:15 -0000
*************** coff_frob_symbol (symp, punt)
*** 1327,1333 ****
order to call SA_SET_SYM_ENDNDX correctly. */
if (! symbol_used_in_reloc_p (symp)
&& ((symbol_get_bfdsym (symp)->flags & BSF_SECTION_SYM) != 0
! || (! S_IS_EXTERNAL (symp)
&& ! symbol_get_tc (symp)->output
&& S_GET_STORAGE_CLASS (symp) != C_FILE)))
*punt = 1;
--- 1327,1333 ----
order to call SA_SET_SYM_ENDNDX correctly. */
if (! symbol_used_in_reloc_p (symp)
&& ((symbol_get_bfdsym (symp)->flags & BSF_SECTION_SYM) != 0
! || (! (S_IS_EXTERNAL (symp) || S_IS_WEAK (symp))
&& ! symbol_get_tc (symp)->output
&& S_GET_STORAGE_CLASS (symp) != C_FILE)))
*punt = 1;
Index: gas/config/tc-ppc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ppc.c,v
retrieving revision 1.89
diff -c -3 -p -r1.89 tc-ppc.c
*** gas/config/tc-ppc.c 2 Jul 2004 06:40:19 -0000 1.89
--- gas/config/tc-ppc.c 26 Jul 2004 15:48:27 -0000
*************** ppc_frob_symbol (sym)
*** 4843,4849 ****
table. */
if (! symbol_used_in_reloc_p (sym)
&& ((symbol_get_bfdsym (sym)->flags & BSF_SECTION_SYM) != 0
! || (! S_IS_EXTERNAL (sym)
&& ! symbol_get_tc (sym)->output
&& S_GET_STORAGE_CLASS (sym) != C_FILE)))
return 1;
--- 4843,4849 ----
table. */
if (! symbol_used_in_reloc_p (sym)
&& ((symbol_get_bfdsym (sym)->flags & BSF_SECTION_SYM) != 0
! || (! (S_IS_EXTERNAL (sym) || S_IS_WEAK (sym))
&& ! symbol_get_tc (sym)->output
&& S_GET_STORAGE_CLASS (sym) != C_FILE)))
return 1;
*************** ppc_frob_symbol (sym)
*** 4909,4915 ****
}
}
! if (! S_IS_EXTERNAL (sym)
&& (symbol_get_bfdsym (sym)->flags & BSF_SECTION_SYM) == 0
&& S_GET_STORAGE_CLASS (sym) != C_FILE
&& S_GET_STORAGE_CLASS (sym) != C_FCN
--- 4909,4915 ----
}
}
! if (! (S_IS_EXTERNAL (sym) || S_IS_WEAK (sym))
&& (symbol_get_bfdsym (sym)->flags & BSF_SECTION_SYM) == 0
&& S_GET_STORAGE_CLASS (sym) != C_FILE
&& S_GET_STORAGE_CLASS (sym) != C_FCN