Index: llvm/trunk/test/tools/llvm-readobj/stack-sizes.test =================================================================== --- llvm/trunk/test/tools/llvm-readobj/stack-sizes.test +++ llvm/trunk/test/tools/llvm-readobj/stack-sizes.test @@ -48,7 +48,7 @@ ## followed by a ULEB for the size. Content: "000000000000000010000000000000000020" Link: .text - - Name: .stack_sizes.baz + - Name: '.stack_sizes [1]' Type: SHT_PROGBITS ## One stack size entry. Content: "200000000000000008" @@ -66,9 +66,9 @@ Addend: 16 Symbol: .text Type: R_X86_64_64 - - Name: .rela.stack_sizes.baz + - Name: '.rela.stack_sizes [1]' Type: SHT_RELA - Info: .stack_sizes.baz + Info: '.stack_sizes [1]' Relocations: - Offset: 0 Symbol: separate_text_section_baz Index: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp =================================================================== --- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp +++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp @@ -4829,7 +4829,7 @@ 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 @@ // 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 @@ 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;