118 |
BFD_MACH_O_MH_PRELOAD = 5, |
BFD_MACH_O_MH_PRELOAD = 5, |
119 |
BFD_MACH_O_MH_DYLIB = 6, |
BFD_MACH_O_MH_DYLIB = 6, |
120 |
BFD_MACH_O_MH_DYLINKER = 7, |
BFD_MACH_O_MH_DYLINKER = 7, |
121 |
BFD_MACH_O_MH_BUNDLE = 8 |
BFD_MACH_O_MH_BUNDLE = 8, |
122 |
|
BFD_MACH_O_MH_DYLIB_STUB = 9 |
123 |
} |
} |
124 |
bfd_mach_o_filetype; |
bfd_mach_o_filetype; |
125 |
|
|
160 |
|
|
161 |
/* Section with only non-lazy symbol pointers. */ |
/* Section with only non-lazy symbol pointers. */ |
162 |
BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS = 0x6, |
BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS = 0x6, |
163 |
|
BFD_MACH_O_S_NL_SYMBOL_POINTERS = 0x6, |
164 |
|
|
165 |
/* Section with only lazy symbol pointers. */ |
/* Section with only lazy symbol pointers. */ |
166 |
BFD_MACH_O_S_LAZY_SYMBOL_POINTERS = 0x7, |
BFD_MACH_O_S_LAZY_SYMBOL_POINTERS = 0x7, |
167 |
|
BFD_MACH_O_S_LA_SYMBOL_POINTERS = 0x7, |
168 |
|
|
169 |
/* Section with only symbol stubs, byte size of stub in the reserved2 field. */ |
/* Section with only symbol stubs, byte size of stub in the reserved2 field. */ |
170 |
BFD_MACH_O_S_SYMBOL_STUBS = 0x8, |
BFD_MACH_O_S_SYMBOL_STUBS = 0x8, |
174 |
} |
} |
175 |
bfd_mach_o_section_type; |
bfd_mach_o_section_type; |
176 |
|
|
177 |
|
/* mask */ |
178 |
|
#define BFD_MACH_O_REFERENCE_TYPE 0xf |
179 |
|
|
180 |
|
typedef enum bfd_mach_o_n_desc |
181 |
|
{ |
182 |
|
|
183 |
|
/* This symbol is a reference to an external non-lazy symbol (data). */ |
184 |
|
BFD_MACH_O_REFERENCE_FLAG_UNDEFINED_NON_LAZY = 0x0, |
185 |
|
|
186 |
|
/* This symbol is a reference to an external lazy symbol pointer (function call). */ |
187 |
|
BFD_MACH_O_REFERENCE_FLAG_UNDEFINED_LAZY = 0x1, |
188 |
|
|
189 |
|
/* This symbol is defined in this module. */ |
190 |
|
BFD_MACH_O_REFERENCE_FLAG_DEFINED = 0x2 |
191 |
|
|
192 |
|
} |
193 |
|
bfd_mach_o_n_desc; |
194 |
|
|
195 |
typedef unsigned long bfd_mach_o_cpu_subtype; |
typedef unsigned long bfd_mach_o_cpu_subtype; |
196 |
|
|
197 |
typedef struct bfd_mach_o_header |
typedef struct bfd_mach_o_header |
224 |
} |
} |
225 |
bfd_mach_o_section; |
bfd_mach_o_section; |
226 |
|
|
227 |
|
typedef struct bfd_mach_o_nlist |
228 |
|
{ |
229 |
|
/* BFD internal representation. */ |
230 |
|
asymbol root; |
231 |
|
|
232 |
|
/* Mach-O representation. */ |
233 |
|
struct { |
234 |
|
union { |
235 |
|
char *n_name; |
236 |
|
long n_strx; |
237 |
|
} n_un; |
238 |
|
unsigned char n_type; |
239 |
|
unsigned char n_sect; |
240 |
|
short n_desc; |
241 |
|
unsigned long n_value; |
242 |
|
} nlist; |
243 |
|
|
244 |
|
/* Index in input symbol table. */ |
245 |
|
unsigned long input_index; |
246 |
|
|
247 |
|
/* Index in output symbol table. */ |
248 |
|
unsigned long output_index; |
249 |
|
} |
250 |
|
bfd_mach_o_nlist; |
251 |
|
|
252 |
typedef struct bfd_mach_o_segment_command |
typedef struct bfd_mach_o_segment_command |
253 |
{ |
{ |
254 |
char segname[16]; |
char segname[16]; |
269 |
unsigned long nsyms; |
unsigned long nsyms; |
270 |
unsigned long stroff; |
unsigned long stroff; |
271 |
unsigned long strsize; |
unsigned long strsize; |
272 |
asymbol *symbols; |
/* asymbol *symbols; */ |
273 |
|
bfd_mach_o_nlist *nlists; |
274 |
char *strtab; |
char *strtab; |
275 |
asection *stabs_segment; |
asection *stabs_segment; |
276 |
asection *stabstr_segment; |
asection *stabstr_segment; |
495 |
command; |
command; |
496 |
} |
} |
497 |
bfd_mach_o_load_command; |
bfd_mach_o_load_command; |
498 |
|
/* Map an indirect symbol table entry to a symbol table entry and vice-versa. */ |
499 |
|
typedef struct { |
500 |
|
|
501 |
|
/* Reference to the indirect symbol table entry. */ |
502 |
|
unsigned long ist_idx; |
503 |
|
|
504 |
|
/* Reference to the symbol table entry. */ |
505 |
|
unsigned long st_idx; |
506 |
|
} |
507 |
|
bfd_mach_o_ist_entry; |
508 |
|
|
509 |
|
/* Describe the indirect symbol table. */ |
510 |
|
typedef struct { |
511 |
|
|
512 |
|
/* Associated LC_DYSYMTAB load command. */ |
513 |
|
bfd_mach_o_dysymtab_command *command; |
514 |
|
|
515 |
|
/* Number of entries in this indirect symbol table. */ |
516 |
|
unsigned long nmemb; |
517 |
|
|
518 |
|
/* Number of BFD_MACH_O_S_SYMBOL_STUB sections in the following array. */ |
519 |
|
unsigned long nstubs; |
520 |
|
|
521 |
|
/* Array of stub sections. */ |
522 |
|
bfd_mach_o_section **stubs; |
523 |
|
|
524 |
|
/* Number of BFD_MACH_O_S_NL_SYMBOL_POINTERS sections in the following array. */ |
525 |
|
unsigned long nnlptrs; |
526 |
|
|
527 |
|
/* Array of non-lazy symbol pointer sections. */ |
528 |
|
bfd_mach_o_section **nlptrs; |
529 |
|
|
530 |
|
/* Number of BFD_MACH_O_S_LA_SYMBOL_POINTERS sections in the following array. */ |
531 |
|
unsigned long nlaptrs; |
532 |
|
|
533 |
|
/* Array of lazy symbol pointer sections. */ |
534 |
|
bfd_mach_o_section **laptrs; |
535 |
|
|
536 |
|
/* Raw indirect symbol table entry, as slurped from the input file. */ |
537 |
|
bfd_mach_o_ist_entry *raw_ist; |
538 |
|
|
539 |
|
/* Indirect symbol table that was sorted by chunks, depending on st_idx. */ |
540 |
|
bfd_mach_o_ist_entry *sorted_ist; |
541 |
|
} |
542 |
|
bfd_mach_o_ist; |
543 |
|
|
544 |
|
typedef struct |
545 |
|
{ |
546 |
|
/* General link information. */ |
547 |
|
struct bfd_link_info *info; |
548 |
|
|
549 |
|
/* Output BFD. */ |
550 |
|
bfd *output_bfd; |
551 |
|
|
552 |
|
/* Buffer large enough to hold contents of any section. */ |
553 |
|
bfd_byte *contents; |
554 |
|
} |
555 |
|
bfd_mach_o_final_link_info; |
556 |
|
|
557 |
|
/* This struct is used to pass information to and from bfd_mach_o_link_output_extsym. */ |
558 |
|
typedef struct |
559 |
|
{ |
560 |
|
bfd_boolean failed; |
561 |
|
bfd_mach_o_final_link_info *finfo; |
562 |
|
} |
563 |
|
bfd_mach_o_outext_info; |
564 |
|
|
565 |
|
/* Mach-O back-end global hash table entries. */ |
566 |
|
// typedef struct { |
567 |
|
// |
568 |
|
// struct bfd_link_hash_entry root; |
569 |
|
// |
570 |
|
// } |
571 |
|
// bfd_mach_o_link_hash_entry; |
572 |
|
|
573 |
|
#define mach_o_tdata(abfd) ((abfd)->tdata.mach_o_data) |
574 |
|
#define mach_o_symtab(abfd) (mach_o_tdata(abfd)->st) |
575 |
|
#define mach_o_dysymtab(abfd) (mach_o_tdata(abfd)->dyst) |
576 |
|
|
577 |
|
#define mach_o_n_type(udata) (((udata) >> 24) & 0xff) |
578 |
|
#define mach_o_n_sect(udata) (((udata) >> 16) & 0xff) |
579 |
|
#define mach_o_n_desc(udata) ((udata) & 0xffff) |
580 |
|
|
581 |
typedef struct mach_o_data_struct |
typedef struct mach_o_data_struct |
582 |
{ |
{ |
583 |
bfd_mach_o_header header; |
bfd_mach_o_header header; |
584 |
bfd_mach_o_load_command *commands; |
bfd_mach_o_load_command *commands; |
585 |
|
bfd_mach_o_ist *ist; |
586 |
|
bfd_mach_o_symtab_command *st; |
587 |
|
bfd_mach_o_dysymtab_command *dyst; |
588 |
unsigned long nsymbols; |
unsigned long nsymbols; |
589 |
asymbol *symbols; |
asymbol *symbols; |
590 |
unsigned long nsects; |
unsigned long nsects; |
598 |
bfd_boolean bfd_mach_o_valid |
bfd_boolean bfd_mach_o_valid |
599 |
PARAMS ((bfd *)); |
PARAMS ((bfd *)); |
600 |
int bfd_mach_o_scan_read_symtab_symbol |
int bfd_mach_o_scan_read_symtab_symbol |
601 |
PARAMS ((bfd *, bfd_mach_o_symtab_command *, asymbol *, unsigned long)); |
/*PARAMS ((bfd *, bfd_mach_o_symtab_command *, asymbol *, unsigned long));*/ |
602 |
|
PARAMS ((bfd *, bfd_mach_o_symtab_command *, |
603 |
|
bfd_mach_o_nlist *, unsigned long)); |
604 |
int bfd_mach_o_scan_read_symtab_strtab |
int bfd_mach_o_scan_read_symtab_strtab |
605 |
PARAMS ((bfd *, bfd_mach_o_symtab_command *)); |
PARAMS ((bfd *, bfd_mach_o_symtab_command *)); |
606 |
int bfd_mach_o_scan_read_symtab_symbols |
int bfd_mach_o_scan_read_symtab_symbols |
607 |
PARAMS ((bfd *, bfd_mach_o_symtab_command *)); |
PARAMS ((bfd *, bfd_mach_o_symtab_command *)); |
608 |
int bfd_mach_o_scan_read_dysymtab_symbol |
int bfd_mach_o_scan_read_dysymtab_symbol |
609 |
PARAMS ((bfd *, bfd_mach_o_dysymtab_command *, bfd_mach_o_symtab_command *, |
PARAMS ((bfd *, bfd_mach_o_dysymtab_command *, bfd_mach_o_symtab_command *, |
610 |
asymbol *, unsigned long)); |
bfd_mach_o_nlist */*asymbol **/, unsigned long)); |
611 |
int bfd_mach_o_scan_start_address |
int bfd_mach_o_scan_start_address |
612 |
PARAMS ((bfd *)); |
PARAMS ((bfd *)); |
613 |
int bfd_mach_o_scan |
int bfd_mach_o_scan |
642 |
extern const bfd_target mach_o_le_vec; |
extern const bfd_target mach_o_le_vec; |
643 |
extern const bfd_target mach_o_fat_vec; |
extern const bfd_target mach_o_fat_vec; |
644 |
|
|
645 |
|
/* |
646 |
|
These do not appear to be necessary any longer (Aurelien, 1-XII-05). |
647 |
|
|
648 |
|
struct bfd_preserve |
649 |
|
{ |
650 |
|
PTR marker; |
651 |
|
PTR tdata; |
652 |
|
flagword flags; |
653 |
|
const struct bfd_arch_info *arch_info; |
654 |
|
struct sec *sections; |
655 |
|
struct sec **section_tail; |
656 |
|
unsigned int section_count; |
657 |
|
struct bfd_hash_table section_htab; |
658 |
|
}; |
659 |
|
|
660 |
|
boolean |
661 |
|
bfd_preserve_save PARAMS ((bfd *, struct bfd_preserve *)); |
662 |
|
|
663 |
|
void |
664 |
|
bfd_preserve_restore PARAMS ((bfd *, struct bfd_preserve *)); |
665 |
|
|
666 |
|
void |
667 |
|
bfd_preserve_finish PARAMS ((bfd *, struct bfd_preserve *)); |
668 |
|
*/ |
669 |
|
|
670 |
#endif /* _BFD_MACH_O_H_ */ |
#endif /* _BFD_MACH_O_H_ */ |