From bec5b57944f72ea8b37f1ceccec3655c6b718042 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Thu, 14 Apr 2011 23:29:41 +0000 Subject: [PATCH] * gold/layout.cc (Layout::symtab_section_offset): New function. * gold/layout.h (Layout::symtab_section_offset): New function. * gold/reloc.cc (Sized_relobj::do_relocate): Call it. --- gold/ChangeLog | 6 ++++++ gold/layout.cc | 10 ++++++++++ gold/layout.h | 4 ++++ gold/reloc.cc | 2 +- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index bb29127..38d528c 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,9 @@ +2011-04-14 Cary Coutant + + * gold/layout.cc (Layout::symtab_section_offset): New function. + * gold/layout.h (Layout::symtab_section_offset): New function. + * gold/reloc.cc (Sized_relobj::do_relocate): Call it. + 2011-04-12 Ian Lance Taylor * configure.ac: Check for sys/mman.h and mmap. Check for mremap diff --git a/gold/layout.cc b/gold/layout.cc index 26ac130..7afb21f 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -4371,6 +4371,16 @@ Layout::make_output_segment(elfcpp::Elf_Word type, elfcpp::Elf_Word flags) return oseg; } +// Return the file offset of the normal symbol table. + +off_t +Layout::symtab_section_offset() const +{ + if (this->symtab_section_ != NULL) + return this->symtab_section_->offset(); + return 0; +} + // Write out the Output_sections. Most won't have anything to write, // since most of the data will come from input sections which are // handled elsewhere. But some Output_sections do have Output_data. diff --git a/gold/layout.h b/gold/layout.h index 917856e..907181f 100644 --- a/gold/layout.h +++ b/gold/layout.h @@ -685,6 +685,10 @@ class Layout return this->symtab_section_; } + // Return the file offset of the normal symbol table. + off_t + symtab_section_offset() const; + // Return the dynamic symbol table. Output_section* dynsym_section() const diff --git a/gold/reloc.cc b/gold/reloc.cc index 7103572..c58e42b 100644 --- a/gold/reloc.cc +++ b/gold/reloc.cc @@ -691,7 +691,7 @@ Sized_relobj::do_relocate(const Symbol_table* symtab, // Write out the local symbols. this->write_local_symbols(of, layout->sympool(), layout->dynpool(), layout->symtab_xindex(), layout->dynsym_xindex(), - layout->symtab_section()->offset()); + layout->symtab_section_offset()); } // Sort a Read_multiple vector by file offset. -- 2.7.4