This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: objdump --debug and COFF weak functions
- To: binutils at sourceware dot cygnus dot com
- Subject: Re: objdump --debug and COFF weak functions
- From: "Mark E." <snowball3 at bigfoot dot com>
- Date: Sat, 24 Jun 2000 19:48:53 -0400
Ok, if using COFF_WITH_PE won't work, let's try this then:
binutils/Changelog:
2000-06-24 Mark Elbrecht <snowball3@bigfoot.com>
* rdcoff (parse_coff_symbol): Treat GNU weak symbols as external.
(external_coff_symbol_p): New function.
(parse_coff): Use it.
Index: src/binutils/rdcoff.c
===================================================================
RCS file: /cvs/src/src/binutils/rdcoff.c,v
retrieving revision 1.3
diff -c -p -r1.3 rdcoff.c
*** rdcoff.c 2000/04/07 04:34:50 1.3
--- rdcoff.c 2000/06/24 23:39:02
*************** static debug_type parse_coff_enum_type
*** 99,104 ****
--- 99,106 ----
static boolean parse_coff_symbol
PARAMS ((bfd *, struct coff_types *, asymbol *, long,
struct internal_syment *, PTR, debug_type, boolean));
+ static boolean external_coff_symbol_p
+ PARAMS ((int sym_class));
/* Return the slot for a type. */
*************** parse_coff_symbol (abfd, types, sym, cof
*** 589,594 ****
--- 591,597 ----
break;
case C_EXT:
+ case C_WEAKEXT:
if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
DEBUG_GLOBAL, bfd_asymbol_value (sym)))
return false;
*************** parse_coff_symbol (abfd, types, sym, cof
*** 656,661 ****
--- 659,678 ----
return true;
}
+ /* Determine if a symbol has external visibility. */
+
+ static boolean
+ external_coff_symbol_p (int sym_class)
+ {
+ switch (sym_class)
+ {
+ case C_EXT:
+ case C_WEAKEXT:
+ return true;
+ }
+ return false;
+ }
+
/* This is the main routine. It looks through all the symbols and
handles them. */
*************** parse_coff (abfd, syms, symcount, dhandl
*** 767,772 ****
--- 784,790 ----
if (syment.n_type == T_NULL)
break;
/* Fall through. */
+ case C_WEAKEXT:
case C_EXT:
if (ISFCN (syment.n_type))
{
*************** parse_coff (abfd, syms, symcount, dhandl
*** 805,811 ****
return false;
if (! debug_record_function (dhandle, fnname, type,
! fnclass == C_EXT,
bfd_asymbol_value (sym)))
return false;
--- 823,829 ----
return false;
if (! debug_record_function (dhandle, fnname, type,
! external_coff_symbol_p (fnclass),
bfd_asymbol_value (sym)))
return false;