From 886f533adaf49c51722d4b02a309e88dd8c1c239 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 29 Jun 2011 21:26:40 +0000 Subject: PR gold/12695 * layout.cc (Layout::symtab_section_shndx): New function. * layout.h (class Layout): Declare symtab_section_shndx. * output.cc (Output_section::write_header): Call it. --- gold/layout.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gold/layout.cc') diff --git a/gold/layout.cc b/gold/layout.cc index 0ef13af..a52d35c 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -4536,6 +4536,17 @@ Layout::symtab_section_offset() const return 0; } +// Return the section index of the normal symbol table. It may have +// been stripped by the -s/--strip-all option. + +unsigned int +Layout::symtab_section_shndx() const +{ + if (this->symtab_section_ != NULL) + return this->symtab_section_->out_shndx(); + 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. -- cgit v1.1