diff options
author | Tristan Gingold <gingold@adacore.com> | 2009-06-25 12:39:06 +0000 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2009-06-25 12:39:06 +0000 |
commit | b32e07d7d744d2acc7fc04d96f2d67eef6f35b87 (patch) | |
tree | 8c7aa39ffc9a6685d9b1e739e4b1aa0606918970 /bfd/mach-o.h | |
parent | c41ba836f2cfd3e9abe2e7b19613eb96e6428feb (diff) | |
download | gdb-b32e07d7d744d2acc7fc04d96f2d67eef6f35b87.zip gdb-b32e07d7d744d2acc7fc04d96f2d67eef6f35b87.tar.gz gdb-b32e07d7d744d2acc7fc04d96f2d67eef6f35b87.tar.bz2 |
2009-06-25 Tristan Gingold <gingold@adacore.com>
* mach-o-target.c (bfd_mach_o_get_dynamic_symtab_upper_bound)
(bfd_mach_o_canonicalize_dynamic_symtab)
(bfd_mach_o_get_synthetic_symtab): Defines.
(TARGET_NAME_BACKEND): Add bfd_mach_o_print_thread entry.
(TARGET_NAME): Use Mach-O specific functions for dynamic.
* mach-o-i386.c (bfd_mach_o_i386_swap_reloc_in): Fix howto indexes
for scattered relocations.
(bfd_mach_o_i386_print_thread): New function.
(bfd_mach_o_print_thread): Define.
* mach-o.c (text_section_names_xlat): Add an entry for __const.
(bfd_mach_o_canonicalize_one_reloc, bfd_mach_o_canonicalize_relocs):
New functions extracted from ...
(bfd_mach_o_canonicalize_reloc): ... This. Simplified.
(bfd_mach_o_get_dynamic_reloc_upper_bound): New function.
(bfd_mach_o_canonicalize_dynamic_reloc): New function.
(bfd_mach_o_i386_flavour_string): Adjusted after enum renaming.
(bfd_mach_o_ppc_flavour_string): Reindentation. Add 64 bits cases.
(bfd_mach_o_scan_read_dylinker): Do not create a section anymore.
Set name_str field.
(bfd_mach_o_scan_read_dylib): Ditto.
(bfd_mach_o_scan_read_thread): Set mdata at declaration. Add comments,
reindent.
(bfd_mach_o_scan_read_dysymtab): Set mdata at declaration. Correctly
decode isym and flags on little endian targets. Set dysymtab field.
(bfd_mach_o_scan_start_address): Adjust for enum names.
(bfd_mach_o_lookup_section): Do not look for segments anymore.
(bfd_mach_o_print_section): Display bfd section name.
(bfd_mach_o_print_segment): Display none if no name.
(bfd_mach_o_print_dysymtab): Display next index for local, external
and undefined symbols.
(bfd_mach_o_bfd_print_private_bfd_data): Adjust code by using name_str.
Display dylinker name. Display thread and unixthread commands content.
(bfd_mach_o_print_thread): New macro.
* mach-o.h (bfd_mach_o_mach_header_magic): Align numbers.
(bfd_mach_o_ppc_thread_flavour): Ditto.
(bfd_mach_o_i386_thread_flavour): Ditto.
(BFD_MACH_O_PPC_THREAD_STATE_NONE): New enum.
(BFD_MACH_O_x86_THREAD_STATE_NONE): Replaces
BFD_MACH_O_THREAD_STATE_NONE.
(bfd_mach_o_segment_command): Remove segment field.
(bfd_mach_o_thread_flavour): Field offset is now unsigned long.
(bfd_mach_o_dylinker_command): Remove section field, add name_str.
(bfd_mach_o_prebound_dylib_command): Ditto.
(bfd_mach_o_dylib_command): Ditto.
(bfd_mach_o_prebound_dylib_command): Remove section field.
(mach_o_data_struct): Add dysymtab field.
(bfd_mach_o_backend_data): Add _bfd_mach_o_print_thread field.
(bfd_mach_o_get_reloc_upper_bound, bfd_mach_o_canonicalize_reloc)
(bfd_mach_o_build_commands): Remove parameter names and attributes.
(bfd_mach_o_get_dynamic_reloc_upper_bound)
(bfd_mach_o_canonicalize_dynamic_reloc): New prototypes.
Diffstat (limited to 'bfd/mach-o.h')
-rw-r--r-- | bfd/mach-o.h | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/bfd/mach-o.h b/bfd/mach-o.h index 252991d..0f48324 100644 --- a/bfd/mach-o.h +++ b/bfd/mach-o.h @@ -54,8 +54,8 @@ typedef enum bfd_mach_o_mach_header_magic { - BFD_MACH_O_MH_MAGIC = 0xfeedface, - BFD_MACH_O_MH_CIGAM = 0xcefaedfe, + BFD_MACH_O_MH_MAGIC = 0xfeedface, + BFD_MACH_O_MH_CIGAM = 0xcefaedfe, BFD_MACH_O_MH_MAGIC_64 = 0xfeedfacf, BFD_MACH_O_MH_CIGAM_64 = 0xcffaedfe } @@ -63,30 +63,32 @@ bfd_mach_o_mach_header_magic; typedef enum bfd_mach_o_ppc_thread_flavour { - BFD_MACH_O_PPC_THREAD_STATE = 1, - BFD_MACH_O_PPC_FLOAT_STATE = 2, - BFD_MACH_O_PPC_EXCEPTION_STATE = 3, - BFD_MACH_O_PPC_VECTOR_STATE = 4, - BFD_MACH_O_PPC_THREAD_STATE_64 = 5 + BFD_MACH_O_PPC_THREAD_STATE = 1, + BFD_MACH_O_PPC_FLOAT_STATE = 2, + BFD_MACH_O_PPC_EXCEPTION_STATE = 3, + BFD_MACH_O_PPC_VECTOR_STATE = 4, + BFD_MACH_O_PPC_THREAD_STATE64 = 5, + BFD_MACH_O_PPC_EXCEPTION_STATE64 = 6, + BFD_MACH_O_PPC_THREAD_STATE_NONE = 7 } bfd_mach_o_ppc_thread_flavour; /* Defined in <mach/i386/thread_status.h> */ typedef enum bfd_mach_o_i386_thread_flavour { - BFD_MACH_O_x86_THREAD_STATE32 = 1, - BFD_MACH_O_x86_FLOAT_STATE32 = 2, + BFD_MACH_O_x86_THREAD_STATE32 = 1, + BFD_MACH_O_x86_FLOAT_STATE32 = 2, BFD_MACH_O_x86_EXCEPTION_STATE32 = 3, - BFD_MACH_O_x86_THREAD_STATE64 = 4, - BFD_MACH_O_x86_FLOAT_STATE64 = 5, + BFD_MACH_O_x86_THREAD_STATE64 = 4, + BFD_MACH_O_x86_FLOAT_STATE64 = 5, BFD_MACH_O_x86_EXCEPTION_STATE64 = 6, - BFD_MACH_O_x86_THREAD_STATE = 7, - BFD_MACH_O_x86_FLOAT_STATE = 8, - BFD_MACH_O_x86_EXCEPTION_STATE = 9, - BFD_MACH_O_x86_DEBUG_STATE32 = 10, - BFD_MACH_O_x86_DEBUG_STATE64 = 11, - BFD_MACH_O_x86_DEBUG_STATE = 12, - BFD_MACH_O_THREAD_STATE_NONE = 13 + BFD_MACH_O_x86_THREAD_STATE = 7, + BFD_MACH_O_x86_FLOAT_STATE = 8, + BFD_MACH_O_x86_EXCEPTION_STATE = 9, + BFD_MACH_O_x86_DEBUG_STATE32 = 10, + BFD_MACH_O_x86_DEBUG_STATE64 = 11, + BFD_MACH_O_x86_DEBUG_STATE = 12, + BFD_MACH_O_x86_THREAD_STATE_NONE = 13 } bfd_mach_o_i386_thread_flavour; @@ -373,7 +375,6 @@ typedef struct bfd_mach_o_segment_command unsigned long nsects; unsigned long flags; bfd_mach_o_section *sections; - asection *segment; } bfd_mach_o_segment_command; #define BFD_MACH_O_LC_SEGMENT_SIZE 56 @@ -689,10 +690,12 @@ bfd_mach_o_dysymtab_command; #define BFD_MACH_O_INDIRECT_SYMBOL_ABS 0x40000000 #define BFD_MACH_O_INDIRECT_SYMBOL_SIZE 4 +/* For LC_THREAD or LC_UNIXTHREAD. */ + typedef struct bfd_mach_o_thread_flavour { unsigned long flavour; - bfd_vma offset; + unsigned long offset; unsigned long size; } bfd_mach_o_thread_flavour; @@ -711,7 +714,7 @@ typedef struct bfd_mach_o_dylinker_command { unsigned long name_offset; /* Offset to library's path name. */ unsigned long name_len; /* Offset to library's path name. */ - asection *section; + char *name_str; } bfd_mach_o_dylinker_command; @@ -725,7 +728,7 @@ typedef struct bfd_mach_o_dylib_command unsigned long timestamp; /* Library's build time stamp. */ unsigned long current_version; /* Library's current version number. */ unsigned long compatibility_version; /* Library's compatibility vers number. */ - asection *section; + char *name_str; } bfd_mach_o_dylib_command; @@ -736,7 +739,6 @@ typedef struct bfd_mach_o_prebound_dylib_command unsigned long name; /* Library's path name. */ unsigned long nmodules; /* Number of modules in library. */ unsigned long linked_modules; /* Bit vector of linked modules. */ - asection *section; } bfd_mach_o_prebound_dylib_command; @@ -808,6 +810,7 @@ typedef struct mach_o_data_struct a direct access to it. Also it is not clearly stated, only one symtab is expected. */ bfd_mach_o_symtab_command *symtab; + bfd_mach_o_dysymtab_command *dysymtab; } bfd_mach_o_data_struct; @@ -816,6 +819,8 @@ typedef struct bfd_mach_o_backend_data { 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 *, + void *, char *); } bfd_mach_o_backend_data; @@ -842,10 +847,10 @@ 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_reloc_upper_bound (bfd *abfd ATTRIBUTE_UNUSED, - asection *asect); -long bfd_mach_o_canonicalize_reloc (bfd *abfd, asection *asect, - arelent **rels, asymbol **syms); +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 *); +long bfd_mach_o_canonicalize_dynamic_reloc (bfd *, arelent **, asymbol **); asymbol *bfd_mach_o_make_empty_symbol (bfd *); void bfd_mach_o_get_symbol_info (bfd *, asymbol *, symbol_info *); void bfd_mach_o_print_symbol (bfd *, PTR, asymbol *, bfd_print_symbol_type); @@ -859,7 +864,7 @@ bfd_boolean bfd_mach_o_core_file_matches_executable_p (bfd *, bfd *); bfd *bfd_mach_o_fat_extract (bfd *, bfd_format , const bfd_arch_info_type *); const bfd_target *bfd_mach_o_header_p (bfd *, bfd_mach_o_filetype, bfd_mach_o_cpu_type); -bfd_boolean bfd_mach_o_build_commands (bfd *abfd); +bfd_boolean bfd_mach_o_build_commands (bfd *); bfd_boolean bfd_mach_o_set_section_contents (bfd *, asection *, const void *, file_ptr, bfd_size_type); unsigned int bfd_mach_o_version (bfd *); |