aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/emultempl/elf32.em7
-rw-r--r--ld/emultempl/pe.em4
-rw-r--r--ld/emultempl/pep.em4
4 files changed, 18 insertions, 5 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 93a852a..3b69e31 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+2015-09-23 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/elf32.em (ehdr_start_empty): New static variable.
+ (before_allocation): Use it to initialise ehdr_start_save.
+ * emultempl/pe.em (write_build_id): Remove useless double
+ parenthesis.
+ * emultempl/pep.em (write_build_id): Likewise.
+
2015-09-22 H.J. Lu <hongjiu.lu@intel.com>
* emultempl/alphaelf.em (alpha_after_parse): Call
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index b7ddca3..ea6d48c 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1449,6 +1449,11 @@ gld${EMULATION_NAME}_append_to_separated_string (char **to, char *op_arg)
}
}
+#if defined(__GNUC__) && GCC_VERSION < 4006
+ /* Work around a GCC uninitialized warning bug fixed in GCC 4.6. */
+static struct bfd_link_hash_entry ehdr_start_empty;
+#endif
+
/* This is called after the sections have been attached to output
sections, but before any sizes or addresses have been set. */
@@ -1461,7 +1466,7 @@ gld${EMULATION_NAME}_before_allocation (void)
struct elf_link_hash_entry *ehdr_start = NULL;
#if defined(__GNUC__) && GCC_VERSION < 4006
/* Work around a GCC uninitialized warning bug fixed in GCC 4.6. */
- struct bfd_link_hash_entry ehdr_start_save = ehdr_start_save;
+ struct bfd_link_hash_entry ehdr_start_save = ehdr_start_empty;
#else
struct bfd_link_hash_entry ehdr_start_save;
#endif
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 72e2f11..04a7f5c 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -1312,7 +1312,7 @@ write_build_id (bfd *abfd)
struct bfd_link_order *l = NULL;
for (l = asec->map_head.link_order; l != NULL; l = l->next)
{
- if ((l->type == bfd_indirect_link_order))
+ if (l->type == bfd_indirect_link_order)
{
if (l->u.indirect.section == t->build_id.sec)
{
@@ -1364,7 +1364,7 @@ write_build_id (bfd *abfd)
if (bfd_seek (abfd, asec->filepos + link_order->offset, SEEK_SET) != 0)
return 0;
- if ((bfd_bwrite (contents, size, abfd) != size))
+ if (bfd_bwrite (contents, size, abfd) != size)
return 0;
/* Construct the CodeView record. */
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index c82e496..0b740c3 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -1276,7 +1276,7 @@ write_build_id (bfd *abfd)
struct bfd_link_order *l = NULL;
for (l = asec->map_head.link_order; l != NULL; l = l->next)
{
- if ((l->type == bfd_indirect_link_order))
+ if (l->type == bfd_indirect_link_order)
{
if (l->u.indirect.section == t->build_id.sec)
{
@@ -1328,7 +1328,7 @@ write_build_id (bfd *abfd)
if (bfd_seek (abfd, asec->filepos + link_order->offset, SEEK_SET) != 0)
return 0;
- if ((bfd_bwrite (contents, size, abfd) != size))
+ if (bfd_bwrite (contents, size, abfd) != size)
return 0;
/* Construct the CodeView record. */