aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-07-04 03:34:01 +0000
committerIan Lance Taylor <ian@airs.com>2008-07-04 03:34:01 +0000
commit5cb66f97b7b8dbf0a951e9cf10f6b3ed0f309022 (patch)
tree961bf19b4dd1ce8358f9fc447cfdf1afa973d291 /gold/layout.cc
parentfa4d55d05955bd7e3a5ceab94ffbf8ef0cdef655 (diff)
downloadgdb-5cb66f97b7b8dbf0a951e9cf10f6b3ed0f309022.zip
gdb-5cb66f97b7b8dbf0a951e9cf10f6b3ed0f309022.tar.gz
gdb-5cb66f97b7b8dbf0a951e9cf10f6b3ed0f309022.tar.bz2
* layout.cc (Layout::include_section): Do not discard unrecognized
SHT_STRTAB sections.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index 2c8c524..62ccaae 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -210,12 +210,19 @@ Layout::include_section(Sized_relobj<size, big_endian>*, 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: