This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Fix for leftover COFF debugging symbols
- To: binutils at sourceware dot cygnus dot com
- Subject: Fix for leftover COFF debugging symbols
- From: "Mark E." <snowball3 at bigfoot dot com>
- Date: Sun, 16 Jul 2000 15:24:15 -0400
Hi guys,
In a previous report, I noted that common symbols were duplicated with
COFF debugging. This problem actually occurs anytime a COFF debug symbol
is generated before the actual symbol no matter the type.
From looking at what both versions of obj_coff_endef and yank_symbols in
config/obj-coff.c do, I believe this patch the right way to solve the problem.
These changes were applied to yank_symbols many moons ago but never applied
to coff_frob_symbol:
Fri Nov 19 16:25:09 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
(yank_symbols): Don't call S_SET_EXTERNAL if the storage class is
already set. Fixes .def var; .val external_var; .scl 3; .endef.
Sat Dec 12 15:26:34 1992 Ian Lance Taylor (ian@cygnus.com)
(yank_symbols): Don't merge labels.
Now down to business...
2000-07-16 Mark Elbrecht <snowball3@bigfoot.com>
* config/obj-coff.c (obj_frob_symbol): Don't merge labels. Don't merge
if the symbol isn't constant. Don't call S_SET_EXTERNAL if the
storage class is already set.
Index: src/gas/config/obj-coff.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-coff.c,v
retrieving revision 1.29
diff -c -p -r1.29 obj-coff.c
*** obj-coff.c 2000/07/12 16:45:46 1.29
--- obj-coff.c 2000/07/16 19:14:22
*************** coff_frob_symbol (symp, punt)
*** 1139,1162 ****
symbolS *real;
if (!SF_GET_LOCAL (symp)
&& !SF_GET_STATICS (symp)
&& (real = symbol_find_base (S_GET_NAME (symp), DO_NOT_STRIP))
&& real != symp)
{
c_symbol_merge (symp, real);
*punt = 1;
}
! if (!S_IS_DEFINED (symp) && !SF_GET_LOCAL (symp))
{
! assert (S_GET_VALUE (symp) == 0);
! S_SET_EXTERNAL (symp);
! }
! else if (S_GET_STORAGE_CLASS (symp) == C_NULL)
! {
! if (S_GET_SEGMENT (symp) == text_section
! && symp != seg_info (text_section)->sym)
! S_SET_STORAGE_CLASS (symp, C_LABEL);
else
! S_SET_STORAGE_CLASS (symp, C_STAT);
}
if (SF_GET_PROCESS (symp))
{
--- 1139,1168 ----
symbolS *real;
if (!SF_GET_LOCAL (symp)
&& !SF_GET_STATICS (symp)
+ && S_GET_STORAGE_CLASS (symp) != C_LABEL
+ && symbol_constant_p(symp)
&& (real = symbol_find_base (S_GET_NAME (symp), DO_NOT_STRIP))
&& real != symp)
{
c_symbol_merge (symp, real);
*punt = 1;
}
! if (S_GET_STORAGE_CLASS (symp) == C_NULL)
{
! if (!S_IS_DEFINED (symp) && !SF_GET_LOCAL (symp))
! {
! assert (S_GET_VALUE (symp) == 0);
! S_SET_EXTERNAL (symp);
! }
! else if (S_GET_SEGMENT (symp) == text_section
! && symp != seg_info (text_section)->sym)
! {
! S_SET_STORAGE_CLASS (symp, C_LABEL);
! }
else
! {
! S_SET_STORAGE_CLASS (symp, C_STAT);
! }
}
if (SF_GET_PROCESS (symp))
{