diff options
author | Ian Lance Taylor <iant@google.com> | 2007-11-20 04:26:15 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-11-20 04:26:15 +0000 |
commit | 4f833eee90d9ad55784bfb63abd41f256a16a2f9 (patch) | |
tree | 395457a60d127b09815f222bf239c66c3fc5ce65 /gold/output.cc | |
parent | ac4fbf0a418f12de7b51b5b856984f1cd29faf59 (diff) | |
download | gdb-4f833eee90d9ad55784bfb63abd41f256a16a2f9.zip gdb-4f833eee90d9ad55784bfb63abd41f256a16a2f9.tar.gz gdb-4f833eee90d9ad55784bfb63abd41f256a16a2f9.tar.bz2 |
From Craig Silverstein: Also set entsize for .debug_str sections.
Diffstat (limited to 'gold/output.cc')
-rw-r--r-- | gold/output.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gold/output.cc b/gold/output.cc index 5e9758b..97277e0 100644 --- a/gold/output.cc +++ b/gold/output.cc @@ -1114,11 +1114,15 @@ Output_section::add_input_section(Sized_relobj<size, big_endian>* object, this->addralign_ = addralign; typename elfcpp::Elf_types<size>::Elf_WXword sh_flags = shdr.get_sh_flags(); + uint64_t entsize = shdr.get_sh_entsize(); // .debug_str is a mergeable string section, but is not always so // marked by compilers. Mark manually here so we can optimize. if (strcmp(secname, ".debug_str") == 0) - sh_flags |= (elfcpp::SHF_MERGE | elfcpp::SHF_STRINGS); + { + sh_flags |= (elfcpp::SHF_MERGE | elfcpp::SHF_STRINGS); + entsize = 1; + } // If this is a SHF_MERGE section, we pass all the input sections to // a Output_data_merge. We don't try to handle relocations for such @@ -1127,8 +1131,7 @@ Output_section::add_input_section(Sized_relobj<size, big_endian>* object, && reloc_shndx == 0) { if (this->add_merge_input_section(object, shndx, sh_flags, - shdr.get_sh_entsize(), - addralign)) + entsize, addralign)) { // Tell the relocation routines that they need to call the // output_offset method to determine the final address. |