mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
Fix a bug in llvm-obdump(1) with the -macho and -info-plist options
which caused it to print more than the (__TEXT,__info_plist) if that section did not end with a null. rdar://27378808 llvm-svn: 294236
This commit is contained in:
parent
e38cc318e0
commit
ae2f0d9f91
10
test/tools/llvm-objdump/X86/macho-info-plist-nofollow.test
Normal file
10
test/tools/llvm-objdump/X86/macho-info-plist-nofollow.test
Normal file
@ -0,0 +1,10 @@
|
||||
# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -info-plist - | FileCheck %s
|
||||
|
||||
.section __TEXT, __info_plist
|
||||
.ascii "This is the (__TEXT,__info_plist) section\n"
|
||||
.section __TEXT, __follow
|
||||
.asciz "This is the (__TEXT,__follow) section\n"
|
||||
|
||||
# CHECK: Contents of (__TEXT,__info_plist) section
|
||||
# CHECK: This is the (__TEXT,__info_plist) section
|
||||
# CHECK-NOT: This is the (__TEXT,__follow) section
|
@ -1142,7 +1142,7 @@ static void DumpInfoPlistSectionContents(StringRef Filename,
|
||||
StringRef BytesStr;
|
||||
Section.getContents(BytesStr);
|
||||
const char *sect = reinterpret_cast<const char *>(BytesStr.data());
|
||||
outs() << sect;
|
||||
outs() << format("%.*s", BytesStr.size(), sect) << "\n";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user