Unverified Commit 35fcafe9 authored by boklm's avatar boklm
Browse files

Bug 16472: update binutils to 2.29.1

parent 058b6520
No preview for this file type
From f3ba95e14437f10de8b8f296930ff2a8495d18c6 Mon Sep 17 00:00:00 2001
From 05164a1162d5f6f696d7f7c4b1bc61ef06d1c288 Mon Sep 17 00:00:00 2001
From: Georg Koppen <gk@torproject.org>
Date: Tue, 12 Sep 2017 07:21:16 +0000
Subject: [PATCH] 64bit fixups
---
ld/emultempl/pep.em | 4 ++--
ld/pep-dll.c | 1 +
ld/pep-dll.h | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index b566903b14..27006bdf79 100644
index fccbd63..f7c0a57 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -730,7 +730,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
@@ -742,7 +742,7 @@ gld${EMULATION_NAME}_handle_option (int optc)
pep_dll_exclude_all_symbols = 1;
break;
case OPTION_ENABLE_RELOC_SECTION:
......@@ -17,17 +22,17 @@ index b566903b14..27006bdf79 100644
break;
case OPTION_EXCLUDE_LIBS:
pep_dll_add_excludes (optarg, EXCLUDELIBS);
@@ -1623,7 +1623,7 @@ gld_${EMULATION_NAME}_finish (void)
@@ -1862,7 +1862,7 @@ gld_${EMULATION_NAME}_finish (void)
#ifdef DLL_SUPPORT
if (link_info.shared
- || (!link_info.relocatable && pe_dll_enable_reloc_section)
+ || (!link_info.relocatable && pep_dll_enable_reloc_section)
|| (!link_info.relocatable && pep_def_file->num_exports != 0))
if (bfd_link_pic (&link_info)
|| (!bfd_link_relocatable (&link_info)
- && pe_dll_enable_reloc_section)
+ && pep_dll_enable_reloc_section)
|| (!bfd_link_relocatable (&link_info)
&& pep_def_file->num_exports != 0))
{
pep_dll_fill_sections (link_info.output_bfd, &link_info);
diff --git a/ld/pep-dll.c b/ld/pep-dll.c
index 0e5e8b1523..b5f99b90e0 100644
index b8c017f..5ad5733 100644
--- a/ld/pep-dll.c
+++ b/ld/pep-dll.c
@@ -31,6 +31,7 @@
......@@ -39,7 +44,7 @@ index 0e5e8b1523..b5f99b90e0 100644
#define pe_dll_stdcall_aliases pep_dll_stdcall_aliases
#define pe_dll_warn_dup_exports pep_dll_warn_dup_exports
diff --git a/ld/pep-dll.h b/ld/pep-dll.h
index 1e7e3d65d4..c31e69cc8e 100644
index 0a27c1f..95d9c15 100644
--- a/ld/pep-dll.h
+++ b/ld/pep-dll.h
@@ -31,6 +31,7 @@ extern def_file * pep_def_file;
......@@ -51,5 +56,5 @@ index 1e7e3d65d4..c31e69cc8e 100644
extern int pep_dll_stdcall_aliases;
extern int pep_dll_warn_dup_exports;
--
2.14.1
2.1.4
From f984741df04cd68bb116073fdfa9405808810ab4 Mon Sep 17 00:00:00 2001
From: Cary Coutant <ccoutant@google.com>
Date: Wed, 5 Feb 2014 22:59:02 -0800
Subject: [PATCH] Fix issues with gold undefined symbol diagnostics.
PR binutils/15435 complains that gold issues a visibility error for an
weak undefined symbol with hidden visibility. The message should be
suppressed if the symbol is a weak undef.
An earlier patch to add an extra note about key functions when a class's
vtable symbol is undefined missed a case where the reference to the
vtable came from a shared library. This patch moves the check to a
lower-level routine that catches both cases.
gold/
2014-02-05 Cary Coutant <ccoutant@google.com>
* errors.cc (Errors::undefined_symbol): Move undef vtable symbol
check to here.
* target-reloc.h (is_strong_undefined): New function.
(relocate_section): Move undef vtable symbol check from here.
Check for is_strong_undefined.
diff --git a/gold/ChangeLog b/gold/ChangeLog
index dcf7ed41f8..dd7ef72980 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,14 @@
+2014-02-05 Cary Coutant <ccoutant@google.com>
+
+ Fix issues with gold undefined symbol diagnostics.
+
+ PR binutils/15435
+ * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
+ check to here.
+ * target-reloc.h (is_strong_undefined): New function.
+ (relocate_section): Move undef vtable symbol check from here.
+ Check for is_strong_undefined.
+
2013-11-22 Cary Coutant <ccoutant@google.com>
* testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
diff --git a/gold/errors.cc b/gold/errors.cc
index b79764bd1d..98db0fdd86 100644
--- a/gold/errors.cc
+++ b/gold/errors.cc
@@ -193,6 +193,11 @@ Errors::undefined_symbol(const Symbol* sym, const std::string& location)
fprintf(stderr,
_("%s: %s: undefined reference to '%s', version '%s'\n"),
location.c_str(), zmsg, sym->demangled_name().c_str(), version);
+
+ if (sym->is_cxx_vtable())
+ gold_info(_("%s: the vtable symbol may be undefined because "
+ "the class is missing its key function"),
+ program_name);
}
// Issue a debugging message.
diff --git a/gold/target-reloc.h b/gold/target-reloc.h
index b544c78f37..d609bcbaa8 100644
--- a/gold/target-reloc.h
+++ b/gold/target-reloc.h
@@ -144,6 +144,12 @@ class Default_comdat_behavior
}
};
+inline bool
+is_strong_undefined(const Symbol* sym)
+{
+ return sym->is_undefined() && sym->binding() != elfcpp::STB_WEAK;
+}
+
// Give an error for a symbol with non-default visibility which is not
// defined locally.
@@ -411,16 +417,10 @@ relocate_section(
}
if (issue_undefined_symbol_error(sym))
- {
- gold_undefined_symbol_at_location(sym, relinfo, i, offset);
- if (sym->is_cxx_vtable())
- gold_info(_("%s: the vtable symbol may be undefined because "
- "the class is missing its key function"),
- program_name);
- }
+ gold_undefined_symbol_at_location(sym, relinfo, i, offset);
else if (sym != NULL
&& sym->visibility() != elfcpp::STV_DEFAULT
- && (sym->is_undefined() || sym->is_from_dynobj()))
+ && (is_strong_undefined(sym) || sym->is_from_dynobj()))
visibility_error(sym);
if (sym != NULL && sym->has_warning())
--
2.11.0
......@@ -21,21 +21,12 @@ cd [% project %]-[% c("version") %]
[% IF c('var/windows') -%]
# XXX: This is needed due to bug 10102.
sed 's/= extern_rt_rel_d;/= extern_rt_rel_d;\n memset (extern_rt_rel_d, 0, PE_IDATA5_SIZE);/' -i ld/pe-dll.c
# Zeroing timestamps in PE headers reliably, see bug 12753.
patch -p1 < ../peXXigen.patch
# Needed for the hardening...
patch -p1 < ../enable-reloc-section-ld.patch
# fix "right-hand operand of comma expression has no effect" warning
patch -p1 < ../fix-warning-bfd.patch
[% END -%]
[% IF c('var/windows-x86_64') -%]
patch -p1 < ../64bit-fixups.patch
[% END -%]
[% IF c("var/linux") && ! c("var/release") -%]
# We need to work around a gold linker bug in 2.24 to get selfrando working,
# see bug 20683.
patch -p1 < $rootdir/binutils-224-gold.patch
[% END -%]
./configure --prefix=$distdir [% c('var/configure_opt') %]
make -j[% c("buildconf/num_procs") %]
make install
......
# vim: filetype=yaml sw=2
version: 2.24
version: 2.29.1
filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
var:
configure_opt: '--disable-multilib --enable-gold --enable-deterministic-archives --enable-plugins'
......@@ -19,11 +19,5 @@ input_files:
- project: container-image
- filename: enable-reloc-section-ld.patch
enable: '[% c("var/windows") %]'
- filename: fix-warning-bfd.patch
enable: '[% c("var/windows") %]'
- filename: 64bit-fixups.patch
enable: '[% c("var/windows-x86_64") %]'
- filename: peXXigen.patch
enable: '[% c("var/windows") %]'
- filename: binutils-224-gold.patch
enable: '[% c("var/linux") %]'
From 093b08a9e7af23a258306b710ebc4556d12f94f7 Mon Sep 17 00:00:00 2001
From fba503a78c50d6134943245d55e820f53e8f19cd Mon Sep 17 00:00:00 2001
From: Erinn Clark <erinn@torproject.org>
Date: Fri, 8 Aug 2014 14:23:44 -0400
Subject: [PATCH] add relocation section so Windows bundles can have ASLR
Patch by skruffy.
---
ld/emultempl/pe.em | 6 +++++
ld/emultempl/pep.em | 8 ++++++-
ld/emultempl/pe.em | 7 ++++++
ld/emultempl/pep.em | 11 ++++++++--
ld/pe-dll.c | 63 ++++++++++++++++++++++++++++++-----------------------
ld/pe-dll.h | 1 +
4 files changed, 50 insertions(+), 28 deletions(-)
4 files changed, 53 insertions(+), 29 deletions(-)
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 5d6da9e..14c07f7 100644
index 339b7c5..3958b81 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -268,6 +268,7 @@ fragment <<EOF
#define OPTION_TERMINAL_SERVER_AWARE (OPTION_WDM_DRIVER + 1)
/* Determinism. */
@@ -272,6 +272,7 @@ fragment <<EOF
#define OPTION_INSERT_TIMESTAMP (OPTION_TERMINAL_SERVER_AWARE + 1)
+#define OPTION_ENABLE_RELOC_SECTION (OPTION_INSERT_TIMESTAMP + 1)
#define OPTION_NO_INSERT_TIMESTAMP (OPTION_INSERT_TIMESTAMP + 1)
#define OPTION_BUILD_ID (OPTION_NO_INSERT_TIMESTAMP + 1)
+#define OPTION_ENABLE_RELOC_SECTION (OPTION_BUILD_ID + 1)
static void
gld${EMULATION_NAME}_add_options
@@ -310,6 +311,7 @@ gld${EMULATION_NAME}_add_options
@@ -315,6 +316,7 @@ gld${EMULATION_NAME}_add_options
{"export-all-symbols", no_argument, NULL, OPTION_EXPORT_ALL},
{"exclude-symbols", required_argument, NULL, OPTION_EXCLUDE_SYMBOLS},
{"exclude-all-symbols", no_argument, NULL, OPTION_EXCLUDE_ALL_SYMBOLS},
......@@ -32,7 +31,7 @@ index 5d6da9e..14c07f7 100644
{"exclude-libs", required_argument, NULL, OPTION_EXCLUDE_LIBS},
{"exclude-modules-for-implib", required_argument, NULL, OPTION_EXCLUDE_MODULES_FOR_IMPLIB},
{"kill-at", no_argument, NULL, OPTION_KILL_ATS},
@@ -773,6 +775,9 @@ gld${EMULATION_NAME}_handle_option (int optc)
@@ -782,6 +784,9 @@ gld${EMULATION_NAME}_handle_option (int optc)
case OPTION_EXCLUDE_ALL_SYMBOLS:
pe_dll_exclude_all_symbols = 1;
break;
......@@ -42,29 +41,30 @@ index 5d6da9e..14c07f7 100644
case OPTION_EXCLUDE_LIBS:
pe_dll_add_excludes (optarg, EXCLUDELIBS);
break;
@@ -1839,6 +1844,7 @@ gld_${EMULATION_NAME}_finish (void)
if (link_info.shared
@@ -2076,6 +2081,8 @@ gld_${EMULATION_NAME}_finish (void)
#if !defined(TARGET_IS_shpe)
|| (!link_info.relocatable && pe_def_file->num_exports != 0)
+ || (!link_info.relocatable && pe_dll_enable_reloc_section)
|| (!bfd_link_relocatable (&link_info)
&& pe_def_file->num_exports != 0)
+ || (!bfd_link_relocatable (&link_info)
+ && pe_dll_enable_reloc_section)
#endif
)
{
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index b738800..b566903 100644
index c253d2f..fccbd63 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -242,7 +242,8 @@ enum options
OPTION_NO_BIND,
OPTION_WDM_DRIVER,
@@ -246,7 +246,8 @@ enum options
OPTION_INSERT_TIMESTAMP,
- OPTION_TERMINAL_SERVER_AWARE
+ OPTION_TERMINAL_SERVER_AWARE,
OPTION_NO_INSERT_TIMESTAMP,
OPTION_TERMINAL_SERVER_AWARE,
- OPTION_BUILD_ID
+ OPTION_BUILD_ID,
+ OPTION_ENABLE_RELOC_SECTION
};
static void
@@ -284,6 +285,7 @@ gld${EMULATION_NAME}_add_options
@@ -288,6 +289,7 @@ gld${EMULATION_NAME}_add_options
{"export-all-symbols", no_argument, NULL, OPTION_EXPORT_ALL},
{"exclude-symbols", required_argument, NULL, OPTION_EXCLUDE_SYMBOLS},
{"exclude-all-symbols", no_argument, NULL, OPTION_EXCLUDE_ALL_SYMBOLS},
......@@ -72,7 +72,7 @@ index b738800..b566903 100644
{"exclude-libs", required_argument, NULL, OPTION_EXCLUDE_LIBS},
{"exclude-modules-for-implib", required_argument, NULL, OPTION_EXCLUDE_MODULES_FOR_IMPLIB},
{"kill-at", no_argument, NULL, OPTION_KILL_ATS},
@@ -727,6 +729,9 @@ gld${EMULATION_NAME}_handle_option (int optc)
@@ -739,6 +741,9 @@ gld${EMULATION_NAME}_handle_option (int optc)
case OPTION_EXCLUDE_ALL_SYMBOLS:
pep_dll_exclude_all_symbols = 1;
break;
......@@ -82,19 +82,22 @@ index b738800..b566903 100644
case OPTION_EXCLUDE_LIBS:
pep_dll_add_excludes (optarg, EXCLUDELIBS);
break;
@@ -1618,6 +1623,7 @@ gld_${EMULATION_NAME}_finish (void)
@@ -1857,7 +1862,9 @@ gld_${EMULATION_NAME}_finish (void)
#ifdef DLL_SUPPORT
if (link_info.shared
+ || (!link_info.relocatable && pe_dll_enable_reloc_section)
|| (!link_info.relocatable && pep_def_file->num_exports != 0))
if (bfd_link_pic (&link_info)
|| (!bfd_link_relocatable (&link_info)
- && pep_def_file->num_exports != 0))
+ && pe_dll_enable_reloc_section)
+ || (!bfd_link_relocatable (&link_info)
+ && pep_def_file->num_exports != 0))
{
pep_dll_fill_sections (link_info.output_bfd, &link_info);
if (command_line.out_implib_filename)
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index e9e133b..4230dc3 100644
index c398f23..3797f1a 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -152,6 +152,7 @@ def_file * pe_def_file = 0;
@@ -151,6 +151,7 @@ def_file * pe_def_file = 0;
int pe_dll_export_everything = 0;
int pe_dll_exclude_all_symbols = 0;
int pe_dll_do_default_excludes = 1;
......@@ -102,10 +105,10 @@ index e9e133b..4230dc3 100644
int pe_dll_kill_ats = 0;
int pe_dll_stdcall_aliases = 0;
int pe_dll_warn_dup_exports = 0;
@@ -3370,8 +3371,15 @@ pe_dll_build_sections (bfd *abfd, struct bfd_link_info *info)
@@ -3430,8 +3431,15 @@ pe_dll_build_sections (bfd *abfd, struct bfd_link_info *info)
process_def_file_and_drectve (abfd, info);
if (pe_def_file->num_exports == 0 && !info->shared)
if (pe_def_file->num_exports == 0 && !bfd_link_pic (info))
- return;
-
+ {
......@@ -120,7 +123,7 @@ index e9e133b..4230dc3 100644
generate_edata (abfd, info);
build_filler_bfd (1);
pe_output_file_set_long_section_names (filler_bfd);
@@ -3386,13 +3394,9 @@ pe_exe_build_sections (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
@@ -3446,13 +3454,9 @@ pe_exe_build_sections (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED)
pe_output_file_set_long_section_names (filler_bfd);
}
......@@ -136,13 +139,13 @@ index e9e133b..4230dc3 100644
generate_reloc (abfd, info);
if (reloc_sz > 0)
{
@@ -3409,38 +3413,43 @@ pe_dll_fill_sections (bfd *abfd, struct bfd_link_info *info)
@@ -3469,38 +3473,43 @@ pe_dll_fill_sections (bfd *abfd, struct bfd_link_info *info)
lang_do_assignments (lang_final_phase_enum);
}
- fill_edata (abfd, info);
-
- if (info->shared && !info->pie)
- if (bfd_link_dll (info))
- pe_data (abfd)->dll = 1;
-
- edata_s->contents = edata_d;
......@@ -174,7 +177,7 @@ index e9e133b..4230dc3 100644
- /* Resize the sections. */
- lang_reset_memory_regions ();
- lang_size_sections (NULL, TRUE);
+ if (info->shared && !info->pie)
+ if (bfd_link_pic (info) && !bfd_link_pie (info))
+ pe_data (abfd)->dll = 1;
- /* Redo special stuff. */
......@@ -200,10 +203,10 @@ index e9e133b..4230dc3 100644
bfd_boolean
diff --git a/ld/pe-dll.h b/ld/pe-dll.h
index 4697390..2bf71d9 100644
index 48d169b..05ff72b 100644
--- a/ld/pe-dll.h
+++ b/ld/pe-dll.h
@@ -31,6 +31,7 @@ extern def_file *pe_def_file;
@@ -30,6 +30,7 @@ extern def_file *pe_def_file;
extern int pe_dll_export_everything;
extern int pe_dll_exclude_all_symbols;
extern int pe_dll_do_default_excludes;
......@@ -212,5 +215,5 @@ index 4697390..2bf71d9 100644
extern int pe_dll_stdcall_aliases;
extern int pe_dll_warn_dup_exports;
--
2.0.1
2.1.4
From 27b829ee701e29804216b3803fbaeb629be27491 Mon Sep 17 00:00:00 2001
From: Nick Clifton <nickc@redhat.com>
Date: Wed, 29 Jan 2014 13:46:39 +0000
Subject: [PATCH] Following up on Tom's suggestion I am checking in a patch to
replace the various bfd_xxx_set macros with static inline functions, so that
we can avoid compile time warnings about comma expressions with unused
values.
* bfd-in.h (bfd_set_section_vma): Delete.
(bfd_set_section_alignment): Delete.
(bfd_set_section_userdata): Delete.
(bfd_set_cacheable): Delete.
* bfd.c (bfd_set_cacheable): New static inline function.
* section.c (bfd_set_section_userdata): Likewise.
(bfd_set_section_vma): Likewise.
(bfd_set_section_alignment): Likewise.
* bfd-in2.h: Regenerate.
---
bfd/bfd-in.h | 5 -----
bfd/bfd-in2.h | 41 +++++++++++++++++++++++++++++++++++------
bfd/bfd.c | 8 ++++++++
bfd/section.c | 26 ++++++++++++++++++++++++++
5 files changed, 81 insertions(+), 11 deletions(-)
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 3afd71b..c7c5a7d 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -292,9 +292,6 @@ typedef struct bfd_section *sec_ptr;
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
/* Find the address one past the end of SEC. */
#define bfd_get_section_limit(bfd, sec) \
(((bfd)->direction != write_direction && (sec)->rawsize != 0 \
@@ -517,8 +514,6 @@ extern void warn_deprecated (const char *, const char *, int, const char *);
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
-
extern bfd_boolean bfd_cache_close
(bfd *abfd);
/* NB: This declaration should match the autogenerated one in libbfd.h. */
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 71996db..b5aeb40 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -299,9 +299,6 @@ typedef struct bfd_section *sec_ptr;
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
/* Find the address one past the end of SEC. */
#define bfd_get_section_limit(bfd, sec) \
(((bfd)->direction != write_direction && (sec)->rawsize != 0 \
@@ -524,8 +521,6 @@ extern void warn_deprecated (const char *, const char *, int, const char *);
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
-
extern bfd_boolean bfd_cache_close
(bfd *abfd);
/* NB: This declaration should match the autogenerated one in libbfd.h. */
@@ -1029,7 +1024,7 @@ bfd *bfd_openr (const char *filename, const char *target);
bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
-bfd *bfd_openstreamr (const char *, const char *, void *);
+bfd *bfd_openstreamr (const char * filename, const char * target, void * stream);
bfd *bfd_openr_iovec (const char *filename, const char *target,
void *(*open_func) (struct bfd *nbfd,
@@ -1596,6 +1591,32 @@ struct relax_table {
int size;
};
+/* Note: the following are provided as inline functions rather than macros
+ because not all callers use the return value. A macro implementation
+ would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
+ compilers will complain about comma expressions that have no effect. */
+static inline bfd_boolean
+bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val)
+{
+ ptr->userdata = val;
+ return TRUE;
+}
+
+static inline bfd_boolean
+bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
+{
+ ptr->vma = ptr->lma = val;
+ ptr->user_set_vma = TRUE;
+ return TRUE;
+}
+
+static inline bfd_boolean
+bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val)
+{
+ ptr->alignment_power = val;
+ return TRUE;
+}
+
/* These sections are global, and are managed by BFD. The application
and target back end are not permitted to change the values in
these sections. */
@@ -6415,6 +6436,14 @@ struct bfd
unsigned int selective_search : 1;
};
+/* See note beside bfd_set_section_userdata. */
+static inline bfd_boolean
+bfd_set_cacheable (bfd * abfd, bfd_boolean val)
+{
+ abfd->cacheable = val;
+ return TRUE;
+}
+
typedef enum bfd_error
{
bfd_error_no_error = 0,
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 8d0580c..2d174f3 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -311,6 +311,14 @@ CODE_FRAGMENT
. unsigned int selective_search : 1;
.};
.
+.{* See note beside bfd_set_section_userdata. *}
+.static inline bfd_boolean
+.bfd_set_cacheable (bfd * abfd, bfd_boolean val)
+.{
+. abfd->cacheable = val;
+. return TRUE;
+.}
+.
*/
#include "sysdep.h"
diff --git a/bfd/section.c b/bfd/section.c
index fb19d8c..a661228 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -542,6 +542,32 @@ CODE_FRAGMENT
. int size;
.};
.
+.{* Note: the following are provided as inline functions rather than macros
+. because not all callers use the return value. A macro implementation
+. would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
+. compilers will complain about comma expressions that have no effect. *}
+.static inline bfd_boolean
+.bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val)
+.{
+. ptr->userdata = val;
+. return TRUE;
+.}
+.
+.static inline bfd_boolean
+.bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
+.{
+. ptr->vma = ptr->lma = val;
+. ptr->user_set_vma = TRUE;
+. return TRUE;
+.}
+.
+.static inline bfd_boolean
+.bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val)
+.{
+. ptr->alignment_power = val;
+. return TRUE;
+.}
+.
.{* These sections are global, and are managed by BFD. The application
. and target back end are not permitted to change the values in
. these sections. *}
--
2.1.4
diff -crB binutils-2.24/bfd/peXXigen.c binutils-2.24/bfd/peXXigen.c
*** binutils-2.24/bfd/peXXigen.c Tue Nov 26 11:37:33 2013
--- binutils-2.24/bfd/peXXigen.c Mon Aug 4 07:10:15 2014
***************
*** 795,800 ****
--- 795,802 ----
/* Only use a real timestamp if the option was chosen. */
if ((pe_data (abfd)->insert_timestamp))
H_PUT_32 (abfd, time(0), filehdr_out->f_timdat);
+ else
+ H_PUT_32 (abfd, 0, filehdr_out->f_timdat);
PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr,
filehdr_out->f_symptr);
......@@ -29,7 +29,7 @@ sed 's/msvcrt/msvcr100/' -i $distdir/msvcr100.spec
sed 's/msvcrt/msvcr100/' -i gcc-[% c("var/gcc_version") %]/gcc/config/i386/t-mingw-w32
# LDFLAGS_FOR_TARGET does not work for some reason. Thus, we take
# CFLAGS_FOR_TARGET.
export CFLAGS_FOR_TARGET="-specs=$distdir/msvcr100.spec -Wl,--nxcompat -Wl,--dynamicbase"
export CFLAGS_FOR_TARGET="-specs=$distdir/msvcr100.spec -Wl,--nxcompat -Wl,--dynamicbase -Wl,--no-insert-timestamp"
gcc-[% c("var/gcc_version") %]/configure --prefix=$distdir --target=[% c("arch") %]-w64-mingw32 --disable-multilib --enable-languages=c,c++
make -j[% c("buildconf/num_procs") %] all-gcc
make install-gcc
......@@ -59,17 +59,17 @@ mkdir -p $distdir/helpers
cat > $distdir/helpers/[% c("arch") %]-w64-mingw32-g++ << 'EOF'
#!/bin/sh
/var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-g++ -Wl,--dynamicbase -Wl,--nxcompat -Wl,--enable-reloc-section -fstack-protector --param ssp-buffer-size=4 -fno-strict-overflow "$@"
/var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-g++ -Wl,--dynamicbase -Wl,--nxcompat -Wl,--enable-reloc-section -Wl,--no-insert-timestamp -fstack-protector --param ssp-buffer-size=4 -fno-strict-overflow "$@"
EOF
cat > $distdir/helpers/[% c("arch") %]-w64-mingw32-gcc << 'EOF'
#!/bin/sh
/var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-gcc -Wl,--dynamicbase -Wl,--nxcompat -Wl,--enable-reloc-section -fstack-protector --param ssp-buffer-size=4 -fno-strict-overflow "$@"
/var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-gcc -Wl,--dynamicbase -Wl,--nxcompat -Wl,--enable-reloc-section -Wl,--no-insert-timestamp -fstack-protector --param ssp-buffer-size=4 -fno-strict-overflow "$@"
EOF
cat > $distdir/helpers/[% c("arch") %]-w64-mingw32-ld << 'EOF'
#!/bin/sh
/var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-ld --dynamicbase --nxcompat --enable-reloc-section -lssp -L$gcclibs "$@"
/var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-ld --dynamicbase --nxcompat --enable-reloc-section --no-insert-timestamp -lssp -L$gcclibs "$@"
EOF