diff options
| author | George Rimar <grimar@accesssoftek.com> | 2019-09-23 10:43:09 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2019-09-23 10:43:09 +0000 |
| commit | 753f6cff2f7147e71aae1b7607e5ccc08462e0a3 (patch) | |
| tree | 51cdc74ab6802b6fd895dac9615abdb928e9985f /llvm/tools/llvm-readobj/ELFDumper.cpp | |
| parent | 0b184b8526d54e0380b98bc48ecb8502bafb6c37 (diff) | |
| download | bcm5719-llvm-753f6cff2f7147e71aae1b7607e5ccc08462e0a3.tar.gz bcm5719-llvm-753f6cff2f7147e71aae1b7607e5ccc08462e0a3.zip | |
[llvm-readobj] - Stop treating ".stack_sizes.*" sections as stack sizes sections.
llvm-readobj currently handles .stack_sizes.* (e.g. .stack_sizes.foo)
as a normal stack sizes section. Though MC does not produce sections with
such names. Also, linkers do not combine .stack_sizes.* into .stack_sizes.
A mini discussion about this correctness issue is here: https://reviews.llvm.org/D67757#inline-609274
This patch changes implementation so that only now only '.stack_sizes' name is
accepted as a real stack sizes section.
Differential revision: https://reviews.llvm.org/D67824
llvm-svn: 372578
Diffstat (limited to 'llvm/tools/llvm-readobj/ELFDumper.cpp')
| -rw-r--r-- | llvm/tools/llvm-readobj/ELFDumper.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp index 316f49e071c..17d85c27ae0 100644 --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -4829,7 +4829,7 @@ void DumpStyle<ELFT>::printNonRelocatableStackSizes( StringRef FileStr = Obj->getFileName(); for (const SectionRef &Sec : Obj->sections()) { StringRef SectionName = getSectionName(Sec); - if (!SectionName.startswith(".stack_sizes")) + if (SectionName != ".stack_sizes") continue; PrintHeader(); const Elf_Shdr *ElfSec = Obj->getSection(Sec.getRawDataRefImpl()); @@ -4879,7 +4879,7 @@ void DumpStyle<ELFT>::printRelocatableStackSizes( // A stack size section that we haven't encountered yet is mapped to the // null section until we find its corresponding relocation section. - if (SectionName.startswith(".stack_sizes")) + if (SectionName == ".stack_sizes") if (StackSizeRelocMap.count(Sec) == 0) { StackSizeRelocMap[Sec] = NullSection; continue; @@ -4900,7 +4900,7 @@ void DumpStyle<ELFT>::printRelocatableStackSizes( consumeError(ContentsSectionNameOrErr.takeError()); continue; } - if (!ContentsSectionNameOrErr->startswith(".stack_sizes")) + if (*ContentsSectionNameOrErr != ".stack_sizes") continue; // Insert a mapping from the stack sizes section to its relocation section. StackSizeRelocMap[Obj->toSectionRef(ContentsSec)] = Sec; |

