From 645f842c99fff3fe0d0d542ce3ad8a5a2446a76c Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 25 Mar 1994 22:53:40 +0000 Subject: [PATCH] * 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. --- gas/ChangeLog | 3 +++ gas/config/obj-aout.c | 38 +++++++++++++++++++++++++++++++++----- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index e81f66a95bb..2911d44a85e 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,8 @@ Fri Mar 25 17:35:49 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + * 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. + * config/tc-mips.c (append_insn): If EMBEDDED_PIC, don't swap a branch with an instruction that uses $at, in case the branch is later expanded. diff --git a/gas/config/obj-aout.c b/gas/config/obj-aout.c index 8baa1b29e45..332a65f4b51 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. */ -- 2.30.2