[PATCH 4/6] mach-o: Handle LC_VERSION_MIN_TVOS

Roman Bolshakov r.bolshakov@yadro.com
Tue Nov 6 14:09:00 GMT 2018


The load command was introduced shortly after LC_VERSION_MIN_WATCHOS. It
has exactly the same format as the other load commands from the same
family.

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Cc: Tristan Gingold <tgingold@free.fr>
---
 bfd/ChangeLog           | 1 +
 bfd/mach-o.c            | 1 +
 binutils/ChangeLog      | 2 +-
 binutils/od-macho.c     | 2 ++
 include/ChangeLog       | 1 +
 include/mach-o/loader.h | 1 +
 6 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7dcdb45d3f..b1df3af4ba 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -5,6 +5,7 @@
 	a few fields. Rename reserved to sdk.
 	* mach-o.c (bfd_mach_o_read_version_min): Don't split version into a
 	few fields. Rename reserved to sdk.
+	(bfd_mach_o_read_command): Handle LC_VERSION_MIN_TVOS.
 
 2018-11-02  Alan Modra  <amodra@gmail.com>
 
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
index 45d774f14e..57ca8fb169 100644
--- a/bfd/mach-o.c
+++ b/bfd/mach-o.c
@@ -4873,6 +4873,7 @@ bfd_mach_o_read_command (bfd *abfd, bfd_mach_o_load_command *command)
     case BFD_MACH_O_LC_VERSION_MIN_MACOSX:
     case BFD_MACH_O_LC_VERSION_MIN_IPHONEOS:
     case BFD_MACH_O_LC_VERSION_MIN_WATCHOS:
+    case BFD_MACH_O_LC_VERSION_MIN_TVOS:
       if (!bfd_mach_o_read_version_min (abfd, command))
 	return FALSE;
       break;
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index d57efdd14f..3db9bcdad8 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -3,7 +3,7 @@
 
 	* od-macho.c (printf_version): New.
 	(dump_load_command): Use it to print version. Print sdk version. Print
-	version info for watchOS.
+	version info for watchOS and tvOS.
 
 2018-11-03  H.J. Lu  <hongjiu.lu@intel.com>
 
diff --git a/binutils/od-macho.c b/binutils/od-macho.c
index dec6228f48..43a89bd68d 100644
--- a/binutils/od-macho.c
+++ b/binutils/od-macho.c
@@ -209,6 +209,7 @@ static const bfd_mach_o_xlat_name bfd_mach_o_load_command_name[] =
   { "encryption_info_64", BFD_MACH_O_LC_ENCRYPTION_INFO_64},
   { "linker_options", BFD_MACH_O_LC_LINKER_OPTIONS},
   { "linker_optimization_hint", BFD_MACH_O_LC_LINKER_OPTIMIZATION_HINT},
+  { "version_min_tvos", BFD_MACH_O_LC_VERSION_MIN_TVOS},
   { "version_min_watchos", BFD_MACH_O_LC_VERSION_MIN_WATCHOS},
   { NULL, 0}
 };
@@ -1593,6 +1594,7 @@ dump_load_command (bfd *abfd, bfd_mach_o_load_command *cmd,
     case BFD_MACH_O_LC_VERSION_MIN_MACOSX:
     case BFD_MACH_O_LC_VERSION_MIN_IPHONEOS:
     case BFD_MACH_O_LC_VERSION_MIN_WATCHOS:
+    case BFD_MACH_O_LC_VERSION_MIN_TVOS:
       {
         bfd_mach_o_version_min_command *ver = &cmd->command.version_min;
 
diff --git a/include/ChangeLog b/include/ChangeLog
index b1115e973f..25a5826664 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -3,6 +3,7 @@
 
 	* mach-o/external.h (mach_o_version_min_command_external): Rename
 	reserved to sdk.
+	* mach-o/loader.h (BFD_MACH_O_LC_VERSION_MIN_TVOS): Define
 
 2018-11-06  Sudakshina Das  <sudi.das@arm.com>
 
diff --git a/include/mach-o/loader.h b/include/mach-o/loader.h
index c075a8e023..19c5e91d64 100644
--- a/include/mach-o/loader.h
+++ b/include/mach-o/loader.h
@@ -185,6 +185,7 @@ typedef enum bfd_mach_o_load_command_type
   BFD_MACH_O_LC_ENCRYPTION_INFO_64 = 0x2c, /* Encrypted 64 bit seg info.  */
   BFD_MACH_O_LC_LINKER_OPTIONS = 0x2d,	/* Linker options.  */
   BFD_MACH_O_LC_LINKER_OPTIMIZATION_HINT = 0x2e, /* Optimization hints.  */
+  BFD_MACH_O_LC_VERSION_MIN_TVOS = 0x2f, /* Minimal tvOS version.  */
   BFD_MACH_O_LC_VERSION_MIN_WATCHOS = 0x30 /* Minimal WatchOS version.  */
 }
 bfd_mach_o_load_command_type;
-- 
2.19.1



More information about the Binutils mailing list