aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2011-06-29 21:26:40 +0000
committerIan Lance Taylor <ian@airs.com>2011-06-29 21:26:40 +0000
commit886f533adaf49c51722d4b02a309e88dd8c1c239 (patch)
tree130f63d0501a03ee8b6c36227576821cb332f2ea /gold/layout.cc
parenta4e064680b35eab949a2511d159bc9fe921f84e7 (diff)
downloadgdb-886f533adaf49c51722d4b02a309e88dd8c1c239.zip
gdb-886f533adaf49c51722d4b02a309e88dd8c1c239.tar.gz
gdb-886f533adaf49c51722d4b02a309e88dd8c1c239.tar.bz2
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.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc11
1 files changed, 11 insertions, 0 deletions
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.