PR binutils/13558
[deliverable/binutils-gdb.git] / bfd / mach-o.h
index da4363bee9cec9bd9964eac956c86a1b75159e92..67ee43db827c3024867eef58c91463c4518befd4 100644 (file)
@@ -1,6 +1,7 @@
 /* Mach-O support for BFD.
    Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2008, 2009, 2011,
-   2012 Free Software Foundation, Inc.
+   2012
+   Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -22,6 +23,7 @@
 #ifndef _BFD_MACH_O_H_
 #define _BFD_MACH_O_H_
 
+#include "sysdep.h"
 #include "bfd.h"
 #include "mach-o/loader.h"
 
@@ -41,6 +43,18 @@ typedef struct bfd_mach_o_header
 }
 bfd_mach_o_header;
 
+typedef struct bfd_mach_o_asymbol
+{
+  /* The actual symbol which the rest of BFD works with.  */
+  asymbol symbol;
+
+  /* Mach-O symbol fields.  */
+  unsigned char n_type;
+  unsigned char n_sect;
+  unsigned short n_desc;
+}
+bfd_mach_o_asymbol;
+
 #define BFD_MACH_O_SEGNAME_SIZE 16
 #define BFD_MACH_O_SECTNAME_SIZE 16
 
@@ -63,6 +77,12 @@ typedef struct bfd_mach_o_section
   /* Corresponding bfd section.  */
   asection *bfdsection;
 
+  /* An array holding the indirect symbols for this section.
+     NULL values indicate local symbols.
+     The number of symbols is determined from the section size and type.  */
+
+  bfd_mach_o_asymbol **indirect_syms;
+
   /* Simply linked list.  */
   struct bfd_mach_o_section *next;
 }
@@ -104,26 +124,12 @@ typedef struct bfd_mach_o_reloc_info
 }
 bfd_mach_o_reloc_info;
 
-typedef struct bfd_mach_o_asymbol
-{
-  /* The actual symbol which the rest of BFD works with.  */
-  asymbol symbol;
-
-  /* Mach-O symbol fields.  */
-  unsigned char n_type;
-  unsigned char n_sect;
-  unsigned short n_desc;
-}
-bfd_mach_o_asymbol;
-
 /* The symbol table is sorted like this:
  (1) local.
        (otherwise in order of generation)
  (2) external defined
        (sorted by name)
- (3) external undefined
-       (sorted by name)
- (4) common
+ (3) external undefined / common
        (sorted by name)
 */
 
@@ -449,6 +455,16 @@ typedef struct bfd_mach_o_str_command
 }
 bfd_mach_o_str_command;
 
+typedef struct bfd_mach_o_fvmlib_command
+{
+  unsigned int name_offset;
+  unsigned int name_len;
+  char *name_str;
+  unsigned int minor_version;
+  unsigned int header_addr;
+}
+bfd_mach_o_fvmlib_command;
+
 typedef struct bfd_mach_o_dyld_info_command
 {
   /* File offset and size to rebase info.  */
@@ -482,6 +498,14 @@ typedef struct bfd_mach_o_version_min_command
 }
 bfd_mach_o_version_min_command;
 
+typedef struct bfd_mach_o_encryption_info_command
+{
+  unsigned int cryptoff;
+  unsigned int cryptsize;
+  unsigned int cryptid;
+}
+bfd_mach_o_encryption_info_command;
+
 typedef struct bfd_mach_o_load_command
 {
   bfd_mach_o_load_command_type type;
@@ -502,6 +526,8 @@ typedef struct bfd_mach_o_load_command
     bfd_mach_o_str_command str;
     bfd_mach_o_dyld_info_command dyld_info;
     bfd_mach_o_version_min_command version_min;
+    bfd_mach_o_encryption_info_command encryption_info;
+    bfd_mach_o_fvmlib_command fvmlib;
   }
   command;
 }
@@ -528,18 +554,6 @@ typedef struct mach_o_data_struct
   bfd_mach_o_symtab_command *symtab;
   bfd_mach_o_dysymtab_command *dysymtab;
 
-  /* Base values used for building the dysymtab for a single-module object.  */  
-  unsigned long nlocal;
-  unsigned long ndefext;
-  unsigned long nundefext;
-
-  /* If this is non-zero, then the pointer below is populated.  */
-  unsigned long nindirect;
-  /* A set of synthetic symbols representing the 'indirect' ones in the file.
-     These should be sorted (a) by the section they represent and (b) by the
-     order that they appear within each section.  */
-  asymbol **indirect_syms;
-
   /* A place to stash dwarf2 info for this bfd.  */
   void *dwarf2_find_line_info;
 
@@ -670,8 +684,10 @@ typedef struct bfd_mach_o_backend_data
 }
 bfd_mach_o_backend_data;
 
-/* Symbol type tests.  */
+/* Values used in symbol.udata.i, to signal that the mach-o-specific data in the
+   symbol are not yet set, or need validation (where this is possible).  */
 
-#define IS_MACHO_INDIRECT(x) (((x) & BFD_MACH_O_N_TYPE) == BFD_MACH_O_N_INDR)
+#define SYM_MACHO_FIELDS_UNSET ((bfd_vma) -1)
+#define SYM_MACHO_FIELDS_NOT_VALIDATED ((bfd_vma) -2)
 
 #endif /* _BFD_MACH_O_H_ */
This page took 0.025059 seconds and 4 git commands to generate.