From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 877 invoked by alias); 12 Jan 2012 14:24:34 -0000 Received: (qmail 864 invoked by uid 22791); 12 Jan 2012 14:24:32 -0000 X-SWARE-Spam-Status: No, hits=1.7 required=5.0 tests=AWL,BAYES_99,KAM_STOCKGEN,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from c2bthomr09.btconnect.com (HELO mail.btconnect.com) (213.123.20.127) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Jan 2012 14:24:15 +0000 Received: from host81-138-1-83.in-addr.btopenworld.com (EHLO thor.office) ([81.138.1.83]) by c2bthomr09.btconnect.com with ESMTP id FXG90599; Thu, 12 Jan 2012 14:24:12 +0000 (GMT) Cc: binutils Development Message-Id: <0923B59B-D2C2-4016-8816-CDA133864E4B@sandoe-acoustics.co.uk> From: Iain Sandoe To: Tristan Gingold In-Reply-To: <862DFDB6-4B68-47E0-8080-C14D1FC20006@adacore.com> Content-Type: multipart/mixed; boundary=Apple-Mail-135-178699771 Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Patch macho/bfd/gas] .indirect_symbol, take 3. Date: Thu, 12 Jan 2012 14:24:00 -0000 References: <56BB999A-CDA7-4F2C-B58A-B4788E9B7034@sandoe-acoustics.co.uk> <862DFDB6-4B68-47E0-8080-C14D1FC20006@adacore.com> X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A0B0301.4F0EED0B.007F, actions=tag X-Junkmail-Premium-Raw: score=7/50, refid=2.7.2:2012.1.11.215414:17:7.763, ip=81.138.1.83, rules=__HAS_MSGID, __SANE_MSGID, __MSGID_APPLEMAIL, __TO_MALFORMED_2, __CT, __CTYPE_HAS_BOUNDARY, __CTYPE_MULTIPART, CTYPE_MULTIPART_NO_QUOTE, __CTYPE_MULTIPART_MIXED, __MIME_VERSION, __MIME_VERSION_APPLEMAIL, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __HAS_X_MAILER, __X_MAILER_APPLEMAIL, TXT_ATTACHED, __ANY_URI, __FRAUD_BODY_WEBMAIL, __URI_NO_WWW, __URI_NO_PATH, __CP_MEDIA_BODY, BODY_SIZE_10000_PLUS, BODYTEXTP_SIZE_3000_LESS, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, RDNS_SUSP_GENERIC, __USER_AGENT_APPLEMAIL, RDNS_SUSP, __FRAUD_WEBMAIL, MIME_TEXT_ONLY_MP_MIXED X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B0209.4F0EED0C.01CA,ss=1,re=0.000,fgs=0, ip=0.0.0.0, so=2011-07-25 19:15:43, dmn=2011-05-27 18:58:46, mode=multiengine X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00165.txt.bz2 --Apple-Mail-135-178699771 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Content-length: 420 Hi Tristan, On 12 Jan 2012, at 08:49, Tristan Gingold wrote: >> >> + if (isyms[j] == NULL) >> + dsym->indirect_syms[n] = 0x80000000; > We need a constant for that (ok, not your fault). me being impatient .. sorry, I've taken the liberty of adding a constant for this and ABS to loader.h > Ok with the suggested change, no need to resubmit. committed as attached, with the test-cases. thanks Iain --Apple-Mail-135-178699771 Content-Disposition: attachment; filename=12011214-indirect-code.txt Content-Type: text/plain; x-unix-mode=0644; name="12011214-indirect-code.txt" Content-Transfer-Encoding: quoted-printable Content-length: 18420 Index: bfd/ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/bfd/ChangeLog,v retrieving revision 1.5584 diff -u -p -r1.5584 ChangeLog --- bfd/ChangeLog 11 Jan 2012 15:24:09 -0000 1.5584 +++ bfd/ChangeLog 12 Jan 2012 13:59:41 -0000 @@ -1,3 +1,10 @@ +2012-01-12 Iain Sandoe + + * mach-o.c (bfd_mach_o_count_indirect_symbols): New. + (bfd_mach_o_build_dysymtab_command): Populate indirect symbol table. + * mach-o.h (bfd_mach_o_asymbol): Move declaration to start of the + file. (bfd_mach_o_section): Add indirect_syms field. + 2012-01-11 Iain Sandoe =20 * mach-o.c (bfd_mach_o_build_seg_command): Separate computation of Index: bfd/mach-o.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/bfd/mach-o.c,v retrieving revision 1.95 diff -u -p -r1.95 mach-o.c --- bfd/mach-o.c 11 Jan 2012 15:24:10 -0000 1.95 +++ bfd/mach-o.c 12 Jan 2012 13:59:45 -0000 @@ -2079,6 +2079,33 @@ bfd_mach_o_build_seg_command (const char return TRUE; } =20 +/* Count the number of indirect symbols in the image. + Requires that the sections are in their final order. */ + +static unsigned int +bfd_mach_o_count_indirect_symbols (bfd *abfd, bfd_mach_o_data_struct *mdat= a) +{ + unsigned int i; + unsigned int nisyms =3D 0; + + for (i =3D 0; i < mdata->nsects; ++i) + { + bfd_mach_o_section *sec =3D mdata->sections[i]; + + switch (sec->flags & BFD_MACH_O_SECTION_TYPE_MASK) + { + case BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS: + case BFD_MACH_O_S_LAZY_SYMBOL_POINTERS: + case BFD_MACH_O_S_SYMBOL_STUBS: + nisyms +=3D bfd_mach_o_section_get_nbr_indirect (abfd, sec); + break; + default: + break; + } + } + return nisyms; +} + static bfd_boolean bfd_mach_o_build_dysymtab_command (bfd *abfd, bfd_mach_o_data_struct *mdata, @@ -2135,9 +2162,11 @@ bfd_mach_o_build_dysymtab_command (bfd * dsym->nundefsym =3D 0; } =20 + dsym->nindirectsyms =3D bfd_mach_o_count_indirect_symbols (abfd, mdata); if (dsym->nindirectsyms > 0) { unsigned i; + unsigned n; =20 mdata->filelen =3D FILE_ALIGN (mdata->filelen, 2); dsym->indirectsymoff =3D mdata->filelen; @@ -2146,11 +2175,38 @@ bfd_mach_o_build_dysymtab_command (bfd * dsym->indirect_syms =3D bfd_zalloc (abfd, dsym->nindirectsyms * 4); if (dsym->indirect_syms =3D=3D NULL) return FALSE; -=20=20=20=20=20=20 - /* So fill in the indices. */ - for (i =3D 0; i < dsym->nindirectsyms; ++i) +=09=09=20=20 + n =3D 0; + for (i =3D 0; i < mdata->nsects; ++i) { - /* TODO: fill in the table. */ + bfd_mach_o_section *sec =3D mdata->sections[i]; + + switch (sec->flags & BFD_MACH_O_SECTION_TYPE_MASK) + { + case BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS: + case BFD_MACH_O_S_LAZY_SYMBOL_POINTERS: + case BFD_MACH_O_S_SYMBOL_STUBS: + { + unsigned j, num; + bfd_mach_o_asymbol **isyms =3D sec->indirect_syms; +=09=09=20=20 + num =3D bfd_mach_o_section_get_nbr_indirect (abfd, sec); + if (isyms =3D=3D NULL || num =3D=3D 0) + break; + /* Record the starting index in the reserved1 field. */ + sec->reserved1 =3D n; + for (j =3D 0; j < num; j++, n++) + { + if (isyms[j] =3D=3D NULL) + dsym->indirect_syms[n] =3D BFD_MACH_O_INDIRECT_SYM_LOCAL; + else + dsym->indirect_syms[n] =3D isyms[j]->symbol.udata.i; + } + } + break; + default: + break; + } } } =20 Index: bfd/mach-o.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/bfd/mach-o.h,v retrieving revision 1.41 diff -u -p -r1.41 mach-o.h --- bfd/mach-o.h 9 Jan 2012 10:47:45 -0000 1.41 +++ bfd/mach-o.h 12 Jan 2012 13:59:45 -0000 @@ -42,6 +42,18 @@ typedef struct bfd_mach_o_header } bfd_mach_o_header; =20 +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 =20 @@ -64,6 +76,12 @@ typedef struct bfd_mach_o_section /* Corresponding bfd section. */ asection *bfdsection; =20 + /* 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; } @@ -105,26 +123,12 @@ typedef struct bfd_mach_o_reloc_info } bfd_mach_o_reloc_info; =20 -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) */ =20 Index: gas/config/obj-macho.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gas/config/obj-macho.c,v retrieving revision 1.10 diff -u -p -r1.10 obj-macho.c --- gas/config/obj-macho.c 9 Jan 2012 10:47:47 -0000 1.10 +++ gas/config/obj-macho.c 12 Jan 2012 13:59:57 -0000 @@ -1032,6 +1032,7 @@ obj_mach_o_set_symbol_qualifier (symbolS =20 case OBJ_MACH_O_SYM_PRIV_EXT: s->n_type |=3D BFD_MACH_O_N_PEXT ; + s->n_desc &=3D ~LAZY; /* The native tool switches this off too. */ /* We follow the system tools in marking PEXT as also global. */ /* Fall through. */ =20 @@ -1131,13 +1132,77 @@ obj_mach_o_sym_qual (int ntype) demand_empty_rest_of_line (); } =20 -/* Dummy function to allow test-code to work while we are working - on things. */ +typedef struct obj_mach_o_indirect_sym +{ + symbolS *sym; + segT sect; + struct obj_mach_o_indirect_sym *next; +} obj_mach_o_indirect_sym; + +/* We store in order an maintain a pointer to the last one - to save rever= sing + later. */ +obj_mach_o_indirect_sym *indirect_syms; +obj_mach_o_indirect_sym *indirect_syms_tail; =20 static void -obj_mach_o_placeholder (int arg ATTRIBUTE_UNUSED) +obj_mach_o_indirect_symbol (int arg ATTRIBUTE_UNUSED) { - ignore_rest_of_line (); + bfd_mach_o_section *sec =3D bfd_mach_o_get_mach_o_section (now_seg); + +#ifdef md_flush_pending_output + md_flush_pending_output (); +#endif + + if (obj_mach_o_is_static) + as_bad (_("use of .indirect_symbols requires `-dynamic'")); + + switch (sec->flags & BFD_MACH_O_SECTION_TYPE_MASK) + { + case BFD_MACH_O_S_SYMBOL_STUBS: + case BFD_MACH_O_S_LAZY_SYMBOL_POINTERS: + case BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS: + { + obj_mach_o_indirect_sym *isym; + char *name =3D input_line_pointer; + char c =3D get_symbol_end (); + symbolS *sym =3D symbol_find_or_make (name); + unsigned int elsize =3D + bfd_mach_o_section_get_entry_size (stdoutput, sec); + + if (elsize =3D=3D 0) + { + as_bad (_("attempt to add an indirect_symbol to a stub or" + " reference section with a zero-sized element at %s"), + name); + *input_line_pointer =3D c; + ignore_rest_of_line (); + return; + } + *input_line_pointer =3D c; + + isym =3D (obj_mach_o_indirect_sym *) + xmalloc (sizeof (obj_mach_o_indirect_sym)); + + /* Just record the data for now, we will validate it when we + compute the output in obj_mach_o_set_indirect_symbols. */ + isym->sym =3D sym; + isym->sect =3D now_seg; + isym->next =3D NULL; + if (indirect_syms =3D=3D NULL) + indirect_syms =3D isym; + else + indirect_syms_tail->next =3D isym; + indirect_syms_tail =3D isym; + } + break; + + default: + as_bad (_("an .indirect_symbol must be in a symbol pointer" + " or stub section.")); + ignore_rest_of_line (); + return; + } + demand_empty_rest_of_line (); } =20 const pseudo_typeS mach_o_pseudo_table[] =3D @@ -1231,7 +1296,7 @@ const pseudo_typeS mach_o_pseudo_table[] {"no_dead_strip", obj_mach_o_sym_qual, OBJ_MACH_O_SYM_NO_DEAD_STRIP}, {"weak", obj_mach_o_sym_qual, OBJ_MACH_O_SYM_WEAK}, /* ext */ =20 - {"indirect_symbol", obj_mach_o_placeholder, 0}, + { "indirect_symbol", obj_mach_o_indirect_symbol, 0}, =20 /* File flags. */ { "subsections_via_symbols", obj_mach_o_fileprop,=20 @@ -1270,15 +1335,25 @@ obj_mach_o_type_for_symbol (bfd_mach_o_a =20 void obj_macho_frob_label (struct symbol *sp) { - bfd_mach_o_asymbol *s =3D (bfd_mach_o_asymbol *) symbol_get_bfdsym (sp); - /* This is the base symbol type, that we mask in. */ - unsigned base_type =3D obj_mach_o_type_for_symbol (s); - bfd_mach_o_section *sec =3D bfd_mach_o_get_mach_o_section (s->symbol.sec= tion); + bfd_mach_o_asymbol *s; + unsigned base_type; + bfd_mach_o_section *sec; int sectype =3D -1; =20 + /* Leave local symbols alone. */ + + if (S_IS_LOCAL (sp)) + return; + + s =3D (bfd_mach_o_asymbol *) symbol_get_bfdsym (sp); + /* Leave debug symbols alone. */ if ((s->n_type & BFD_MACH_O_N_STAB) !=3D 0) - return; /* Leave alone. */ -=20=20 + return; + + /* This is the base symbol type, that we mask in. */ + base_type =3D obj_mach_o_type_for_symbol (s); + + sec =3D bfd_mach_o_get_mach_o_section (s->symbol.section);=20=20 if (sec !=3D NULL) sectype =3D sec->flags & BFD_MACH_O_SECTION_TYPE_MASK; =20 @@ -1307,34 +1382,41 @@ void obj_macho_frob_label (struct symbol int obj_macho_frob_symbol (struct symbol *sp) { - bfd_mach_o_asymbol *s =3D (bfd_mach_o_asymbol *) symbol_get_bfdsym (sp); - unsigned base_type =3D obj_mach_o_type_for_symbol (s); - bfd_mach_o_section *sec =3D bfd_mach_o_get_mach_o_section (s->symbol.sec= tion); + bfd_mach_o_asymbol *s; + unsigned base_type; + bfd_mach_o_section *sec; int sectype =3D -1; -=20=20 + + /* Leave local symbols alone. */ + if (S_IS_LOCAL (sp)) + return 0; + + s =3D (bfd_mach_o_asymbol *) symbol_get_bfdsym (sp); + /* Leave debug symbols alone. */ + if ((s->n_type & BFD_MACH_O_N_STAB) !=3D 0) + return 0; + + base_type =3D obj_mach_o_type_for_symbol (s); + sec =3D bfd_mach_o_get_mach_o_section (s->symbol.section);=20=20 if (sec !=3D NULL) sectype =3D sec->flags & BFD_MACH_O_SECTION_TYPE_MASK; =20 - if ((s->n_type & BFD_MACH_O_N_STAB) !=3D 0) - return 0; /* Leave alone. */ - else if (s->symbol.section =3D=3D bfd_und_section_ptr) + if (s->symbol.section =3D=3D bfd_und_section_ptr) { /* ??? Do we really gain much from implementing this as well as the mach-o specific ones? */ if (s->symbol.flags & BSF_WEAK) s->n_desc |=3D BFD_MACH_O_N_WEAK_REF; =20 - /* Undefined references, become extern. */ - if (s->n_desc & REFE) - { - s->n_desc &=3D ~REFE; - s->n_type |=3D BFD_MACH_O_N_EXT; - } - - /* So do undefined 'no_dead_strip's. */ - if (s->n_desc & BFD_MACH_O_N_NO_DEAD_STRIP) - s->n_type |=3D BFD_MACH_O_N_EXT; - + /* Undefined syms, become extern. */ + s->n_type |=3D BFD_MACH_O_N_EXT; + S_SET_EXTERNAL (sp); + } + else if (s->symbol.section =3D=3D bfd_com_section_ptr) + { + /* ... so do comm. */ + s->n_type |=3D BFD_MACH_O_N_EXT; + S_SET_EXTERNAL (sp); } else { @@ -1353,6 +1435,7 @@ obj_macho_frob_symbol (struct symbol *sp { /* Anything here that should be added that is non-standard. */ s->n_desc &=3D ~BFD_MACH_O_REFERENCE_MASK; + s->symbol.udata.i =3D SYM_MACHO_FIELDS_NOT_VALIDATED; }=20=20=20=20 else if (s->symbol.udata.i =3D=3D SYM_MACHO_FIELDS_NOT_VALIDATED) { @@ -1388,6 +1471,125 @@ obj_macho_frob_symbol (struct symbol *sp return 0; } =20 +static void +obj_mach_o_set_indirect_symbols (bfd *abfd, asection *sec, + void *xxx ATTRIBUTE_UNUSED) +{ + bfd_vma sect_size =3D bfd_section_size (abfd, sec); + bfd_mach_o_section *ms =3D bfd_mach_o_get_mach_o_section (sec); + unsigned lazy =3D 0; + + /* See if we have any indirect syms to consider. */ + if (indirect_syms =3D=3D NULL) + return; + + /* Process indirect symbols. + Check for errors, if OK attach them as a flat array to the section + for which they are defined. */ + + switch (ms->flags & BFD_MACH_O_SECTION_TYPE_MASK) + { + case BFD_MACH_O_S_SYMBOL_STUBS: + case BFD_MACH_O_S_LAZY_SYMBOL_POINTERS: + lazy =3D LAZY; + /* Fall through. */ + case BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS: + { + unsigned int nactual =3D 0; + unsigned int ncalc; + obj_mach_o_indirect_sym *isym; + obj_mach_o_indirect_sym *list =3D NULL; + obj_mach_o_indirect_sym *list_tail =3D NULL; + unsigned long eltsiz =3D=20 + bfd_mach_o_section_get_entry_size (abfd, ms); + + for (isym =3D indirect_syms; isym !=3D NULL; isym =3D isym->next) + { + if (isym->sect =3D=3D sec) + { + nactual++; + if (list =3D=3D NULL) + list =3D isym; + else + list_tail->next =3D isym; + list_tail =3D isym; + } + } + + /* If none are in this section, stop here. */ + if (nactual =3D=3D 0) + break; + + /* If we somehow added indirect symbols to a section with a zero + entry size, we're dead ... */ + gas_assert (eltsiz !=3D 0); + + ncalc =3D (unsigned int) (sect_size / eltsiz); + if (nactual !=3D ncalc) + as_bad (_("the number of .indirect_symbols defined in section %s" + " does not match the number expected (%d defined, %d" + " expected)"), sec->name, nactual, ncalc); + else + { + unsigned n; + bfd_mach_o_asymbol *sym; + ms->indirect_syms =3D + bfd_zalloc (abfd, + nactual * sizeof (bfd_mach_o_asymbol *)); + + if (ms->indirect_syms =3D=3D NULL) + { + as_fatal (_("internal error: failed to allocate %d indirect" + "symbol pointers"), nactual); + } +=09=20=20=20=20=20=20 + for (isym =3D list, n =3D 0; isym !=3D NULL; isym =3D isym->next, n= ++) + { + /* Array is init to NULL & NULL signals a local symbol + If the section is lazy-bound, we need to keep the + reference to the symbol, since dyld can override. */ + if (S_IS_LOCAL (isym->sym) && ! lazy) + ; + else + { + sym =3D (bfd_mach_o_asymbol *)symbol_get_bfdsym (isym->sym); + if (sym =3D=3D NULL) + ; + /* If the symbols is external ... */ + else if (S_IS_EXTERNAL (isym->sym) + || (sym->n_type & BFD_MACH_O_N_EXT) + || ! S_IS_DEFINED (isym->sym) + || lazy) + { + sym->n_desc &=3D ~LAZY; + /* ... it can be lazy, if not defined or hidden. */ + if ((sym->n_type & BFD_MACH_O_N_TYPE)=20 + =3D=3D BFD_MACH_O_N_UNDF=20 + && ! (sym->n_type & BFD_MACH_O_N_PEXT) + && (sym->n_type & BFD_MACH_O_N_EXT)) + sym->n_desc |=3D lazy; + ms->indirect_syms[n] =3D sym; + } + } + } + } + } + break; + + default: + break; + } +} + +/* The process of relocation could alter what's externally visible, thus we + leave setting the indirect symbols until last. */ + +void +obj_mach_o_frob_file_after_relocs (void) +{ + bfd_map_over_sections (stdoutput, obj_mach_o_set_indirect_symbols, (char= *) 0); +} + /* Support stabs for mach-o. */ =20 void Index: gas/config/obj-macho.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gas/config/obj-macho.h,v retrieving revision 1.5 diff -u -p -r1.5 obj-macho.h --- gas/config/obj-macho.h 9 Jan 2012 10:47:47 -0000 1.5 +++ gas/config/obj-macho.h 12 Jan 2012 14:00:04 -0000 @@ -62,6 +62,9 @@ extern void obj_macho_frob_label (struct #define obj_frob_symbol(s, punt) punt =3D obj_macho_frob_symbol(s) extern int obj_macho_frob_symbol (struct symbol *); =20 +#define obj_frob_file_after_relocs obj_mach_o_frob_file_after_relocs +extern void obj_mach_o_frob_file_after_relocs (void); + #define EMIT_SECTION_SYMBOLS 0 =20 #define OBJ_PROCESS_STAB(SEG,W,S,T,O,D) obj_mach_o_process_stab(W,S,T,O,D) Index: include/mach-o/ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/include/mach-o/ChangeLog,v retrieving revision 1.7 diff -u -p -r1.7 ChangeLog --- include/mach-o/ChangeLog 4 Jan 2012 10:37:36 -0000 1.7 +++ include/mach-o/ChangeLog 12 Jan 2012 14:00:04 -0000 @@ -1,3 +1,8 @@ +2012-01-12 Iain Sandoe + + * loader.h (BFD_MACH_O_INDIRECT_SYM_LOCAL): New. + (BFD_MACH_O_INDIRECT_SYM_ABS): New + 2012-01-04 Tristan Gingold =20 * external.h (mach_o_fvmlib_command_external): New structure. Index: include/mach-o/loader.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/include/mach-o/loader.h,v retrieving revision 1.5 diff -u -p -r1.5 loader.h --- include/mach-o/loader.h 4 Jan 2012 10:25:14 -0000 1.5 +++ include/mach-o/loader.h 12 Jan 2012 14:00:04 -0000 @@ -320,6 +320,9 @@ bfd_mach_o_section_attribute; #define BFD_MACH_O_N_NO_DEAD_STRIP 0x20 #define BFD_MACH_O_N_WEAK_REF 0x40 #define BFD_MACH_O_N_WEAK_DEF 0x80 + +#define BFD_MACH_O_INDIRECT_SYM_LOCAL 0x80000000 +#define BFD_MACH_O_INDIRECT_SYM_ABS 0x40000000 =0C /* Thread constants. */ =20 --Apple-Mail-135-178699771 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1 --Apple-Mail-135-178699771--