@@ -4639,10 +4639,9 @@ void GNUStyle<ELFT>::printNotes(const ELFFile<ELFT> *Obj) {
4639
4639
OS << " " << N.Type << " :\n " << N.Value << ' \n ' ;
4640
4640
} else if (Name == " CORE" ) {
4641
4641
if (Type == ELF::NT_FILE) {
4642
- DataExtractor DescExtractor (
4643
- StringRef (reinterpret_cast <const char *>(Descriptor.data ()),
4644
- Descriptor.size ()),
4645
- ELFT::TargetEndianness == support::little, sizeof (Elf_Addr));
4642
+ DataExtractor DescExtractor (Descriptor,
4643
+ ELFT::TargetEndianness == support::little,
4644
+ sizeof (Elf_Addr));
4646
4645
Expected<CoreNote> Note = readCoreNote (DescExtractor);
4647
4646
if (Note)
4648
4647
printCoreNote<ELFT>(OS, *Note);
@@ -4836,10 +4835,7 @@ void DumpStyle<ELFT>::printNonRelocatableStackSizes(
4836
4835
const Elf_Shdr *ElfSec = Obj->getSection (Sec.getRawDataRefImpl ());
4837
4836
ArrayRef<uint8_t > Contents =
4838
4837
unwrapOrError (this ->FileName , EF->getSectionContents (ElfSec));
4839
- DataExtractor Data (
4840
- StringRef (reinterpret_cast <const char *>(Contents.data ()),
4841
- Contents.size ()),
4842
- Obj->isLittleEndian (), sizeof (Elf_Addr));
4838
+ DataExtractor Data (Contents, Obj->isLittleEndian (), sizeof (Elf_Addr));
4843
4839
// A .stack_sizes section header's sh_link field is supposed to point
4844
4840
// to the section that contains the functions whose stack sizes are
4845
4841
// described in it.
@@ -4937,10 +4933,7 @@ void DumpStyle<ELFT>::printRelocatableStackSizes(
4937
4933
RelocationResolver Resolver;
4938
4934
std::tie (IsSupportedFn, Resolver) = getRelocationResolver (*Obj);
4939
4935
auto Contents = unwrapOrError (this ->FileName , StackSizesSec.getContents ());
4940
- DataExtractor Data (
4941
- StringRef (reinterpret_cast <const char *>(Contents.data ()),
4942
- Contents.size ()),
4943
- Obj->isLittleEndian (), sizeof (Elf_Addr));
4936
+ DataExtractor Data (Contents, Obj->isLittleEndian (), sizeof (Elf_Addr));
4944
4937
for (const RelocationRef &Reloc : RelocSec.relocations ()) {
4945
4938
if (!IsSupportedFn (Reloc.getType ()))
4946
4939
reportError (createStringError (
@@ -5831,10 +5824,9 @@ void LLVMStyle<ELFT>::printNotes(const ELFFile<ELFT> *Obj) {
5831
5824
W.printString (N.Type , N.Value );
5832
5825
} else if (Name == " CORE" ) {
5833
5826
if (Type == ELF::NT_FILE) {
5834
- DataExtractor DescExtractor (
5835
- StringRef (reinterpret_cast <const char *>(Descriptor.data ()),
5836
- Descriptor.size ()),
5837
- ELFT::TargetEndianness == support::little, sizeof (Elf_Addr));
5827
+ DataExtractor DescExtractor (Descriptor,
5828
+ ELFT::TargetEndianness == support::little,
5829
+ sizeof (Elf_Addr));
5838
5830
Expected<CoreNote> Note = readCoreNote (DescExtractor);
5839
5831
if (Note)
5840
5832
printCoreNoteLLVMStyle (*Note, W);
0 commit comments