* layout.cc (Layout::symtab_section_shndx): New function.
* layout.h (class Layout): Declare symtab_section_shndx.
* output.cc (Output_section::write_header): Call it.
+2011-06-29 Ian Lance Taylor <iant@google.com>
+
+ 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.
+
2011-06-29 Ian Lance Taylor <iant@google.com>
PR gold/12818
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.
off_t
symtab_section_offset() const;
+ // Return the section index of the normal symbol tabl.e
+ unsigned int
+ symtab_section_shndx() const;
+
// Return the dynamic symbol table.
Output_section*
dynsym_section() const
if (this->link_section_ != NULL)
oshdr->put_sh_link(this->link_section_->out_shndx());
else if (this->should_link_to_symtab_)
- oshdr->put_sh_link(layout->symtab_section()->out_shndx());
+ oshdr->put_sh_link(layout->symtab_section_shndx());
else if (this->should_link_to_dynsym_)
oshdr->put_sh_link(layout->dynsym_section()->out_shndx());
else