aboutsummaryrefslogtreecommitdiff
path: root/binutils/rdcoff.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-06-25 16:39:45 +0000
committerNick Clifton <nickc@redhat.com>2000-06-25 16:39:45 +0000
commit05c58a7cfb691ea58be9232ac3ccda1d74415d5d (patch)
treec13c6078ff03b93a243f5ff95e83c88bae68a214 /binutils/rdcoff.c
parent307ff1df129bd324640f7c6361c2f78423dc88e7 (diff)
downloadgdb-05c58a7cfb691ea58be9232ac3ccda1d74415d5d.zip
gdb-05c58a7cfb691ea58be9232ac3ccda1d74415d5d.tar.gz
gdb-05c58a7cfb691ea58be9232ac3ccda1d74415d5d.tar.bz2
Treat GNU weak symbols as external.
Diffstat (limited to 'binutils/rdcoff.c')
-rw-r--r--binutils/rdcoff.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/binutils/rdcoff.c b/binutils/rdcoff.c
index e1385c7..22c8ab9 100644
--- a/binutils/rdcoff.c
+++ b/binutils/rdcoff.c
@@ -99,6 +99,7 @@ static debug_type parse_coff_enum_type
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. */
@@ -588,6 +589,7 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
return false;
break;
+ case C_WEAKEXT:
case C_EXT:
if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
DEBUG_GLOBAL, bfd_asymbol_value (sym)))
@@ -656,6 +658,22 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
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;
+ default:
+ break;
+ }
+ return false;
+}
+
/* This is the main routine. It looks through all the symbols and
handles them. */
@@ -767,6 +785,7 @@ parse_coff (abfd, syms, symcount, dhandle)
if (syment.n_type == T_NULL)
break;
/* Fall through. */
+ case C_WEAKEXT:
case C_EXT:
if (ISFCN (syment.n_type))
{
@@ -805,7 +824,7 @@ parse_coff (abfd, syms, symcount, dhandle)
return false;
if (! debug_record_function (dhandle, fnname, type,
- fnclass == C_EXT,
+ external_coff_symbol_p (fnclass),
bfd_asymbol_value (sym)))
return false;