* as.c (main): Only invoke md_end if it's defined as a macro.
authorKen Raeburn <raeburn@cygnus>
Mon, 20 Dec 1993 16:48:00 +0000 (16:48 +0000)
committerKen Raeburn <raeburn@cygnus>
Mon, 20 Dec 1993 16:48:00 +0000 (16:48 +0000)
* tc.h (md_end): Don't declare it.
* config/tc-*.[ch] (md_end): Deleted, in cases where it doesn't do anything.
* config/tc-vax.c (vip_end): Deleted null function.
* config/tc-mips.c (md_mips_end): Renamed from md_end.
* config/tc-mips.h (md_mips_end): Declare.
(md_end): New macro, calls md_mips_end.

* write.c (write_object_file): Don't close output file.
* as.c (main): Close output file (if needed) after calling listing_print, which
should be after calling write_object_file, which sets the frag addresses.

gas/config/tc-a29k.c
gas/config/tc-h8500.c
gas/config/tc-hppa.c
gas/config/tc-m88k.c
gas/config/tc-sparc.h
gas/config/tc-tahoe.c
gas/write.c

index ef929e4..5fa85bb 100644 (file)
@@ -344,11 +344,6 @@ md_begin ()
   define_some_regs ();
 }
 
-void
-md_end ()
-{
-}
-
 /* Assemble a single instruction.  Its label has already been handled
    by the generic front end.  We just parse opcode and operands, and
    produce the bytes of data and relocation.  */
index 2cea4dd..d4ffde9 100644 (file)
@@ -1165,11 +1165,6 @@ DEFUN (tc_headers_hook, (headers),
   printf ("call to tc_headers_hook \n");
 }
 
-void
-DEFUN_VOID (md_end)
-{
-}
-
 /* Various routines to kill one day */
 /* Equal to MAX_PRECISION in atof-ieee.c */
 #define MAX_LITTLENUMS 6
index 735bf84..048cf25 100644 (file)
@@ -723,6 +723,9 @@ static label_symbol_struct *label_symbols_rootp = NULL;
 /* Holds the last field selector.  */
 static int hppa_field_selector;
 
+/* A dummy bfd symbol so that all relocations have symbols of some kind.  */
+static asymbol *dummy_symbol;
+
 /* Nonzero if errors are to be printed.  */
 static int print_errors = 1;
 
@@ -1352,14 +1355,9 @@ md_begin ()
   /* SOM will change text_section.  To make sure we never put
      anything into the old one switch to the new one now.  */
   subseg_set (text_section, 0);
-}
-
-/* Called at the end of assembling a source file.  Nothing to do
-   at this point on the PA.  */
 
-void
-md_end ()
-{
+  dummy_symbol = symbol_find_or_make ("L$dummy");
+  dummy_symbol->section = text_section;
 }
 
 /* Assemble a single instruction storing it into a frag.  */
@@ -2744,8 +2742,12 @@ tc_gen_reloc (section, fixp)
        case R_S_MODE:
        case R_D_MODE:
        case R_R_MODE:
+       case R_EXIT:
+       case R_FSEL:
+       case R_LSEL:
+       case R_RSEL:
          /* There is no symbol or addend associated with these fixups.  */
-         relocs[i]->sym_ptr_ptr = 0;
+         relocs[i]->sym_ptr_ptr = dummy_symbol;
          relocs[i]->addend = 0;
          break;
 
index eaf994f..70b1889 100644 (file)
@@ -1161,11 +1161,6 @@ md_estimate_size_before_relax (fragP, segment_type)
 const relax_typeS md_relax_table[] =
 {0};
 
-void
-md_end ()
-{
-}
-
 #if 0
 
 /* As far as I can tell, this routine is never called.  What is it
index c59870e..f43f1f2 100644 (file)
@@ -21,8 +21,6 @@
 
 #define LOCAL_LABELS_FB
 
-#ifdef BFD_ASSEMBLER
-
 #define TARGET_ARCH bfd_arch_sparc
 #ifdef OBJ_AOUT
 #define TARGET_FORMAT "a.out-sunos-big"
 #define TARGET_FORMAT "elf64-sparc" /* v9 */
 #define ENV64                  /* v9 */
 #endif /* sparcv9 */
-#define LOCAL_LABEL(name)      ((name)[0] == '.')
+#define LOCAL_LABEL(name)      ((name)[0] == '.' || !strncmp ((name), "_.L_", 4))
 #endif
+#define WORKING_DOT_WORD
 
-#else
-
-#ifdef OBJ_BOUT
-#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE ((0x103 << 16) | BMAGIC)  /* Magic number for header */
-#else
-#ifdef OBJ_AOUT
-#define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE ((0x103 << 16) | OMAGIC)  /* Magic number for header */
-#endif /* OBJ_AOUT */
-#endif /* OBJ_BOUT */
-
-#define AOUT_MACHTYPE 3
-
-#define NEED_FX_R_TYPE
-
-#define tc_headers_hook(a)             {;}     /* don't need it. */
-#define tc_crawl_symbol_chain(a)       {;}     /* don't need it. */
-
-#define TC_CONS_RELOC RELOC_32
-
-#endif /* BFD_ASSEMBLER */
-
-#ifndef BFD_ASSEMBLER
-#define md_convert_frag(h,f)           {as_fatal ("sparc convert_frag\n");}
-#else
 #define md_convert_frag(b,s,f)         {as_fatal ("sparc convert_frag\n");}
-#endif
-
+#define md_create_long_jump(p,f,t,fr,s)        as_fatal("sparc_create_long_jump")
+#define md_create_short_jump(p,f,t,fr,s) as_fatal("sparc_create_short_jump")
+#define md_estimate_size_before_relax(f,s) \
+                       (as_fatal("estimate_size_before_relax called"),1)
 void tc_aout_pre_write_hook ();
 
 #define LISTING_HEADER "SPARC GAS "
index f8a1fc5..17be9fe 100644 (file)
@@ -370,11 +370,6 @@ md_begin ()
   if (errorval)
     as_fatal (errorval);
 }
-
-void
-md_end ()
-{
-}
 \f
 int
 md_parse_option (argP, cntP, vecP)
index 0f86417..8b920a9 100644 (file)
@@ -575,18 +575,7 @@ adjust_reloc_syms (abfd, sec, xxx)
        fixp->fx_offset += S_GET_VALUE (sym);
        if (sym->sy_frag)
          fixp->fx_offset += sym->sy_frag->fr_address;
-       if (symseginfo->sym)
-         fixp->fx_addsy = symseginfo->sym;
-       else
-         {
-           fixp->fx_addsy = symbol_find (symsec->name);
-           if (!fixp->fx_addsy)
-             {
-               fixp->fx_addsy = symbol_make (symsec->name);
-               fixp->fx_addsy->bsym = symsec->symbol;
-             }
-           symseginfo->sym = fixp->fx_addsy;
-         }
+       fixp->fx_addsy = section_symbol (symsec);
        fixp->fx_addsy->sy_used_in_reloc = 1;
       }
 
@@ -1284,8 +1273,6 @@ write_object_file ()
     /* Write the data to the file */
     output_file_append (the_object_file, object_file_size, out_file_name);
 #endif
-
-    output_file_close (out_file_name);
   }                            /* non vms output */
 #else /* VMS */
   /*
@@ -1437,8 +1424,6 @@ write_object_file ()
   bfd_map_over_sections (stdoutput, write_relocs, (char *) 0);
 
   bfd_map_over_sections (stdoutput, write_contents, (char *) 0);
-
-  output_file_close (out_file_name);
 #endif /* BFD_ASSEMBLER */
 }
 #endif /* ! BFD */