diff options
author | Alexander Ivchenko <alexander.ivchenko@intel.com> | 2014-03-05 17:04:07 +0400 |
---|---|---|
committer | Alexander Ivchenko <alexander.ivchenko@intel.com> | 2014-03-05 17:04:07 +0400 |
commit | 5a2caf34e4995860baf405552163df288000b7bf (patch) | |
tree | 0d015fa274501eede10a77707abb183216ad6f60 /binutils-2.22/gold/layout.cc | |
parent | 4c195079b72a16cb62cb9a6e8010b3dc0202795b (diff) | |
download | toolchain_binutils-5a2caf34e4995860baf405552163df288000b7bf.tar.gz toolchain_binutils-5a2caf34e4995860baf405552163df288000b7bf.tar.bz2 toolchain_binutils-5a2caf34e4995860baf405552163df288000b7bf.zip |
[2.21, 2.22, 2.23] Backport of the patch for keeping lto sections
when linking with "-r" options (ld bfd behaviour).
2012-10-16 Sriraman Tallam <tmsriram@google.com>
* layout.cc (Layout::include_section): Keep sections marked
SHF_EXCLUDE when doing relocatable links.
Change-Id: Icc49c2b8e34097ec95d869a70d367ef6faf320ed
Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
Diffstat (limited to 'binutils-2.22/gold/layout.cc')
-rw-r--r-- | binutils-2.22/gold/layout.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/binutils-2.22/gold/layout.cc b/binutils-2.22/gold/layout.cc index fb53c217..bad1a522 100644 --- a/binutils-2.22/gold/layout.cc +++ b/binutils-2.22/gold/layout.cc @@ -580,7 +580,8 @@ bool Layout::include_section(Sized_relobj_file<size, big_endian>*, const char* name, const elfcpp::Shdr<size, big_endian>& shdr) { - if (shdr.get_sh_flags() & elfcpp::SHF_EXCLUDE) + if (!parameters->options().relocatable() + && (shdr.get_sh_flags() & elfcpp::SHF_EXCLUDE)) return false; switch (shdr.get_sh_type()) |