diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-03-25 22:53:40 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-03-25 22:53:40 +0000 |
commit | 645f842c99fff3fe0d0d542ce3ad8a5a2446a76c (patch) | |
tree | b444cc88bcfaafdeb90d7dd3285b14681adb4866 /gas/config | |
parent | 5b63f465fceee4d74e9450c91497d33d0f900fa6 (diff) | |
download | gdb-645f842c99fff3fe0d0d542ce3ad8a5a2446a76c.zip gdb-645f842c99fff3fe0d0d542ce3ad8a5a2446a76c.tar.gz gdb-645f842c99fff3fe0d0d542ce3ad8a5a2446a76c.tar.bz2 |
* config/obj-aout.c (obj_aout_frob_symbol): If N_EXT is set for an
N_INDR symbol, set BSF_EXPORT and clear BSF_LOCAL.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/obj-aout.c | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/gas/config/obj-aout.c b/gas/config/obj-aout.c index 8baa1b2..332a65f 100644 --- a/gas/config/obj-aout.c +++ b/gas/config/obj-aout.c @@ -19,6 +19,7 @@ to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "as.h" #ifdef BFD_ASSEMBLER +#undef NO_RELOC #include "aout/aout64.h" #endif #include "obstack.h" @@ -136,6 +137,11 @@ obj_aout_frob_symbol (sym, punt) /* Put indirect symbols in the indirect section. */ sym->bsym->section = &bfd_ind_section; sym->bsym->flags |= BSF_INDIRECT; + if (type & N_EXT) + { + sym->bsym->flags |= BSF_EXPORT; + sym->bsym->flags &=~ BSF_LOCAL; + } break; case N_WARNING: /* Mark warning symbols. */ @@ -151,6 +157,27 @@ obj_aout_frob_symbol (sym, punt) S_SET_TYPE (sym, type); } +void +obj_aout_frob_file () +{ + /* Relocation processing may require knowing the VMAs of the sections. + Since writing to a section will cause the BFD back end to compute the + VMAs, fake it out here.... */ + bfd_byte b = 0; + boolean x = true; + if (bfd_section_size (stdoutput, text_section) != 0) + { + x = bfd_set_section_contents (stdoutput, text_section, &b, (file_ptr) 0, + (bfd_size_type) 1); + } + else if (bfd_section_size (stdoutput, data_section) != 0) + { + x = bfd_set_section_contents (stdoutput, data_section, &b, (file_ptr) 0, + (bfd_size_type) 1); + } + assert (x == true); +} + #else /* Relocation. */ @@ -167,7 +194,7 @@ obj_emit_relocations (where, fixP, segment_address_in_file) relax_addressT segment_address_in_file; { for (; fixP; fixP = fixP->fx_next) - if (fixP->fx_addsy != NULL) + if (fixP->fx_done == 0) { tc_aout_fix_to_chars (*where, fixP, segment_address_in_file); *where += md_reloc_size; @@ -306,12 +333,10 @@ obj_crawl_symbol_chain (headers) if (!S_IS_REGISTER (symbolP) && (!S_GET_NAME (symbolP) || S_IS_DEBUG (symbolP) -#ifdef TC_I960 - /* FIXME-SOON this ifdef seems highly dubious to me. xoxorich. */ || !S_IS_DEFINED (symbolP) || S_IS_EXTERNAL (symbolP) -#endif /* TC_I960 */ - || (S_GET_NAME (symbolP)[0] != '\001' && (flagseen['L'] || !S_LOCAL_NAME (symbolP))))) + || (S_GET_NAME (symbolP)[0] != '\001' + && (flagseen['L'] || !S_LOCAL_NAME (symbolP))))) { symbolP->sy_number = symbol_number++; @@ -330,6 +355,9 @@ obj_crawl_symbol_chain (headers) else { if (S_IS_EXTERNAL (symbolP) || !S_IS_DEFINED (symbolP)) + /* This warning should never get triggered any more. + Well, maybe if you're doing twisted things with + register names... */ { as_bad ("Local symbol %s never defined.", decode_local_label_name (S_GET_NAME (symbolP))); } /* oops. */ |