diff options
author | Doug Kwan <dougkwan@google.com> | 2011-05-13 00:36:27 -0700 |
---|---|---|
committer | Doug Kwan <dougkwan@google.com> | 2011-05-13 00:51:56 -0700 |
commit | ace255bac8202b32529b993f37d3d88ab0c57b86 (patch) | |
tree | 4875b57e6cae9faf62f1d28d74ac4c0f981b966e /binutils-20100303/gold/layout.cc | |
parent | a4316ba2b7698435a68e9826cabd87ae43dad182 (diff) | |
download | toolchain_binutils-ace255bac8202b32529b993f37d3d88ab0c57b86.tar.gz toolchain_binutils-ace255bac8202b32529b993f37d3d88ab0c57b86.tar.bz2 toolchain_binutils-ace255bac8202b32529b993f37d3d88ab0c57b86.zip |
Sync internal and external versions.
-Apply upstream fix.
http://sourceware.org/ml/binutils/2011-01/msg00142.html
-Fix SHF_LINK_ORDER in section header of an SHT_ARM_EXIDX section.
Change-Id: I1f0d2bee7ff8010f051058ec1bc4705d1a062f37
Diffstat (limited to 'binutils-20100303/gold/layout.cc')
-rw-r--r-- | binutils-20100303/gold/layout.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/binutils-20100303/gold/layout.cc b/binutils-20100303/gold/layout.cc index 7beb3c2a..d7e2da65 100644 --- a/binutils-20100303/gold/layout.cc +++ b/binutils-20100303/gold/layout.cc @@ -1,6 +1,6 @@ // layout.cc -- lay out output file sections for gold -// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. // Written by Ian Lance Taylor <iant@google.com>. // This file is part of gold. @@ -858,6 +858,10 @@ Layout::layout_eh_frame(Sized_relobj<size, big_endian>* object, { os->update_flags_for_input_section(shdr.get_sh_flags()); + // A writable .eh_frame section is a RELRO section. + if ((shdr.get_sh_flags() & elfcpp::SHF_WRITE) != 0) + os->set_is_relro(); + // We found a .eh_frame section we are going to optimize, so now // we can add the set of optimized sections to the output // section. We need to postpone adding this until we've found a @@ -2547,6 +2551,12 @@ Layout::set_segment_offsets(const Target* target, Output_segment* load_seg, addr = align_address(addr, (*p)->maximum_alignment()); off = orig_off + ((addr - orig_addr) & (abi_pagesize - 1)); off = align_file_offset(off, addr, abi_pagesize); + + increase_relro = this->increase_relro_; + if (this->script_options_->saw_sections_clause()) + increase_relro = 0; + has_relro = false; + new_addr = (*p)->set_section_addresses(this, true, addr, &increase_relro, &has_relro, |