aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-08-24 10:02:01 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-08-24 10:02:09 -0300
commite2bd6d4d2f35ca1ff9f7d6667f4274efa7781df3 (patch)
treed82a25d5fb87d51b26e6b77ac1d08cce664c9a62
parente0f59b0a7b5a2d879b0afc665ca0f28fb5b3d54e (diff)
parenta595e022494154dcc2472784252394a035c16cb7 (diff)
downloadgdb-e2bd6d4d2f35ca1ff9f7d6667f4274efa7781df3.zip
gdb-e2bd6d4d2f35ca1ff9f7d6667f4274efa7781df3.tar.gz
gdb-e2bd6d4d2f35ca1ff9f7d6667f4274efa7781df3.tar.bz2
Merge with binutils-2_28-branch rev a595e022494
Change-Id: Id5cdd9fca875884f6e31a9a0847aa098d956bf23
-rw-r--r--bfd/ChangeLog9
-rw-r--r--bfd/elf32-s390.c4
-rw-r--r--bfd/elf64-s390.c8
-rw-r--r--elfcpp/ChangeLog7
-rw-r--r--elfcpp/elfcpp.h17
-rw-r--r--gold/ChangeLog6
-rw-r--r--gold/compressed_output.cc4
7 files changed, 52 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index a81b982..496a5ca 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,12 @@
+2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
+ pointer check for htab->elf.irelplt.
+ * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
+
2017-07-25 Tristan Gingold <gingold@adacore.com>
* version.m4: Bump version to 2.28.2
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index ddb6f5b..7f22ae1 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -3930,7 +3930,9 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd,
break;
case DT_PLTRELSZ:
- dyn.d_un.d_val = htab->elf.srelplt->size + htab->elf.irelplt->size;
+ dyn.d_un.d_val = htab->elf.srelplt->size;
+ if (htab->elf.irelplt)
+ dyn.d_un.d_val += htab->elf.irelplt->size;
break;
}
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index fbbf8d6..a59777c 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -3729,7 +3729,9 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd,
break;
case DT_PLTRELSZ:
- dyn.d_un.d_val = htab->elf.srelplt->size + htab->elf.irelplt->size;
+ dyn.d_un.d_val = htab->elf.srelplt->size;
+ if (htab->elf.irelplt)
+ dyn.d_un.d_val += htab->elf.irelplt->size;
break;
case DT_RELASZ:
@@ -3740,7 +3742,9 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd,
linker script arranges for .rela.plt to follow all
other relocation sections, we don't have to worry
about changing the DT_RELA entry. */
- dyn.d_un.d_val -= htab->elf.srelplt->size + htab->elf.irelplt->size;
+ dyn.d_un.d_val -= htab->elf.srelplt->size;
+ if (htab->elf.irelplt)
+ dyn.d_un.d_val -= htab->elf.irelplt->size;
break;
}
diff --git a/elfcpp/ChangeLog b/elfcpp/ChangeLog
index 6a61d61..b1db015 100644
--- a/elfcpp/ChangeLog
+++ b/elfcpp/ChangeLog
@@ -1,3 +1,10 @@
+2017-07-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gold/21857
+ * elfcpp.h (Chdr_write): Add put_ch_reserved.
+ (Chdr_write<64, true>::put_ch_reserved): New.
+ (Chdr_write<64, false>::put_ch_reserved): Likewise.
+
2017-01-02 Alan Modra <amodra@gmail.com>
Update year range in copyright notice of all files.
diff --git a/elfcpp/elfcpp.h b/elfcpp/elfcpp.h
index 43ba5c4..98e1ada 100644
--- a/elfcpp/elfcpp.h
+++ b/elfcpp/elfcpp.h
@@ -1345,10 +1345,27 @@ class Chdr_write
put_ch_addralign(typename Elf_types<size>::Elf_WXword v)
{ this->p_->ch_addralign = Convert<size, big_endian>::convert_host(v); }
+ void
+ put_ch_reserved(Elf_Word);
+
private:
internal::Chdr_data<size>* p_;
};
+template<>
+inline void
+elfcpp::Chdr_write<64, true>::put_ch_reserved(Elf_Word v)
+{
+ this->p_->ch_reserved = v;
+}
+
+template<>
+inline void
+elfcpp::Chdr_write<64, false>::put_ch_reserved(Elf_Word v)
+{
+ this->p_->ch_reserved = v;
+}
+
// Accessor class for an ELF segment header.
template<int size, bool big_endian>
diff --git a/gold/ChangeLog b/gold/ChangeLog
index d27713d..7be51ff 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,9 @@
+2017-07-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gold/21857
+ * compressed_output.cc (Output_compressed_section::set_final_data_size):
+ Call put_ch_reserved to clear the reserved field for 64-bit ELF.
+
2017-07-06 Han Shen <shenhan@google.com>
PR gold/21491
diff --git a/gold/compressed_output.cc b/gold/compressed_output.cc
index 4374ba1..45077f7 100644
--- a/gold/compressed_output.cc
+++ b/gold/compressed_output.cc
@@ -286,6 +286,8 @@ Output_compressed_section::set_final_data_size()
chdr.put_ch_type(elfcpp::ELFCOMPRESS_ZLIB);
chdr.put_ch_size(uncompressed_size);
chdr.put_ch_addralign(addralign);
+ // Clear the reserved field.
+ chdr.put_ch_reserved(0);
}
else
{
@@ -293,6 +295,8 @@ Output_compressed_section::set_final_data_size()
chdr.put_ch_type(elfcpp::ELFCOMPRESS_ZLIB);
chdr.put_ch_size(uncompressed_size);
chdr.put_ch_addralign(addralign);
+ // Clear the reserved field.
+ chdr.put_ch_reserved(0);
}
}
else