* targets.c (bfd_target_vector) [SELECT_VECS not defined]: Add
[binutils-gdb.git] / bfd / coff-i386.c
index 04de7514a007c0bba9e2b01c3e0787976944e54a..79b9f94f9afc0b93cbdb20a9d82dfc6f0da6b9a6 100644 (file)
@@ -30,6 +30,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "coff/pe.h"
 #endif
 
+#ifdef COFF_GO32_EXE
+#include "coff/go32exe.h"
+#endif
+
 #include "libcoff.h"
 
 static bfd_reloc_status_type coff_i386_reloc 
@@ -417,9 +421,30 @@ coff_i386_reloc_type_lookup (abfd, code)
     }
 }
 
+#define coff_rtype_to_howto coff_i386_rtype_to_howto
 
+#ifdef TARGET_UNDERSCORE
 
-#define coff_rtype_to_howto coff_i386_rtype_to_howto
+/* If i386 gcc uses underscores for symbol names, then it does not use
+   a leading dot for local labels, so if TARGET_UNDERSCORE is defined
+   we treat all symbols starting with L as local.  */
+
+static boolean coff_i386_is_local_label_name PARAMS ((bfd *, const char *));
+
+static boolean
+coff_i386_is_local_label_name (abfd, name)
+     bfd *abfd;
+     const char *name;
+{
+  if (name[0] == 'L')
+    return true;
+
+  return _bfd_coff_is_local_label_name (abfd, name);
+}
+
+#define coff_bfd_is_local_label_name coff_i386_is_local_label_name
+
+#endif /* TARGET_UNDERSCORE */
 
 #include "coffcode.h"
 
@@ -507,9 +532,11 @@ const bfd_target
    HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
 
 #ifndef COFF_WITH_PE
-  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
+   | SEC_CODE | SEC_DATA),
 #else
   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */
+   | SEC_CODE | SEC_DATA
    | SEC_LINK_ONCE | SEC_LINK_DUPLICATES),
 #endif