Mach-O: add cpu and cpusubtype caps.
authorTristan Gingold <tristan.gingold@adacore.com>
Wed, 9 Apr 2014 08:12:45 +0000 (10:12 +0200)
committerTristan Gingold <tristan.gingold@adacore.com>
Wed, 16 Apr 2014 08:04:19 +0000 (10:04 +0200)
include/mach-o/
2014-04-16  Tristan Gingold  <gingold@adacore.com>

* loader.h (BFD_MACH_O_CPU_ARCH_MASK, BFD_MACH_O_CPU_ARCH_ABI64)
(BFD_MACH_O_CPU_SUBTYPE_MASK, BFD_MACH_O_CPU_SUBTYPE_LIB64): Define.

bfd/
2014-04-16  Tristan Gingold  <gingold@adacore.com>

* mach-o-x86-64.c (bfd_mach_o_x86_64_mkobject): Adjust cpusubtype
flag.

bfd/ChangeLog
bfd/mach-o-x86-64.c
include/mach-o/ChangeLog
include/mach-o/loader.h

index 99285f3a605386e1e6ad92f54aee80b9b9477f36..c9af9daca465ba354a006b252994f12df7bc1943 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-16  Tristan Gingold  <gingold@adacore.com>
+
+       * mach-o-x86-64.c (bfd_mach_o_x86_64_mkobject): Adjust cpusubtype
+       flag.
+
 2014-04-16  Alan Modra  <amodra@gmail.com>
 
        * elf32-ppc.c (ppc_elf_relocate_section): Fill 476 fixup area
index 221c030ac5cde2a83584f0ba1b678717d1a7ca21..017a6b891918e73ab2409f4069968c40916eae73 100644 (file)
@@ -53,7 +53,8 @@ bfd_mach_o_x86_64_mkobject (bfd *abfd)
   mdata = bfd_mach_o_get_data (abfd);
   mdata->header.magic = BFD_MACH_O_MH_MAGIC_64;
   mdata->header.cputype = BFD_MACH_O_CPU_TYPE_X86_64;
-  mdata->header.cpusubtype = BFD_MACH_O_CPU_SUBTYPE_X86_ALL;
+  mdata->header.cpusubtype =
+    BFD_MACH_O_CPU_SUBTYPE_X86_ALL | BFD_MACH_O_CPU_SUBTYPE_LIB64;
   mdata->header.byteorder = BFD_ENDIAN_LITTLE;
   mdata->header.version = 2;
 
index 284e845a8093fc73c311a40db77cf02ec193c570..0f2721a41641bf92c46c01d9622d5a2e7ce70d30 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-16  Tristan Gingold  <gingold@adacore.com>
+
+       * loader.h (BFD_MACH_O_CPU_ARCH_MASK, BFD_MACH_O_CPU_ARCH_ABI64)
+       (BFD_MACH_O_CPU_SUBTYPE_MASK, BFD_MACH_O_CPU_SUBTYPE_LIB64): Define.
+
 2014-04-03  Tristan Gingold  <gingold@adacore.com>
 
        * unwind.h (mach_o_compact_unwind_64): Fix typo in personality.
index 952346d6e60a887c692f75cd4dbf668c0d23fee8..20cfe42cf47e936acd465f51ca38b4f8df8024ea 100644 (file)
@@ -32,7 +32,10 @@ typedef enum bfd_mach_o_mach_header_magic
 }
 bfd_mach_o_mach_header_magic;
 
-#define BFD_MACH_O_CPU_IS64BIT 0x1000000
+/* Capability bits in cpu type.  */
+#define BFD_MACH_O_CPU_ARCH_MASK  0xff000000
+#define BFD_MACH_O_CPU_ARCH_ABI64 0x01000000
+#define BFD_MACH_O_CPU_IS64BIT    0x01000000
 
 typedef enum bfd_mach_o_cpu_type
 {
@@ -57,6 +60,10 @@ typedef enum bfd_mach_o_cpu_type
 }
 bfd_mach_o_cpu_type;
 
+/* Capability bits in cpu subtype.  */
+#define BFD_MACH_O_CPU_SUBTYPE_MASK  0xff000000
+#define BFD_MACH_O_CPU_SUBTYPE_LIB64 0x80000000
+
 typedef enum bfd_mach_o_cpu_subtype
 {
   /* i386.  */