diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2014-06-02 16:40:25 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-06-02 16:40:25 +0000 |
commit | 2a6558a8ecfb81d75215b4ec7dc61113e12cfd5f (patch) | |
tree | bd86e0b1206c4ea6ecf8bd47ff88c6cc7674e3bb | |
parent | b2a417bdb17191ef2afc20bbd308e308c0730403 (diff) | |
parent | 7a17fb955bb42018c3c84e003700ac120c3502d4 (diff) | |
download | toolchain_binutils-2a6558a8ecfb81d75215b4ec7dc61113e12cfd5f.tar.gz toolchain_binutils-2a6558a8ecfb81d75215b4ec7dc61113e12cfd5f.tar.bz2 toolchain_binutils-2a6558a8ecfb81d75215b4ec7dc61113e12cfd5f.zip |
Merge "[2.24] Fix assert failure with --emit-relocs and .eh_frame sections by backporting the following patch from mainline:"
-rw-r--r-- | binutils-2.24/gold/object.cc | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/binutils-2.24/gold/object.cc b/binutils-2.24/gold/object.cc index c98b3c5a..b1feacc5 100644 --- a/binutils-2.24/gold/object.cc +++ b/binutils-2.24/gold/object.cc @@ -1704,6 +1704,28 @@ Sized_relobj_file<size, big_endian>::do_layout(Symbol_table* symtab, if (!is_pass_two) layout->layout_gnu_stack(seen_gnu_stack, gnu_stack_flags, this); + // Handle the .eh_frame sections after the other sections. + gold_assert(!is_pass_one || eh_frame_sections.empty()); + for (std::vector<unsigned int>::const_iterator p = eh_frame_sections.begin(); + p != eh_frame_sections.end(); + ++p) + { + unsigned int i = *p; + const unsigned char* pshdr; + pshdr = section_headers_data + i * This::shdr_size; + typename This::Shdr shdr(pshdr); + + this->layout_eh_frame_section(layout, + symbols_data, + symbols_size, + symbol_names_data, + symbol_names_size, + i, + shdr, + reloc_shndx[i], + reloc_type[i]); + } + // When doing a relocatable link handle the reloc sections at the // end. Garbage collection and Identical Code Folding is not // turned on for relocatable code. @@ -1756,28 +1778,6 @@ Sized_relobj_file<size, big_endian>::do_layout(Symbol_table* symtab, out_section_offsets[i] = invalid_address; } - // Handle the .eh_frame sections at the end. - gold_assert(!is_pass_one || eh_frame_sections.empty()); - for (std::vector<unsigned int>::const_iterator p = eh_frame_sections.begin(); - p != eh_frame_sections.end(); - ++p) - { - unsigned int i = *p; - const unsigned char* pshdr; - pshdr = section_headers_data + i * This::shdr_size; - typename This::Shdr shdr(pshdr); - - this->layout_eh_frame_section(layout, - symbols_data, - symbols_size, - symbol_names_data, - symbol_names_size, - i, - shdr, - reloc_shndx[i], - reloc_type[i]); - } - // When building a .gdb_index section, scan the .debug_info and // .debug_types sections. gold_assert(!is_pass_one |