aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>1999-05-11 21:05:44 +0000
committerDJ Delorie <dj@redhat.com>1999-05-11 21:05:44 +0000
commitec0ef80e9f48ae59958cfe0ff8a998881833ca12 (patch)
tree49e5eabeda00d3d94f7b8658e6154502d69a066f /bfd/coffcode.h
parent69f868fa5d9e1847c9d73b92da32eec8d8821650 (diff)
downloadgdb-ec0ef80e9f48ae59958cfe0ff8a998881833ca12.zip
gdb-ec0ef80e9f48ae59958cfe0ff8a998881833ca12.tar.gz
gdb-ec0ef80e9f48ae59958cfe0ff8a998881833ca12.tar.bz2
* ecoff.c (_bfd_ecoff_write_armap): give the symtab element a
reasonable mode until "ar x" is smart enough to skip it (fixes gcc/libgcc.a builds on mips-ecoff targets * coffcode.h (styp_to_sec_flags): Explain how COMDATs are supposed to work. Hack to support MS import libraries, which use different COMDAT types than GNU. (coff_slurp_symbol_table): C_SECTION symbols are local; they refer to implied zero-length sections (see peicode below) * coffgen.c (coff_get_normalized_symtab): Properly read long MS filename symbols, which use one *or more* auxents. * coffswap.h (coff_swap_aux_in): ditto * peicode.h (coff_swap_sym_in): Build the implied zero-length sections
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r--bfd/coffcode.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 383719c..bee6b66 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -588,6 +588,12 @@ styp_to_sec_flags (abfd, hdr, name)
can't call slurp_symtab, because the linker doesn't want the
swapped symbols. */
+ /* COMDAT sections are special. The first symbol is the section
+ symbol, which tells what kind of COMDAT section it is. The
+ *second* symbol is the "comdat symbol" - the one with the
+ unique name. GNU uses the section symbol for the unique
+ name; MS uses ".text" for every comdat section. Sigh. - DJ */
+
if (_bfd_coff_get_external_symbols (abfd))
{
bfd_byte *esym, *esymend;
@@ -629,10 +635,23 @@ styp_to_sec_flags (abfd, hdr, name)
isym.n_type, isym.n_sclass,
0, isym.n_numaux, (PTR) &aux);
+ /* FIXME: Microsoft uses NODUPLICATES and
+ ASSOCIATIVE, but gnu uses ANY and SAME_SIZE.
+ Unfortunately, gnu doesn't do the comdat
+ symbols right. So, until we can fix it to do
+ the right thing, we are temporarily disabling
+ comdats for the MS types (they're used in
+ DLLs and C++, but we don't support *their*
+ C++ libraries anyway - DJ */
+
switch (aux.x_scn.x_comdat)
{
case IMAGE_COMDAT_SELECT_NODUPLICATES:
+#if 0
sec_flags |= SEC_LINK_DUPLICATES_ONE_ONLY;
+#else
+ sec_flags &= ~SEC_LINK_ONCE;
+#endif
break;
default:
@@ -649,8 +668,12 @@ styp_to_sec_flags (abfd, hdr, name)
break;
case IMAGE_COMDAT_SELECT_ASSOCIATIVE:
+#if 0
/* FIXME: This is not currently implemented. */
sec_flags |= SEC_LINK_DUPLICATES_DISCARD;
+#else
+ sec_flags &= ~SEC_LINK_ONCE;
+#endif
break;
}
@@ -3581,6 +3604,11 @@ coff_slurp_symbol_table (abfd)
#ifdef COFF_WITH_PE
if (src->u.syment.n_sclass == C_NT_WEAK)
dst->symbol.flags = BSF_WEAK;
+ if (src->u.syment.n_sclass == C_SECTION
+ && src->u.syment.n_scnum > 0)
+ {
+ dst->symbol.flags = BSF_LOCAL;
+ }
#endif
if (src->u.syment.n_sclass == C_WEAKEXT)