+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
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;
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))
;;
alpha*-*-*vms*)
targ_defvec=vms_alpha_vec
- targ_selvecs=vms_lib_txt_vec
want64=true
;;
alpha*-*-*)
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*)
targ_defvec=bfd_elf32_vax_vec
;;
+ vax*-*-*vms*)
+ targ_defvec=vms_vax_vec
+ ;;
+
we32k-*-*)
targ_defvec=we32kcoff_vec
;;
/* 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
enable_targets
with_mmap
enable_secureplt
+enable_leading_mingw64_underscores
with_separate_debug_dir
enable_elf_stt_common
with_pkgversion
--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
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
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
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.
[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],
#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
#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