bfd/
[deliverable/binutils-gdb.git] / bfd / mach-o.h
index 0f48324f52f2a0d543dd022cb76da9a7fbe4df4d..d4ca600c46e57d1c6fe6034c47b7654a6de8339d 100644 (file)
@@ -132,7 +132,8 @@ typedef enum bfd_mach_o_load_command_type
   BFD_MACH_O_LC_SEGMENT_SPLIT_INFO = 0x1e, /* Local of info to split seg.  */
   BFD_MACH_O_LC_REEXPORT_DYLIB = 0x1f,  /* Load and re-export lib.  */
   BFD_MACH_O_LC_LAZY_LOAD_DYLIB = 0x20, /* Delay load of lib until use.  */
-  BFD_MACH_O_LC_ENCRYPTION_INFO = 0x21  /* Encrypted segment info.  */
+  BFD_MACH_O_LC_ENCRYPTION_INFO = 0x21, /* Encrypted segment info.  */
+  BFD_MACH_O_LC_DYLD_INFO = 0x22       /* Compressed dyld information.  */
 }
 bfd_mach_o_load_command_type;
 
@@ -165,14 +166,17 @@ bfd_mach_o_cpu_subtype;
 
 typedef enum bfd_mach_o_filetype
 {
-  BFD_MACH_O_MH_OBJECT = 1,
-  BFD_MACH_O_MH_EXECUTE = 2,
-  BFD_MACH_O_MH_FVMLIB = 3,
-  BFD_MACH_O_MH_CORE = 4,
-  BFD_MACH_O_MH_PRELOAD = 5,
-  BFD_MACH_O_MH_DYLIB = 6,
-  BFD_MACH_O_MH_DYLINKER = 7,
-  BFD_MACH_O_MH_BUNDLE = 8
+  BFD_MACH_O_MH_OBJECT      = 0x01,
+  BFD_MACH_O_MH_EXECUTE     = 0x02,
+  BFD_MACH_O_MH_FVMLIB      = 0x03,
+  BFD_MACH_O_MH_CORE        = 0x04,
+  BFD_MACH_O_MH_PRELOAD     = 0x05,
+  BFD_MACH_O_MH_DYLIB       = 0x06,
+  BFD_MACH_O_MH_DYLINKER    = 0x07,
+  BFD_MACH_O_MH_BUNDLE      = 0x08,
+  BFD_MACH_O_MH_DYLIB_STUB  = 0x09,
+  BFD_MACH_O_MH_DSYM        = 0x0a,
+  BFD_MACH_O_MH_KEXT_BUNDLE = 0x0b
 }
 bfd_mach_o_filetype;
 
@@ -392,6 +396,17 @@ bfd_mach_o_segment_command;
 #define BFD_MACH_O_GENERIC_RELOC_PB_LA_PTR     3
 #define BFD_MACH_O_GENERIC_RELOC_LOCAL_SECTDIFF        4
 
+/* X86-64 relocations.  */
+#define BFD_MACH_O_X86_64_RELOC_UNSIGNED   0 /* Absolute addresses.  */
+#define BFD_MACH_O_X86_64_RELOC_SIGNED     1 /* 32-bit disp.  */
+#define BFD_MACH_O_X86_64_RELOC_BRANCH     2 /* 32-bit pcrel disp.  */
+#define BFD_MACH_O_X86_64_RELOC_GOT_LOAD   3 /* Movq load of a GOT entry.  */
+#define BFD_MACH_O_X86_64_RELOC_GOT        4 /* GOT reference.  */
+#define BFD_MACH_O_X86_64_RELOC_SUBTRACTOR 5 /* Symbol difference.  */
+#define BFD_MACH_O_X86_64_RELOC_SIGNED_1   6 /* 32-bit signed disp -1.  */
+#define BFD_MACH_O_X86_64_RELOC_SIGNED_2   7 /* 32-bit signed disp -2.  */
+#define BFD_MACH_O_X86_64_RELOC_SIGNED_4   8 /* 32-bit signed disp -4.  */
+
 /* Size of a relocation entry.  */
 #define BFD_MACH_O_RELENT_SIZE 8
 
@@ -747,7 +762,6 @@ bfd_mach_o_prebound_dylib_command;
 typedef struct bfd_mach_o_uuid_command
 {
   unsigned char uuid[16];
-  asection *section;
 }
 bfd_mach_o_uuid_command;
 
@@ -768,6 +782,30 @@ typedef struct bfd_mach_o_str_command
 }
 bfd_mach_o_str_command;
 
+typedef struct bfd_mach_o_dyld_info_command
+{
+  /* File offset and size to rebase info.  */
+  unsigned int rebase_off; 
+  unsigned int rebase_size;
+
+  /* File offset and size of binding info.  */
+  unsigned int bind_off;
+  unsigned int bind_size;
+
+  /* File offset and size of weak binding info.  */
+  unsigned int weak_bind_off;
+  unsigned int weak_bind_size;
+
+  /* File offset and size of lazy binding info.  */
+  unsigned int lazy_bind_off;
+  unsigned int lazy_bind_size;
+
+  /* File offset and size of export info.  */
+  unsigned int export_off;
+  unsigned int export_size;
+}
+bfd_mach_o_dyld_info_command;
+
 typedef struct bfd_mach_o_load_command
 {
   bfd_mach_o_load_command_type type;
@@ -786,6 +824,7 @@ typedef struct bfd_mach_o_load_command
     bfd_mach_o_uuid_command uuid;
     bfd_mach_o_linkedit_command linkedit;
     bfd_mach_o_str_command str;
+    bfd_mach_o_dyld_info_command dyld_info;
   }
   command;
 }
@@ -817,6 +856,7 @@ bfd_mach_o_data_struct;
 /* Target specific routines.  */
 typedef struct bfd_mach_o_backend_data
 {
+  enum bfd_architecture arch;
   bfd_boolean (*_bfd_mach_o_swap_reloc_in)(arelent *, bfd_mach_o_reloc_info *);
   bfd_boolean (*_bfd_mach_o_swap_reloc_out)(arelent *, bfd_mach_o_reloc_info *);
   bfd_boolean (*_bfd_mach_o_print_thread)(bfd *, bfd_mach_o_thread_flavour *,
@@ -829,7 +869,7 @@ bfd_mach_o_backend_data;
   ((bfd_mach_o_backend_data*)(abfd)->xvec->backend_data)
 
 bfd_boolean bfd_mach_o_valid (bfd *);
-int bfd_mach_o_scan_read_dysymtab_symbol (bfd *, bfd_mach_o_dysymtab_command *, bfd_mach_o_symtab_command *, bfd_mach_o_asymbol *, unsigned long);
+int bfd_mach_o_read_dysymtab_symbol (bfd *, bfd_mach_o_dysymtab_command *, bfd_mach_o_symtab_command *, bfd_mach_o_asymbol *, unsigned long);
 int bfd_mach_o_scan_start_address (bfd *);
 int bfd_mach_o_scan (bfd *, bfd_mach_o_header *, bfd_mach_o_data_struct *);
 bfd_boolean bfd_mach_o_mkobject_init (bfd *);
@@ -837,6 +877,8 @@ const bfd_target *bfd_mach_o_object_p (bfd *);
 const bfd_target *bfd_mach_o_core_p (bfd *);
 const bfd_target *bfd_mach_o_archive_p (bfd *);
 bfd *bfd_mach_o_openr_next_archived_file (bfd *, bfd *);
+bfd_boolean bfd_mach_o_set_arch_mach (bfd *, enum bfd_architecture,
+                                      unsigned long);
 int bfd_mach_o_lookup_section (bfd *, asection *, bfd_mach_o_load_command **, bfd_mach_o_section **);
 int bfd_mach_o_lookup_command (bfd *, bfd_mach_o_load_command_type, bfd_mach_o_load_command **);
 bfd_boolean bfd_mach_o_write_contents (bfd *);
@@ -847,6 +889,8 @@ bfd_boolean bfd_mach_o_bfd_copy_private_section_data (bfd *, asection *,
 bfd_boolean bfd_mach_o_bfd_copy_private_bfd_data (bfd *, bfd *);
 long bfd_mach_o_get_symtab_upper_bound (bfd *);
 long bfd_mach_o_canonicalize_symtab (bfd *, asymbol **);
+long bfd_mach_o_get_synthetic_symtab (bfd *, long, asymbol **, long, 
+                                      asymbol **, asymbol **ret);
 long bfd_mach_o_get_reloc_upper_bound (bfd *, asection *);
 long bfd_mach_o_canonicalize_reloc (bfd *, asection *, arelent **, asymbol **);
 long bfd_mach_o_get_dynamic_reloc_upper_bound (bfd *);
This page took 0.025557 seconds and 4 git commands to generate.