From: ian Date: Fri, 4 Jul 2008 03:34:01 +0000 (+0000) Subject: * layout.cc (Layout::include_section): Do not discard unrecognized X-Git-Tag: cgen-snapshot-20091101~6329 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=8d368d27893ed80537129e110e1e1c3947cc1945;p=pf3gnuchains%2Fpf3gnuchains4x.git * layout.cc (Layout::include_section): Do not discard unrecognized SHT_STRTAB sections. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index d73e1cd9d8..f0f2c13f55 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2008-07-03 Ian Lance Taylor + + * layout.cc (Layout::include_section): Do not discard unrecognized + SHT_STRTAB sections. + 2008-06-30 Craig Silverstein * script.cc (Lex::can_continue_name): Make '?' allowable in diff --git a/gold/layout.cc b/gold/layout.cc index 2c8c5241fb..62ccaae2b1 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -210,12 +210,19 @@ Layout::include_section(Sized_relobj*, const char* name, case elfcpp::SHT_NULL: case elfcpp::SHT_SYMTAB: case elfcpp::SHT_DYNSYM: - case elfcpp::SHT_STRTAB: case elfcpp::SHT_HASH: case elfcpp::SHT_DYNAMIC: case elfcpp::SHT_SYMTAB_SHNDX: return false; + case elfcpp::SHT_STRTAB: + // Discard the sections which have special meanings in the ELF + // ABI. Keep others (e.g., .stabstr). We could also do this by + // checking the sh_link fields of the appropriate sections. + return (strcmp(name, ".dynstr") != 0 + && strcmp(name, ".strtab") != 0 + && strcmp(name, ".shstrtab") != 0); + case elfcpp::SHT_RELA: case elfcpp::SHT_REL: case elfcpp::SHT_GROUP: