From b22161d698a0541ddede4074f85dad037d72af05 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Mon, 9 Jan 2012 10:47:50 +0000 Subject: add symbol qualifiers for mach-o to bfd/gas bfd: * mach-o.c (bfd_mach_o_bfd_copy_private_symbol_data): Implement. (bfd_mach_o_write_symtab): Remove handling for indirect syms. (bfd_mach_o_primary_symbol_sort_key): Likewise. (bfd_mach_o_cf_symbols): Likewise. (bfd_mach_o_sort_symbol_table): Remove. (bfd_mach_o_mangle_symbols): Adjust arguments, remove handling for indirect and dysymtab counts. Do the symbol sorting here. (bfd_mach_o_build_dysymtab_command): Count the symbol types here. Make the indirect symbols a TODO. (bfd_mach_o_build_commands): Adjust call to bfd_mach_o_mangle_symbols. (bfd_mach_o_make_empty_symbol): Specifically flag unset symbols with a non-zero value. (bfd_mach_o_read_symtab_symbol): Record the symbol index. (bfd_mach_o_read_symtab_symbol): Adjust recording of global status. * mach-o.h (mach_o_data_struct): Remove indirect and dysymtab entries. (IS_MACHO_INDIRECT): Remove. (SYM_MACHO_FIELDS_UNSET, SYM_MACHO_FIELDS_NOT_VALIDATED): New. gas: * config/obj-macho.c (obj_mach_o_weak): Remove. (obj_mach_o_common_parse): Set symbol qualifiers. (LAZY, REFE): New macros. (obj_mach_o_symbol_type): New enum. (obj_mach_o_set_symbol_qualifier): New. (obj_mach_o_sym_qual): New. (mach_o_pseudo_table): Add symbol qualifiers, set indirect_symbol to a dummy function. (obj_mach_o_type_for_symbol): New. (obj_macho_frob_label): New. (obj_macho_frob_symbol): New. * config/obj-macho.h (S_SET_ALIGN): Amend temorary var name. (obj_frob_label, obj_macho_frob_label): Declare. (obj_frob_symbol, obj_macho_frob_symbol): Declare. gas/testsuite: * gas/mach-o/err-syms-1.s: New. * gas/mach-o/err-syms-2.s: New. * gas/mach-o/err-syms-3.s: New. * gas/mach-o/symbols-2.d: New. * gas/mach-o/symbols-2.s: New. * gas/mach-o/symbols-3.s: New. * gas/mach-o/symbols-4.s: New. * gas/mach-o/symbols-5.d: New. * gas/mach-o/symbols-5.s: New. --- gas/config/obj-macho.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gas/config/obj-macho.h') diff --git a/gas/config/obj-macho.h b/gas/config/obj-macho.h index b2acd17..cbc3a4f 100644 --- a/gas/config/obj-macho.h +++ b/gas/config/obj-macho.h @@ -40,8 +40,8 @@ extern void mach_o_begin (void); /* Common symbols can carry alignment information. */ #ifndef S_SET_ALIGN #define S_SET_ALIGN(S,V) do {\ - bfd_mach_o_asymbol *s = (bfd_mach_o_asymbol *) symbol_get_bfdsym (S);\ - s->n_desc = (s->n_desc & 0xf0ff) | (((V) & 0x0f) << 8);\ + bfd_mach_o_asymbol *___s = (bfd_mach_o_asymbol *) symbol_get_bfdsym (S);\ + ___s->n_desc = (___s->n_desc & 0xf0ff) | (((V) & 0x0f) << 8);\ } while (0) #endif @@ -56,6 +56,12 @@ extern const pseudo_typeS mach_o_pseudo_table[]; #define obj_read_begin_hook() {;} #define obj_symbol_new_hook(s) {;} +#define obj_frob_label(s) obj_macho_frob_label(s) +extern void obj_macho_frob_label (struct symbol *); + +#define obj_frob_symbol(s, punt) punt = obj_macho_frob_symbol(s) +extern int obj_macho_frob_symbol (struct symbol *); + #define EMIT_SECTION_SYMBOLS 0 #define OBJ_PROCESS_STAB(SEG,W,S,T,O,D) obj_mach_o_process_stab(W,S,T,O,D) -- cgit v1.1