From f0aeef47e5cf2516fa181de97d05a845c76ee5d4 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 26 Jul 2021 09:04:51 -0700 Subject: [PATCH] [yaml2obj][MachO] Rename PayloadString to Content The new name is conciser and matches yaml2obj ELF & DWARF. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D106759 --- include/llvm/ObjectYAML/MachOYAML.h | 2 +- lib/ObjectYAML/MachOEmitter.cpp | 6 ++--- lib/ObjectYAML/MachOYAML.cpp | 6 ++--- .../MachO/dylib_dylinker_command.yaml | 12 +++++----- test/ObjectYAML/MachO/export_trie.yaml | 6 ++--- .../ObjectYAML/MachO/null_string_entries.yaml | 6 ++--- .../MachO/out_of_order_linkedit.yaml | 6 ++--- test/ObjectYAML/MachO/symtab.yaml | 6 ++--- test/tools/llvm-dwarfdump/uuid.yaml | 4 ++-- test/tools/llvm-dwarfdump/uuid32.yaml | 4 ++-- test/tools/llvm-lipo/Inputs/CPU10-slice.yaml | 4 ++-- .../llvm-lipo/Inputs/armv7-slice-big.yaml | 24 +++++++++---------- .../llvm-objcopy/MachO/Inputs/strip-all.yaml | 4 ++-- .../MachO/basic-executable-copy.test | 4 ++-- .../MachO/install-name-tool-change.test | 4 ++-- .../MachO/install-name-tool-delete-rpath.test | 10 ++++---- .../MachO/install-name-tool-id.test | 2 +- .../MachO/install-name-tool-rpath.test | 8 +++---- .../MachO/lc-load-weak-dylib.test | 2 +- .../MachO/remove-lc-index-update.test | 6 ++--- .../MachO/segment-size-alignment.test | 16 ++++++------- .../llvm-objcopy/MachO/segments-vmsize.test | 4 ++-- .../tools/llvm-readobj/MachO/needed-libs.test | 2 +- test/tools/llvm-tapi-diff/Inputs/macho.yaml | 4 ++-- tools/obj2yaml/macho2yaml.cpp | 2 +- 25 files changed, 77 insertions(+), 77 deletions(-) diff --git a/include/llvm/ObjectYAML/MachOYAML.h b/include/llvm/ObjectYAML/MachOYAML.h index 94e66c5ae78..5d1d3ee2359 100644 --- a/include/llvm/ObjectYAML/MachOYAML.h +++ b/include/llvm/ObjectYAML/MachOYAML.h @@ -76,7 +76,7 @@ struct LoadCommand { std::vector
Sections; std::vector Tools; std::vector PayloadBytes; - std::string PayloadString; + std::string Content; uint64_t ZeroPadBytes; }; diff --git a/lib/ObjectYAML/MachOEmitter.cpp b/lib/ObjectYAML/MachOEmitter.cpp index dec9c9f6960..46e4dd05a73 100644 --- a/lib/ObjectYAML/MachOEmitter.cpp +++ b/lib/ObjectYAML/MachOEmitter.cpp @@ -155,9 +155,9 @@ size_t writeLoadCommandData( size_t writePayloadString(MachOYAML::LoadCommand &LC, raw_ostream &OS) { size_t BytesWritten = 0; - if (!LC.PayloadString.empty()) { - OS.write(LC.PayloadString.c_str(), LC.PayloadString.length()); - BytesWritten = LC.PayloadString.length(); + if (!LC.Content.empty()) { + OS.write(LC.Content.c_str(), LC.Content.length()); + BytesWritten = LC.Content.length(); } return BytesWritten; } diff --git a/lib/ObjectYAML/MachOYAML.cpp b/lib/ObjectYAML/MachOYAML.cpp index 5a27d37cb72..dce82ab1cad 100644 --- a/lib/ObjectYAML/MachOYAML.cpp +++ b/lib/ObjectYAML/MachOYAML.cpp @@ -218,19 +218,19 @@ void mapLoadCommandData( template <> void mapLoadCommandData( IO &IO, MachOYAML::LoadCommand &LoadCommand) { - IO.mapOptional("PayloadString", LoadCommand.PayloadString); + IO.mapOptional("Content", LoadCommand.Content); } template <> void mapLoadCommandData( IO &IO, MachOYAML::LoadCommand &LoadCommand) { - IO.mapOptional("PayloadString", LoadCommand.PayloadString); + IO.mapOptional("Content", LoadCommand.Content); } template <> void mapLoadCommandData( IO &IO, MachOYAML::LoadCommand &LoadCommand) { - IO.mapOptional("PayloadString", LoadCommand.PayloadString); + IO.mapOptional("Content", LoadCommand.Content); } template <> diff --git a/test/ObjectYAML/MachO/dylib_dylinker_command.yaml b/test/ObjectYAML/MachO/dylib_dylinker_command.yaml index 5fc6afa536e..d40546e67a7 100644 --- a/test/ObjectYAML/MachO/dylib_dylinker_command.yaml +++ b/test/ObjectYAML/MachO/dylib_dylinker_command.yaml @@ -14,7 +14,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name: 12 - PayloadString: /usr/lib/dyld + Content: /usr/lib/dyld ZeroPadBytes: 7 - cmd: LC_LOAD_DYLIB cmdsize: 48 @@ -23,7 +23,7 @@ LoadCommands: timestamp: 2 current_version: 7864576 compatibility_version: 65536 - PayloadString: '/usr/lib/libc++.1.dylib' + Content: '/usr/lib/libc++.1.dylib' ZeroPadBytes: 1 - cmd: LC_LOAD_DYLIB cmdsize: 56 @@ -32,7 +32,7 @@ LoadCommands: timestamp: 2 current_version: 80349697 compatibility_version: 65536 - PayloadString: /usr/lib/libSystem.B.dylib + Content: /usr/lib/libSystem.B.dylib ZeroPadBytes: 6 ... @@ -40,7 +40,7 @@ LoadCommands: #CHECK: - cmd: LC_LOAD_DYLINKER #CHECK: cmdsize: 32 #CHECK: name: 12 -#CHECK: PayloadString: '/usr/lib/dyld' +#CHECK: Content: '/usr/lib/dyld' #CHECK: ZeroPadBytes: 7 #CHECK: - cmd: LC_LOAD_DYLIB #CHECK: cmdsize: 48 @@ -49,7 +49,7 @@ LoadCommands: #CHECK: timestamp: 2 #CHECK: current_version: 7864576 #CHECK: compatibility_version: 65536 -#CHECK: PayloadString: '/usr/lib/libc++.1.dylib' +#CHECK: Content: '/usr/lib/libc++.1.dylib' #CHECK: ZeroPadBytes: 1 #CHECK: - cmd: LC_LOAD_DYLIB #CHECK: cmdsize: 56 @@ -58,5 +58,5 @@ LoadCommands: #CHECK: timestamp: 2 #CHECK: current_version: 80349697 #CHECK: compatibility_version: 65536 -#CHECK: PayloadString: '/usr/lib/libSystem.B.dylib' +#CHECK: Content: '/usr/lib/libSystem.B.dylib' #CHECK: ZeroPadBytes: 6 diff --git a/test/ObjectYAML/MachO/export_trie.yaml b/test/ObjectYAML/MachO/export_trie.yaml index 64537527cfe..635e507f5f6 100644 --- a/test/ObjectYAML/MachO/export_trie.yaml +++ b/test/ObjectYAML/MachO/export_trie.yaml @@ -96,7 +96,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name: 12 - PayloadString: /usr/lib/dyld + Content: /usr/lib/dyld ZeroPadBytes: 7 - cmd: LC_UUID cmdsize: 24 @@ -119,7 +119,7 @@ LoadCommands: timestamp: 2 current_version: 7864576 compatibility_version: 65536 - PayloadString: '/usr/lib/libc++.1.dylib' + Content: '/usr/lib/libc++.1.dylib' ZeroPadBytes: 1 - cmd: LC_LOAD_DYLIB cmdsize: 56 @@ -128,7 +128,7 @@ LoadCommands: timestamp: 2 current_version: 80349697 compatibility_version: 65536 - PayloadString: /usr/lib/libSystem.B.dylib + Content: /usr/lib/libSystem.B.dylib ZeroPadBytes: 6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/test/ObjectYAML/MachO/null_string_entries.yaml b/test/ObjectYAML/MachO/null_string_entries.yaml index d08275acab4..4bae31c704b 100644 --- a/test/ObjectYAML/MachO/null_string_entries.yaml +++ b/test/ObjectYAML/MachO/null_string_entries.yaml @@ -95,7 +95,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 28 name: 12 - PayloadString: /usr/lib/dyld + Content: /usr/lib/dyld ZeroPadBytes: 3 - cmd: LC_UUID cmdsize: 24 @@ -118,7 +118,7 @@ LoadCommands: timestamp: 2 current_version: 7864576 compatibility_version: 65536 - PayloadString: '/usr/lib/libc++.1.dylib' + Content: '/usr/lib/libc++.1.dylib' ZeroPadBytes: 1 - cmd: LC_LOAD_DYLIB cmdsize: 52 @@ -127,7 +127,7 @@ LoadCommands: timestamp: 2 current_version: 80349697 compatibility_version: 65536 - PayloadString: /usr/lib/libSystem.B.dylib + Content: /usr/lib/libSystem.B.dylib ZeroPadBytes: 2 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/test/ObjectYAML/MachO/out_of_order_linkedit.yaml b/test/ObjectYAML/MachO/out_of_order_linkedit.yaml index d318e331e61..3b6ec557f6e 100644 --- a/test/ObjectYAML/MachO/out_of_order_linkedit.yaml +++ b/test/ObjectYAML/MachO/out_of_order_linkedit.yaml @@ -96,7 +96,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name: 12 - PayloadString: /usr/lib/dyld + Content: /usr/lib/dyld ZeroPadBytes: 7 - cmd: LC_UUID cmdsize: 24 @@ -119,7 +119,7 @@ LoadCommands: timestamp: 2 current_version: 7864576 compatibility_version: 65536 - PayloadString: '/usr/lib/libc++.1.dylib' + Content: '/usr/lib/libc++.1.dylib' ZeroPadBytes: 1 - cmd: LC_LOAD_DYLIB cmdsize: 56 @@ -128,7 +128,7 @@ LoadCommands: timestamp: 2 current_version: 80349697 compatibility_version: 65536 - PayloadString: /usr/lib/libSystem.B.dylib + Content: /usr/lib/libSystem.B.dylib ZeroPadBytes: 6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/test/ObjectYAML/MachO/symtab.yaml b/test/ObjectYAML/MachO/symtab.yaml index 5ba75a15e49..8cff5493667 100644 --- a/test/ObjectYAML/MachO/symtab.yaml +++ b/test/ObjectYAML/MachO/symtab.yaml @@ -98,7 +98,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name: 12 - PayloadString: /usr/lib/dyld + Content: /usr/lib/dyld ZeroPadBytes: 7 - cmd: LC_UUID cmdsize: 24 @@ -121,7 +121,7 @@ LoadCommands: timestamp: 2 current_version: 7864576 compatibility_version: 65536 - PayloadString: '/usr/lib/libc++.1.dylib' + Content: '/usr/lib/libc++.1.dylib' ZeroPadBytes: 1 - cmd: LC_LOAD_DYLIB cmdsize: 56 @@ -130,7 +130,7 @@ LoadCommands: timestamp: 2 current_version: 80349697 compatibility_version: 65536 - PayloadString: /usr/lib/libSystem.B.dylib + Content: /usr/lib/libSystem.B.dylib ZeroPadBytes: 6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/test/tools/llvm-dwarfdump/uuid.yaml b/test/tools/llvm-dwarfdump/uuid.yaml index b36e3aabc0a..391f6259a21 100644 --- a/test/tools/llvm-dwarfdump/uuid.yaml +++ b/test/tools/llvm-dwarfdump/uuid.yaml @@ -111,7 +111,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name: 12 - PayloadString: /usr/lib/dyld + Content: /usr/lib/dyld ZeroPadBytes: 7 - cmd: LC_UUID cmdsize: 24 @@ -134,7 +134,7 @@ LoadCommands: timestamp: 2 current_version: 81985536 compatibility_version: 65536 - PayloadString: /usr/lib/libSystem.B.dylib + Content: /usr/lib/libSystem.B.dylib ZeroPadBytes: 6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/test/tools/llvm-dwarfdump/uuid32.yaml b/test/tools/llvm-dwarfdump/uuid32.yaml index 1144547c3d1..e0ea8f0ff49 100644 --- a/test/tools/llvm-dwarfdump/uuid32.yaml +++ b/test/tools/llvm-dwarfdump/uuid32.yaml @@ -109,7 +109,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 28 name: 12 - PayloadString: /usr/lib/dyld + Content: /usr/lib/dyld ZeroPadBytes: 3 - cmd: LC_UUID cmdsize: 24 @@ -132,7 +132,7 @@ LoadCommands: timestamp: 2 current_version: 81985536 compatibility_version: 65536 - PayloadString: /usr/lib/libSystem.B.dylib + Content: /usr/lib/libSystem.B.dylib ZeroPadBytes: 2 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/test/tools/llvm-lipo/Inputs/CPU10-slice.yaml b/test/tools/llvm-lipo/Inputs/CPU10-slice.yaml index f2d8ea5c141..296b465046f 100644 --- a/test/tools/llvm-lipo/Inputs/CPU10-slice.yaml +++ b/test/tools/llvm-lipo/Inputs/CPU10-slice.yaml @@ -180,7 +180,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name: 12 - PayloadString: /usr/lib/dyld + Content: /usr/lib/dyld ZeroPadBytes: 7 - cmd: LC_UUID cmdsize: 24 @@ -208,7 +208,7 @@ LoadCommands: timestamp: 2 current_version: 82115073 compatibility_version: 65536 - PayloadString: /usr/lib/libSystem.B.dylib + Content: /usr/lib/libSystem.B.dylib ZeroPadBytes: 6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/test/tools/llvm-lipo/Inputs/armv7-slice-big.yaml b/test/tools/llvm-lipo/Inputs/armv7-slice-big.yaml index 9c328959938..9e6bf1df9c9 100644 --- a/test/tools/llvm-lipo/Inputs/armv7-slice-big.yaml +++ b/test/tools/llvm-lipo/Inputs/armv7-slice-big.yaml @@ -263,7 +263,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 28 name: 12 - PayloadString: '/usr/lib/dyld' + Content: '/usr/lib/dyld' ZeroPadBytes: 3 - cmd: LC_UUID cmdsize: 24 @@ -291,7 +291,7 @@ LoadCommands: timestamp: 2 current_version: 26216708 compatibility_version: 65536 - PayloadString: '/usr/lib/libc++.1.dylib' + Content: '/usr/lib/libc++.1.dylib' ZeroPadBytes: 1 - cmd: LC_LOAD_DYLIB cmdsize: 68 @@ -300,7 +300,7 @@ LoadCommands: timestamp: 2 current_version: 0 compatibility_version: 0 - PayloadString: '@rpath/MobileConfig.framework/MobileConfig' + Content: '@rpath/MobileConfig.framework/MobileConfig' ZeroPadBytes: 2 - cmd: LC_LOAD_DYLIB cmdsize: 84 @@ -309,7 +309,7 @@ LoadCommands: timestamp: 2 current_version: 102895360 compatibility_version: 19660800 - PayloadString: '/System/Library/Frameworks/Foundation.framework/Foundation' + Content: '/System/Library/Frameworks/Foundation.framework/Foundation' ZeroPadBytes: 2 - cmd: LC_LOAD_DYLIB cmdsize: 76 @@ -318,7 +318,7 @@ LoadCommands: timestamp: 2 current_version: 917504 compatibility_version: 65536 - PayloadString: '/System/Library/Frameworks/MapKit.framework/MapKit' + Content: '/System/Library/Frameworks/MapKit.framework/MapKit' ZeroPadBytes: 2 - cmd: LC_LOAD_DYLIB cmdsize: 84 @@ -327,7 +327,7 @@ LoadCommands: timestamp: 2 current_version: 68352 compatibility_version: 66048 - PayloadString: '/System/Library/Frameworks/QuartzCore.framework/QuartzCore' + Content: '/System/Library/Frameworks/QuartzCore.framework/QuartzCore' ZeroPadBytes: 2 - cmd: LC_LOAD_DYLIB cmdsize: 76 @@ -336,7 +336,7 @@ LoadCommands: timestamp: 2 current_version: 3997696000 compatibility_version: 65536 - PayloadString: '/System/Library/Frameworks/UIKit.framework/UIKit' + Content: '/System/Library/Frameworks/UIKit.framework/UIKit' ZeroPadBytes: 4 - cmd: LC_LOAD_DYLIB cmdsize: 52 @@ -345,7 +345,7 @@ LoadCommands: timestamp: 2 current_version: 14942208 compatibility_version: 65536 - PayloadString: '/usr/lib/libobjc.A.dylib' + Content: '/usr/lib/libobjc.A.dylib' ZeroPadBytes: 4 - cmd: LC_LOAD_DYLIB cmdsize: 52 @@ -354,7 +354,7 @@ LoadCommands: timestamp: 2 current_version: 82115073 compatibility_version: 65536 - PayloadString: '/usr/lib/libSystem.B.dylib' + Content: '/usr/lib/libSystem.B.dylib' ZeroPadBytes: 2 - cmd: LC_LOAD_DYLIB cmdsize: 92 @@ -363,17 +363,17 @@ LoadCommands: timestamp: 2 current_version: 102895360 compatibility_version: 9830400 - PayloadString: '/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation' + Content: '/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation' ZeroPadBytes: 2 - cmd: LC_RPATH cmdsize: 28 path: 12 - PayloadString: '/usr/lib/swift' + Content: '/usr/lib/swift' ZeroPadBytes: 2 - cmd: LC_RPATH cmdsize: 40 path: 12 - PayloadString: '@executable_path/Frameworks' + Content: '@executable_path/Frameworks' ZeroPadBytes: 1 - cmd: LC_DATA_IN_CODE cmdsize: 16 diff --git a/test/tools/llvm-objcopy/MachO/Inputs/strip-all.yaml b/test/tools/llvm-objcopy/MachO/Inputs/strip-all.yaml index 6bce937fd7a..7d83d347ba6 100644 --- a/test/tools/llvm-objcopy/MachO/Inputs/strip-all.yaml +++ b/test/tools/llvm-objcopy/MachO/Inputs/strip-all.yaml @@ -144,7 +144,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name: 12 - PayloadString: '/usr/lib/dyld' + Content: '/usr/lib/dyld' ZeroPadBytes: 7 - cmd: LC_UUID cmdsize: 24 @@ -172,7 +172,7 @@ LoadCommands: timestamp: 2 current_version: 82115073 compatibility_version: 65536 - PayloadString: '/usr/lib/libSystem.B.dylib' + Content: '/usr/lib/libSystem.B.dylib' ZeroPadBytes: 6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/test/tools/llvm-objcopy/MachO/basic-executable-copy.test b/test/tools/llvm-objcopy/MachO/basic-executable-copy.test index 0ec84f74f70..69132ea47de 100644 --- a/test/tools/llvm-objcopy/MachO/basic-executable-copy.test +++ b/test/tools/llvm-objcopy/MachO/basic-executable-copy.test @@ -152,7 +152,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name: 12 - PayloadString: '/usr/lib/dyld' + Content: '/usr/lib/dyld' ZeroPadBytes: 7 - cmd: LC_UUID cmdsize: 24 @@ -184,7 +184,7 @@ LoadCommands: timestamp: 2 current_version: 82115073 compatibility_version: 65536 - PayloadString: '/usr/lib/libSystem.B.dylib' + Content: '/usr/lib/libSystem.B.dylib' ZeroPadBytes: 6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/test/tools/llvm-objcopy/MachO/install-name-tool-change.test b/test/tools/llvm-objcopy/MachO/install-name-tool-change.test index 8869af21799..3605b94d9ae 100644 --- a/test/tools/llvm-objcopy/MachO/install-name-tool-change.test +++ b/test/tools/llvm-objcopy/MachO/install-name-tool-change.test @@ -96,7 +96,7 @@ LoadCommands: timestamp: 2 current_version: 82115073 compatibility_version: 65536 - PayloadString: '/usr/dylib/LOAD' + Content: '/usr/dylib/LOAD' - cmd: LC_LOAD_WEAK_DYLIB cmdsize: 40 dylib: @@ -104,4 +104,4 @@ LoadCommands: timestamp: 2 current_version: 82115073 compatibility_version: 65536 - PayloadString: '/usr/dylib/WEAK' + Content: '/usr/dylib/WEAK' diff --git a/test/tools/llvm-objcopy/MachO/install-name-tool-delete-rpath.test b/test/tools/llvm-objcopy/MachO/install-name-tool-delete-rpath.test index aea899fd1a1..ce37576dac8 100644 --- a/test/tools/llvm-objcopy/MachO/install-name-tool-delete-rpath.test +++ b/test/tools/llvm-objcopy/MachO/install-name-tool-delete-rpath.test @@ -71,20 +71,20 @@ LoadCommands: - cmd: LC_RPATH cmdsize: 32 path: 12 - PayloadString: '@executable_a/.' + Content: '@executable_a/.' - cmd: LC_RPATH cmdsize: 32 path: 12 - PayloadString: '@executable_b/.' + Content: '@executable_b/.' - cmd: LC_RPATH cmdsize: 32 path: 12 - PayloadString: '@executable_c/.' + Content: '@executable_c/.' - cmd: LC_RPATH cmdsize: 32 path: 12 - PayloadString: '@executable_d/.' + Content: '@executable_d/.' - cmd: LC_RPATH cmdsize: 32 path: 12 - PayloadString: '@executable_e/.' + Content: '@executable_e/.' diff --git a/test/tools/llvm-objcopy/MachO/install-name-tool-id.test b/test/tools/llvm-objcopy/MachO/install-name-tool-id.test index eb29d26be93..00489a7c0a0 100644 --- a/test/tools/llvm-objcopy/MachO/install-name-tool-id.test +++ b/test/tools/llvm-objcopy/MachO/install-name-tool-id.test @@ -45,7 +45,7 @@ LoadCommands: timestamp: 2 current_version: 82115073 compatibility_version: 65536 - PayloadString: '/usr/lib/A' + Content: '/usr/lib/A' # RUN: yaml2obj %s --docnum=2 -o %t diff --git a/test/tools/llvm-objcopy/MachO/install-name-tool-rpath.test b/test/tools/llvm-objcopy/MachO/install-name-tool-rpath.test index a0621f4a66b..5c4309891a3 100644 --- a/test/tools/llvm-objcopy/MachO/install-name-tool-rpath.test +++ b/test/tools/llvm-objcopy/MachO/install-name-tool-rpath.test @@ -127,16 +127,16 @@ LoadCommands: - cmd: LC_RPATH cmdsize: 32 path: 12 - PayloadString: '@executable_a/.' + Content: '@executable_a/.' - cmd: LC_RPATH cmdsize: 40 path: 12 - PayloadString: '@executable_short_test/.' + Content: '@executable_short_test/.' - cmd: LC_RPATH cmdsize: 40 path: 12 - PayloadString: '@executable_long_test/.' + Content: '@executable_long_test/.' - cmd: LC_RPATH cmdsize: 32 path: 12 - PayloadString: '@executable_d/.' + Content: '@executable_d/.' diff --git a/test/tools/llvm-objcopy/MachO/lc-load-weak-dylib.test b/test/tools/llvm-objcopy/MachO/lc-load-weak-dylib.test index aaf0a220d25..e570f597e62 100644 --- a/test/tools/llvm-objcopy/MachO/lc-load-weak-dylib.test +++ b/test/tools/llvm-objcopy/MachO/lc-load-weak-dylib.test @@ -20,6 +20,6 @@ LoadCommands: timestamp: 2 current_version: 65536 compatibility_version: 65536 - PayloadString: '/System/Library/Frameworks/Network.framework/Network' + Content: '/System/Library/Frameworks/Network.framework/Network' ZeroPadBytes: 4 ... diff --git a/test/tools/llvm-objcopy/MachO/remove-lc-index-update.test b/test/tools/llvm-objcopy/MachO/remove-lc-index-update.test index 6543ae29fbc..45c3b0b602a 100644 --- a/test/tools/llvm-objcopy/MachO/remove-lc-index-update.test +++ b/test/tools/llvm-objcopy/MachO/remove-lc-index-update.test @@ -112,7 +112,7 @@ LoadCommands: - cmd: LC_RPATH cmdsize: 32 path: 12 - PayloadString: '@executable_a/.' + Content: '@executable_a/.' - cmd: LC_DYLD_INFO_ONLY cmdsize: 48 rebase_off: 0 @@ -143,7 +143,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name: 12 - PayloadString: '/usr/lib/dyld' + Content: '/usr/lib/dyld' ZeroPadBytes: 7 - cmd: LC_UUID cmdsize: 24 @@ -175,7 +175,7 @@ LoadCommands: timestamp: 2 current_version: 82115073 compatibility_version: 65536 - PayloadString: '/usr/lib/libSystem.B.dylib' + Content: '/usr/lib/libSystem.B.dylib' ZeroPadBytes: 6 - cmd: LC_DYSYMTAB cmdsize: 80 diff --git a/test/tools/llvm-objcopy/MachO/segment-size-alignment.test b/test/tools/llvm-objcopy/MachO/segment-size-alignment.test index d8ad3e9a462..e4ec00203f2 100644 --- a/test/tools/llvm-objcopy/MachO/segment-size-alignment.test +++ b/test/tools/llvm-objcopy/MachO/segment-size-alignment.test @@ -154,7 +154,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 28 name: 12 - PayloadString: '/usr/lib/dyld' + Content: '/usr/lib/dyld' ZeroPadBytes: 3 - cmd: LC_UUID cmdsize: 24 @@ -182,7 +182,7 @@ LoadCommands: timestamp: 2 current_version: 83951616 compatibility_version: 65536 - PayloadString: '/usr/lib/libSystem.B.dylib' + Content: '/usr/lib/libSystem.B.dylib' ZeroPadBytes: 2 - cmd: LC_FUNCTION_STARTS cmdsize: 16 @@ -366,7 +366,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name: 12 - PayloadString: '/usr/lib/dyld' + Content: '/usr/lib/dyld' ZeroPadBytes: 7 - cmd: LC_UUID cmdsize: 24 @@ -400,7 +400,7 @@ LoadCommands: timestamp: 2 current_version: 83951616 compatibility_version: 65536 - PayloadString: '/usr/lib/libSystem.B.dylib' + Content: '/usr/lib/libSystem.B.dylib' ZeroPadBytes: 6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 @@ -583,7 +583,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 28 name: 12 - PayloadString: '/usr/lib/dyld' + Content: '/usr/lib/dyld' ZeroPadBytes: 3 - cmd: LC_UUID cmdsize: 24 @@ -616,7 +616,7 @@ LoadCommands: timestamp: 2 current_version: 83951616 compatibility_version: 65536 - PayloadString: '/usr/lib/libSystem.B.dylib' + Content: '/usr/lib/libSystem.B.dylib' ZeroPadBytes: 2 - cmd: LC_FUNCTION_STARTS cmdsize: 16 @@ -800,7 +800,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name: 12 - PayloadString: '/usr/lib/dyld' + Content: '/usr/lib/dyld' ZeroPadBytes: 7 - cmd: LC_UUID cmdsize: 24 @@ -828,7 +828,7 @@ LoadCommands: timestamp: 2 current_version: 82115073 compatibility_version: 65536 - PayloadString: '/usr/lib/libSystem.B.dylib' + Content: '/usr/lib/libSystem.B.dylib' ZeroPadBytes: 6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/test/tools/llvm-objcopy/MachO/segments-vmsize.test b/test/tools/llvm-objcopy/MachO/segments-vmsize.test index 18c99c8307a..fd4da2ca4bf 100644 --- a/test/tools/llvm-objcopy/MachO/segments-vmsize.test +++ b/test/tools/llvm-objcopy/MachO/segments-vmsize.test @@ -169,7 +169,7 @@ LoadCommands: - cmd: LC_LOAD_DYLINKER cmdsize: 32 name: 12 - PayloadString: '/usr/lib/dyld' + Content: '/usr/lib/dyld' ZeroPadBytes: 7 - cmd: LC_UUID cmdsize: 24 @@ -197,7 +197,7 @@ LoadCommands: timestamp: 2 current_version: 82115073 compatibility_version: 65536 - PayloadString: '/usr/lib/libSystem.B.dylib' + Content: '/usr/lib/libSystem.B.dylib' ZeroPadBytes: 6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/test/tools/llvm-readobj/MachO/needed-libs.test b/test/tools/llvm-readobj/MachO/needed-libs.test index d199327cadb..e97e490dbb0 100644 --- a/test/tools/llvm-readobj/MachO/needed-libs.test +++ b/test/tools/llvm-readobj/MachO/needed-libs.test @@ -23,4 +23,4 @@ LoadCommands: timestamp: 2 current_version: 81985536 compatibility_version: 65536 - PayloadString: /usr/lib/libSystem.B.dylib + Content: /usr/lib/libSystem.B.dylib diff --git a/test/tools/llvm-tapi-diff/Inputs/macho.yaml b/test/tools/llvm-tapi-diff/Inputs/macho.yaml index 6a7813d6a39..04f8c4a7634 100644 --- a/test/tools/llvm-tapi-diff/Inputs/macho.yaml +++ b/test/tools/llvm-tapi-diff/Inputs/macho.yaml @@ -52,7 +52,7 @@ LoadCommands: timestamp: 1 current_version: 65536 compatibility_version: 65536 - PayloadString: macho-no-exports.dylib + Content: macho-no-exports.dylib ZeroPadBytes: 2 - cmd: LC_DYLD_INFO_ONLY cmdsize: 48 @@ -109,7 +109,7 @@ LoadCommands: timestamp: 2 current_version: 79495168 compatibility_version: 65536 - PayloadString: '/usr/lib/libSystem.B.dylib' + Content: '/usr/lib/libSystem.B.dylib' ZeroPadBytes: 6 - cmd: LC_FUNCTION_STARTS cmdsize: 16 diff --git a/tools/obj2yaml/macho2yaml.cpp b/tools/obj2yaml/macho2yaml.cpp index 49347431b9a..b7289bff67e 100644 --- a/tools/obj2yaml/macho2yaml.cpp +++ b/tools/obj2yaml/macho2yaml.cpp @@ -226,7 +226,7 @@ readString(MachOYAML::LoadCommand &LC, auto Start = LoadCmd.Ptr + sizeof(StructType); auto MaxSize = LoadCmd.C.cmdsize - sizeof(StructType); auto Size = strnlen(Start, MaxSize); - LC.PayloadString = StringRef(Start, Size).str(); + LC.Content = StringRef(Start, Size).str(); return Start + Size; }