2010-04-27 Kai Tietz <kai.tietz@onevision.com>
authorKai Tietz <kai.tietz@onevision.com>
Tue, 27 Apr 2010 17:26:09 +0000 (17:26 +0000)
committerKai Tietz <kai.tietz@onevision.com>
Tue, 27 Apr 2010 17:26:09 +0000 (17:26 +0000)
* pe-x86_64.c (TARGET_UNDERSCORE): Set value dependent
to USE_MINGW64_LEADING_UNDERSCORES.
        * pei-x86_64.c (TARGET_UNDERSCORE): Likewise.
* config.bfd: Change underscoring default for x64 mingw
to false.
* coffcode.h (coff_write_relocs): Add check that dereferenced
sym_ptr_ptr isn't NULL.
* config.in (USE_MINGW64_LEADING_UNDERSCORES): New.
* configure: Regenerated.
* configure.in: Add option '--enable-leading-mingw64-underscores'
and define config.in variable USE_MINGW64_LEADING_UNDERSCORES.

bfd/ChangeLog
bfd/coffcode.h
bfd/config.bfd
bfd/config.in
bfd/configure
bfd/configure.in
bfd/pe-x86_64.c
bfd/pei-x86_64.c

index 411e043c83eb3fdf37d79478014347fcda2b68b8..bf051a4f60e5ab0d19480ed0e5558dc0dd9311c7 100644 (file)
@@ -1,3 +1,17 @@
+2010-04-27  Kai Tietz  <kai.tietz@onevision.com>
+
+       * pe-x86_64.c (TARGET_UNDERSCORE): Set value dependent
+       to USE_MINGW64_LEADING_UNDERSCORES.
+        * pei-x86_64.c (TARGET_UNDERSCORE): Likewise.
+       * config.bfd: Change underscoring default for x64 mingw
+       to false.
+       * coffcode.h (coff_write_relocs): Add check that dereferenced
+       sym_ptr_ptr isn't NULL.
+       * config.in (USE_MINGW64_LEADING_UNDERSCORES): New.
+       * configure: Regenerated.
+       * configure.in: Add option '--enable-leading-mingw64-underscores'
+       and define config.in variable USE_MINGW64_LEADING_UNDERSCORES.
+
 2010-04-27  Nick Clifton  <nickc@redhat.com>
 
        PR binutils/11512
index 159df27f9483bab7b990a0b9a24b4aeeb6a5535a..364daaad5c1e8ccbebd99f548786664ca1cc0371 100644 (file)
@@ -2648,7 +2648,7 @@ coff_write_relocs (bfd * abfd, int first_undef)
             entries know which symbol index they point to.  So we
             have to look up the output symbol here.  */
 
-         if (q->sym_ptr_ptr[0]->the_bfd != abfd)
+         if (q->sym_ptr_ptr[0] != NULL && q->sym_ptr_ptr[0]->the_bfd != abfd)
            {
              int j;
              const char *sname = q->sym_ptr_ptr[0]->name;
@@ -2677,7 +2677,7 @@ coff_write_relocs (bfd * abfd, int first_undef)
            n.r_symndx = q->addend;
          else
 #endif
-           if (q->sym_ptr_ptr)
+           if (q->sym_ptr_ptr && q->sym_ptr_ptr[0] != NULL)
              {
 #ifdef SECTION_RELATIVE_ABSOLUTE_SYMBOL_P
                if (SECTION_RELATIVE_ABSOLUTE_SYMBOL_P (q, s))
index ffae42831a2a2ec23a0a42b75aedd8b18870425c..6420f5fb2df35e807efe027956aa77c598e4298a 100644 (file)
@@ -177,7 +177,6 @@ case "${targ}" in
     ;;
   alpha*-*-*vms*)
     targ_defvec=vms_alpha_vec
-    targ_selvecs=vms_lib_txt_vec
     want64=true
     ;;
   alpha*-*-*)
@@ -640,7 +639,7 @@ case "${targ}" in
     targ_defvec=x86_64pe_vec
     targ_selvecs="x86_64pe_vec x86_64pei_vec bfd_elf64_x86_64_vec bfd_elf64_l1om_vec"
     want64=true
-    targ_underscore=yes
+    targ_underscore=no
     ;;
 #endif
   i[3-7]86-*-lynxos*)
@@ -1511,6 +1510,10 @@ case "${targ}" in
     targ_defvec=bfd_elf32_vax_vec
     ;;
 
+  vax*-*-*vms*)
+    targ_defvec=vms_vax_vec
+    ;;
+
   we32k-*-*)
     targ_defvec=we32kcoff_vec
     ;;
index 065c905816c71bf84c8a0997fb01197435bdba5a..b0b97a27f497534f80c616010e5cdf30efc4e63e 100644 (file)
 /* Use b modifier when opening binary files? */
 #undef USE_BINARY_FOPEN
 
+/* Define if we should use leading underscore on 64 bit mingw targets */
+#undef USE_MINGW64_LEADING_UNDERSCORES
+
 /* Use mmap if it's available? */
 #undef USE_MMAP
 
index 7d16fab0be6cb73058145d8bb4e5fedb295fda71..6ace16c35e8ca76455ff362a3adbe16e8385408d 100755 (executable)
@@ -785,6 +785,7 @@ enable_64_bit_bfd
 enable_targets
 with_mmap
 enable_secureplt
+enable_leading_mingw64_underscores
 with_separate_debug_dir
 enable_elf_stt_common
 with_pkgversion
@@ -1435,6 +1436,8 @@ Optional Features:
   --enable-64-bit-bfd     64-bit support (on hosts with narrower word sizes)
   --enable-targets        alternative target configurations
   --enable-secureplt      Default to creating read-only plt entries
+  --enable-leading-mingw64-underscores
+                          Enable leading underscores on 64 bit mingw targets
   --enable-elf-stt-common Allow the generation of ELF symbols with the STT_COMMON type
   --enable-werror         treat compile warnings as errors
   --enable-build-warnings enable build-time compiler warnings
@@ -11402,7 +11405,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11405 "configure"
+#line 11408 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11508,7 +11511,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11511 "configure"
+#line 11514 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12049,6 +12052,17 @@ $as_echo "#define USE_SECUREPLT 1" >>confdefs.h
 
 fi
 
+# Check whether --enable-leading-mingw64-underscores was given.
+if test "${enable_leading_mingw64_underscores+set}" = set; then :
+  enableval=$enable_leading_mingw64_underscores;
+fi
+
+if  test x"$enable_leading_mingw64_underscores" = xyes ; then :
+
+$as_echo "#define USE_MINGW64_LEADING_UNDERSCORES 1" >>confdefs.h
+
+fi
+
 DEBUGDIR=${libdir}/debug
 
 # Check whether --with-separate-debug-dir was given.
index eb9d7e7634062a908cf240f5ebb00369714f66fb..6f055056e0b086f27a525d757ab59054f5e31073 100644 (file)
@@ -75,6 +75,14 @@ if test $use_secureplt = true; then
     [Define if we should default to creating read-only plt entries])
 fi
 
+AC_ARG_ENABLE(leading-mingw64-underscores,
+  AS_HELP_STRING([--enable-leading-mingw64-underscores],
+                 [Enable leading underscores on 64 bit mingw targets]),
+  [],[])
+AS_IF([ test x"$enable_leading_mingw64_underscores" = xyes ],
+  [AC_DEFINE(USE_MINGW64_LEADING_UNDERSCORES, 1,
+    [Define if we should use leading underscore on 64 bit mingw targets])])
+
 DEBUGDIR=${libdir}/debug
 AC_ARG_WITH(separate-debug-dir,
   AS_HELP_STRING([--with-separate-debug-dir=DIR],
index bcf18b6e8abf13d1152d9712cc579921187a657b..76fc7c702839c4a3348756f1107ee94f57a29fa2 100644 (file)
 #define COFF_WITH_PE
 #define COFF_WITH_pex64
 #define PCRELOFFSET            TRUE
+#if defined (USE_MINGW64_LEADING_UNDERSCORES)
 #define TARGET_UNDERSCORE      '_'
+#else
+#define TARGET_UNDERSCORE      0
+#endif
 #define COFF_LONG_SECTION_NAMES
 #define COFF_SUPPORT_GNU_LINKONCE
 #define COFF_LONG_FILENAMES
index f5b8abdc8a36aebcdf00a401f2561ca3e30df7ec..fa9a267735925dd9363ed8b4dbcf3b00008d88f9 100644 (file)
 #define COFF_WITH_PE
 #define COFF_WITH_pex64
 #define PCRELOFFSET            TRUE
+#if defined (USE_MINGW64_LEADING_UNDERSCORES)
 #define TARGET_UNDERSCORE      '_'
+#else
+#define TARGET_UNDERSCORE      0
+#endif
 /* Long section names not allowed in executable images, only object files.  */
 #define COFF_LONG_SECTION_NAMES 0
 #define COFF_SUPPORT_GNU_LINKONCE