diff options
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r-- | gold/symtab.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc index 6865190f88..35989f0e63 100644 --- a/gold/symtab.cc +++ b/gold/symtab.cc @@ -3120,7 +3120,14 @@ Symbol_table::sized_write_globals(const Stringpool* sympool, break; case Symbol::IN_OUTPUT_SEGMENT: - shndx = elfcpp::SHN_ABS; + { + Output_segment* oseg = sym->output_segment(); + Output_section* osect = oseg->first_section(); + if (osect == NULL) + shndx = elfcpp::SHN_ABS; + else + shndx = osect->out_shndx(); + } break; case Symbol::IS_CONSTANT: |