* obj.h (struct format_ops): New members begin, app_file,
authorHans-Peter Nilsson <hp@axis.com>
Mon, 22 May 2000 21:19:43 +0000 (21:19 +0000)
committerHans-Peter Nilsson <hp@axis.com>
Mon, 22 May 2000 21:19:43 +0000 (21:19 +0000)
s_set_other, s_set_desc, s_get_type, s_set_type,
separate_stab_sections, init_stab_section.

* config/obj-multi.h: Update GPL notice to v2.
(obj_begin): New.
(obj_app_file): New.
(S_SET_SIZE): Test s_set_size for NULL before calling.
(S_SET_ALIGN): Similar for s_set_align.
(S_SET_OTHER): New.
(S_SET_DESC): New.
(S_GET_TYPE): New.
(S_SET_TYPE): New.
(SEPARATE_STAB_SECTIONS): New.
(INIT_STAB_SECTION): New.
(EMIT_SECTION_SYMBOLS): New.
(AOUT_STABS) [OBJ_MAYBE_AOUT]: Define.

* config/obj-elf.h: Update GPL notice to v2.
Mention that this file is included from obj-multi.h.
(obj_begin): Wrap definition in ifndef.
(elf_file_symbol): Constify declaration.
(obj_app_file): Ditto.
(SEPARATE_STAB_SECTIONS, INIT_STAB_SECTION, OBJ_PROCESS_STAB):
Wrap in ifndef SEPARATE_STAB_SECTIONS.

* config/obj-elf.c (elf_s_set_other): New.
(elf_file_symbol): Constify argument.
(elf_separate_stab_sections): New.
(elf_init_stab_section): New.
(elf_format_ops): Add new members.  Remove comma at end.

* config/obj-ecoff.c (ecoff_separate_stab_sections): New.
(ecoff_format_ops): Add new fields.  Remove comma at end.
Mention inconsistency for emit_section_symbols.

* config/obj-coff.h (c_dot_file_symbol): Constify declaration.

* config/obj-coff.c (c_dot_file_symbol): Constify argument.
(coff_separate_stab_sections): New.
(coff_format_ops): Add new members.

* config/obj-aout.c (obj_aout_sec_sym_ok_for_reloc): New.
(obj_aout_s_set_other): New.
(obj_aout_s_set_desc): New.
(obj_aout_s_get_type): New.
(obj_aout_s_set_type): New.
(obj_aout_separate_stab_sections): New.
(aout_format_ops): New members added.  Use obj_aout_process_stab,
not 0.  Use obj_aout_sec_sym_ok_for_reloc, not 0.
(obj_aout_frob_symbol): Add ATTRIBUTE_UNUSED to args as
appropriate.
(obj_aout_line, obj_aout_weak, obj_aout_type): Ditto.

gas/ChangeLog
gas/config/obj-aout.c
gas/config/obj-coff.c
gas/config/obj-coff.h
gas/config/obj-ecoff.c
gas/config/obj-elf.c
gas/config/obj-elf.h
gas/config/obj-multi.h
gas/obj.h

index d9aabdd5a6b630ab3b4b9bde68cc696bf7b950bc..9f69a28464dc3d36b86c2432bd262428c97e5b91 100644 (file)
@@ -1,3 +1,59 @@
+Mon May 22 22:43:32 2000  Hans-Peter Nilsson  <hp@axis.com>
+
+       * obj.h (struct format_ops): New members begin, app_file,
+       s_set_other, s_set_desc, s_get_type, s_set_type,
+       separate_stab_sections, init_stab_section.
+
+       * config/obj-multi.h: Update GPL notice to v2.
+       (obj_begin): New.
+       (obj_app_file): New.
+       (S_SET_SIZE): Test s_set_size for NULL before calling.
+       (S_SET_ALIGN): Similar for s_set_align.
+       (S_SET_OTHER): New.
+       (S_SET_DESC): New.
+       (S_GET_TYPE): New.
+       (S_SET_TYPE): New.
+       (SEPARATE_STAB_SECTIONS): New.
+       (INIT_STAB_SECTION): New.
+       (EMIT_SECTION_SYMBOLS): New.
+       (AOUT_STABS) [OBJ_MAYBE_AOUT]: Define.
+
+       * config/obj-elf.h: Update GPL notice to v2.
+       Mention that this file is included from obj-multi.h.
+       (obj_begin): Wrap definition in ifndef.
+       (elf_file_symbol): Constify declaration.
+       (obj_app_file): Ditto.
+       (SEPARATE_STAB_SECTIONS, INIT_STAB_SECTION, OBJ_PROCESS_STAB):
+       Wrap in ifndef SEPARATE_STAB_SECTIONS.
+
+       * config/obj-elf.c (elf_s_set_other): New.
+       (elf_file_symbol): Constify argument.
+       (elf_separate_stab_sections): New.
+       (elf_init_stab_section): New.
+       (elf_format_ops): Add new members.  Remove comma at end.
+
+       * config/obj-ecoff.c (ecoff_separate_stab_sections): New.
+       (ecoff_format_ops): Add new fields.  Remove comma at end.
+       Mention inconsistency for emit_section_symbols.
+
+       * config/obj-coff.h (c_dot_file_symbol): Constify declaration.
+
+       * config/obj-coff.c (c_dot_file_symbol): Constify argument.
+       (coff_separate_stab_sections): New.
+       (coff_format_ops): Add new members.
+
+       * config/obj-aout.c (obj_aout_sec_sym_ok_for_reloc): New.
+       (obj_aout_s_set_other): New.
+       (obj_aout_s_set_desc): New.
+       (obj_aout_s_get_type): New.
+       (obj_aout_s_set_type): New.
+       (obj_aout_separate_stab_sections): New.
+       (aout_format_ops): New members added.  Use obj_aout_process_stab,
+       not 0.  Use obj_aout_sec_sym_ok_for_reloc, not 0.
+       (obj_aout_frob_symbol): Add ATTRIBUTE_UNUSED to args as
+       appropriate.
+       (obj_aout_line, obj_aout_weak, obj_aout_type): Ditto.
+
 2000-05-22  Alan Modra  <alan@linuxcare.com.au>
 
        * config/tc-i386.c (tc_i386_fix_adjustable): Prevent adjustment
 2000-05-22  Alan Modra  <alan@linuxcare.com.au>
 
        * config/tc-i386.c (tc_i386_fix_adjustable): Prevent adjustment
index eabbe924e6c9b67160cd661560b8ee5bbc68be41..3a9b3f1af28ee85d658aa4193196fbce6ab00d4b 100644 (file)
@@ -105,7 +105,7 @@ const pseudo_typeS aout_pseudo_table[] =
 void
 obj_aout_frob_symbol (sym, punt)
      symbolS *sym;
 void
 obj_aout_frob_symbol (sym, punt)
      symbolS *sym;
-     int *punt;
+     int *punt ATTRIBUTE_UNUSED;
 {
   flagword flags;
   asection *sec;
 {
   flagword flags;
   asection *sec;
@@ -355,7 +355,7 @@ obj_emit_symbols (where, symbol_rootP)
 
 static void
 obj_aout_line (ignore)
 
 static void
 obj_aout_line (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   /* Assume delimiter is part of expression.
      BSD4.2 as fails with delightful bug, so we
 {
   /* Assume delimiter is part of expression.
      BSD4.2 as fails with delightful bug, so we
@@ -368,7 +368,7 @@ obj_aout_line (ignore)
 
 static void
 obj_aout_weak (ignore)
 
 static void
 obj_aout_weak (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *name;
   int c;
 {
   char *name;
   int c;
@@ -401,7 +401,7 @@ obj_aout_weak (ignore)
 
 static void
 obj_aout_type (ignore)
 
 static void
 obj_aout_type (ignore)
-     int ignore;
+     int ignore ATTRIBUTE_UNUSED;
 {
   char *name;
   int c;
 {
   char *name;
   int c;
@@ -641,7 +641,14 @@ DEFUN_VOID (s_sect)
 
 static void aout_pop_insert PARAMS ((void));
 static int obj_aout_s_get_other PARAMS ((symbolS *));
 
 static void aout_pop_insert PARAMS ((void));
 static int obj_aout_s_get_other PARAMS ((symbolS *));
+static void obj_aout_s_set_other PARAMS ((symbolS *, int));
 static int obj_aout_s_get_desc PARAMS ((symbolS *));
 static int obj_aout_s_get_desc PARAMS ((symbolS *));
+static void obj_aout_s_set_desc PARAMS ((symbolS *, int));
+static int obj_aout_s_get_type PARAMS ((symbolS *));
+static void obj_aout_s_set_type PARAMS ((symbolS *, int));
+static int obj_aout_separate_stab_sections PARAMS ((void));
+static int obj_aout_sec_sym_ok_for_reloc PARAMS ((asection *));
+static void obj_aout_process_stab PARAMS ((segT, int, const char *, int, int, int));
 
 static void
 aout_pop_insert ()
 
 static void
 aout_pop_insert ()
@@ -656,6 +663,33 @@ obj_aout_s_get_other (sym)
   return aout_symbol (symbol_get_bfdsym (sym))->other;
 }
 
   return aout_symbol (symbol_get_bfdsym (sym))->other;
 }
 
+static void
+obj_aout_s_set_other (sym, o)
+     symbolS *sym;
+     int o;
+{
+  aout_symbol (symbol_get_bfdsym (sym))->other = o;
+}
+
+static int
+obj_aout_sec_sym_ok_for_reloc (sec)
+     asection *sec ATTRIBUTE_UNUSED;
+{
+  return obj_sec_sym_ok_for_reloc (sec);
+}
+
+static void
+obj_aout_process_stab (seg, w, s, t, o, d)
+     segT seg ATTRIBUTE_UNUSED;
+     int w;
+     const char *s;
+     int t;
+     int o;
+     int d;
+{
+  aout_process_stab (w, s, t, o, d);
+}
+
 static int
 obj_aout_s_get_desc (sym)
      symbolS *sym;
 static int
 obj_aout_s_get_desc (sym)
      symbolS *sym;
@@ -663,12 +697,44 @@ obj_aout_s_get_desc (sym)
   return aout_symbol (symbol_get_bfdsym (sym))->desc;
 }
 
   return aout_symbol (symbol_get_bfdsym (sym))->desc;
 }
 
+static void
+obj_aout_s_set_desc (sym, d)
+     symbolS *sym;
+     int d;
+{
+  aout_symbol (symbol_get_bfdsym (sym))->desc = d;
+}
+
+static int
+obj_aout_s_get_type (sym)
+     symbolS *sym;
+{
+  return aout_symbol (symbol_get_bfdsym (sym))->type;
+}
+
+static void
+obj_aout_s_set_type (sym, t)
+     symbolS *sym;
+     int t;
+{
+  aout_symbol (symbol_get_bfdsym (sym))->type = t;
+}
+
+static int
+obj_aout_separate_stab_sections ()
+{
+  return 0;
+}
 
 
+/* When changed, make sure these table entries match the single-format
+   definitions in obj-aout.h.  */
 const struct format_ops aout_format_ops =
 {
   bfd_target_aout_flavour,
   1,   /* dfl_leading_underscore */
   0,   /* emit_section_symbols */
 const struct format_ops aout_format_ops =
 {
   bfd_target_aout_flavour,
   1,   /* dfl_leading_underscore */
   0,   /* emit_section_symbols */
+  0,   /* begin */
+  0,   /* app_file */
   obj_aout_frob_symbol,
   obj_aout_frob_file,
   0,   /* frob_file_after_relocs */
   obj_aout_frob_symbol,
   obj_aout_frob_file,
   0,   /* frob_file_after_relocs */
@@ -677,11 +743,17 @@ const struct format_ops aout_format_ops =
   0,   /* s_get_align */
   0,   /* s_set_align */
   obj_aout_s_get_other,
   0,   /* s_get_align */
   0,   /* s_set_align */
   obj_aout_s_get_other,
+  obj_aout_s_set_other,
   obj_aout_s_get_desc,
   obj_aout_s_get_desc,
+  obj_aout_s_set_desc,
+  obj_aout_s_get_type,
+  obj_aout_s_set_type,
   0,   /* copy_symbol_attributes */
   0,   /* generate_asm_lineno */
   0,   /* copy_symbol_attributes */
   0,   /* generate_asm_lineno */
-  0,   /* process_stab */
-  0,   /* sec_sym_ok_for_reloc */
+  obj_aout_process_stab,
+  obj_aout_separate_stab_sections,
+  0,   /* init_stab_section */
+  obj_aout_sec_sym_ok_for_reloc,
   aout_pop_insert,
   0,   /* ecoff_set_ext */
   0,   /* read_begin_hook */
   aout_pop_insert,
   0,   /* ecoff_set_ext */
   0,   /* read_begin_hook */
index 11648b998d2af9db67e9d9e4065e29d039852edb..f37c62c4b963e4c3475bf303e821ee90534e09a3 100644 (file)
@@ -346,7 +346,7 @@ c_symbol_merge (debug, normal)
 
 void
 c_dot_file_symbol (filename)
 
 void
 c_dot_file_symbol (filename)
-     char *filename;
+     const char *filename;
 {
   symbolS *symbolP;
 
 {
   symbolS *symbolP;
 
@@ -4582,6 +4582,7 @@ const pseudo_typeS coff_pseudo_table[] =
 /* Support for a COFF emulation.  */
 
 static void coff_pop_insert PARAMS ((void));
 /* Support for a COFF emulation.  */
 
 static void coff_pop_insert PARAMS ((void));
+static int coff_separate_stab_sections PARAMS ((void));
 
 static void
 coff_pop_insert ()
 
 static void
 coff_pop_insert ()
@@ -4589,11 +4590,19 @@ coff_pop_insert ()
   pop_insert (coff_pseudo_table);
 }
 
   pop_insert (coff_pseudo_table);
 }
 
+static int
+coff_separate_stab_sections ()
+{
+  return 1;
+}
+
 const struct format_ops coff_format_ops =
 {
   bfd_target_coff_flavour,
   0,   /* dfl_leading_underscore */
   1,   /* emit_section_symbols */
 const struct format_ops coff_format_ops =
 {
   bfd_target_coff_flavour,
   0,   /* dfl_leading_underscore */
   1,   /* emit_section_symbols */
+  0,    /* begin */
+  c_dot_file_symbol,
   coff_frob_symbol,
   0,   /* frob_file */
   coff_frob_file_after_relocs,
   coff_frob_symbol,
   0,   /* frob_file */
   coff_frob_file_after_relocs,
@@ -4602,10 +4611,16 @@ const struct format_ops coff_format_ops =
   0,   /* s_get_align */
   0,   /* s_set_align */
   0,   /* s_get_other */
   0,   /* s_get_align */
   0,   /* s_set_align */
   0,   /* s_get_other */
+  0,   /* s_set_other */
   0,   /* s_get_desc */
   0,   /* s_get_desc */
+  0,   /* s_set_desc */
+  0,   /* s_get_type */
+  0,   /* s_set_type */
   0,   /* copy_symbol_attributes */
   0,   /* generate_asm_lineno */
   0,   /* process_stab */
   0,   /* copy_symbol_attributes */
   0,   /* generate_asm_lineno */
   0,   /* process_stab */
+  coff_separate_stab_sections,
+  obj_coff_init_stab_section,
   0,   /* sec_sym_ok_for_reloc */
   coff_pop_insert,
   0,   /* ecoff_set_ext */
   0,   /* sec_sym_ok_for_reloc */
   coff_pop_insert,
   0,   /* ecoff_set_ext */
index f60ae365fb9192b548efed497e0deca069787caa..a8d038aee3bd3aaea1d998b371b1da15fd50b8d0 100644 (file)
@@ -369,7 +369,7 @@ extern int coff_n_line_nos;
 extern void coff_add_linesym PARAMS ((symbolS *));
 
 
 extern void coff_add_linesym PARAMS ((symbolS *));
 
 
-void c_dot_file_symbol PARAMS ((char *filename));
+void c_dot_file_symbol PARAMS ((const char *filename));
 #define obj_app_file c_dot_file_symbol
 
 extern void coff_frob_symbol PARAMS ((symbolS *, int *));
 #define obj_app_file c_dot_file_symbol
 
 extern void coff_frob_symbol PARAMS ((symbolS *, int *));
index 767dc588c82968e0fa7a4140f6b645cba78931a9..7279445845340b18695438e9ab6df036fb001f70 100644 (file)
@@ -34,6 +34,7 @@
 static int ecoff_sec_sym_ok_for_reloc PARAMS ((asection *));
 static void obj_ecoff_frob_symbol PARAMS ((symbolS *, int *));
 static void ecoff_pop_insert PARAMS ((void));
 static int ecoff_sec_sym_ok_for_reloc PARAMS ((asection *));
 static void obj_ecoff_frob_symbol PARAMS ((symbolS *, int *));
 static void ecoff_pop_insert PARAMS ((void));
+static int ecoff_separate_stab_sections PARAMS ((void));
 
 /* These are the pseudo-ops we support in this file.  Only those
    relating to debugging information are supported here.
 
 /* These are the pseudo-ops we support in this file.  Only those
    relating to debugging information are supported here.
@@ -290,11 +291,22 @@ ecoff_pop_insert ()
   pop_insert (obj_pseudo_table);
 }
 
   pop_insert (obj_pseudo_table);
 }
 
+static int
+ecoff_separate_stab_sections ()
+{
+  return 0;
+}
+
 const struct format_ops ecoff_format_ops =
 {
   bfd_target_ecoff_flavour,
   0,   /* dfl_leading_underscore */
 const struct format_ops ecoff_format_ops =
 {
   bfd_target_ecoff_flavour,
   0,   /* dfl_leading_underscore */
+
+  /* FIXME: A comment why emit_section_symbols is different here (1) from
+     the single-format definition (0) would be in order.  */
   1,   /* emit_section_symbols */
   1,   /* emit_section_symbols */
+  0,   /* begin */
+  ecoff_new_file,
   obj_ecoff_frob_symbol,
   ecoff_frob_file,
   0,   /* frob_file_after_relocs */
   obj_ecoff_frob_symbol,
   ecoff_frob_file,
   0,   /* frob_file_after_relocs */
@@ -303,13 +315,19 @@ const struct format_ops ecoff_format_ops =
   0,   /* s_get_align */
   0,   /* s_set_align */
   0,   /* s_get_other */
   0,   /* s_get_align */
   0,   /* s_set_align */
   0,   /* s_get_other */
+  0,   /* s_set_other */
   0,   /* s_get_desc */
   0,   /* s_get_desc */
+  0,   /* s_set_desc */
+  0,   /* s_get_type */
+  0,   /* s_set_type */
   0,   /* copy_symbol_attributes */
   ecoff_generate_asm_lineno,
   ecoff_stab,
   0,   /* copy_symbol_attributes */
   ecoff_generate_asm_lineno,
   ecoff_stab,
+  ecoff_separate_stab_sections,
+  0,   /* init_stab_section */
   ecoff_sec_sym_ok_for_reloc,
   ecoff_pop_insert,
   ecoff_set_ext,
   ecoff_read_begin_hook,
   ecoff_sec_sym_ok_for_reloc,
   ecoff_pop_insert,
   ecoff_set_ext,
   ecoff_read_begin_hook,
-  ecoff_symbol_new_hook,
+  ecoff_symbol_new_hook
 };
 };
index ae82f72003b164450134b051d7402533e31ca873..3af8c9a8870a93ff48d93bb89398f5350de5d3e9 100644 (file)
@@ -54,9 +54,12 @@ static bfd_vma elf_s_get_size PARAMS ((symbolS *));
 static void elf_s_set_size PARAMS ((symbolS *, bfd_vma));
 static bfd_vma elf_s_get_align PARAMS ((symbolS *));
 static void elf_s_set_align PARAMS ((symbolS *, bfd_vma));
 static void elf_s_set_size PARAMS ((symbolS *, bfd_vma));
 static bfd_vma elf_s_get_align PARAMS ((symbolS *));
 static void elf_s_set_align PARAMS ((symbolS *, bfd_vma));
+static void elf_s_set_other PARAMS ((symbolS *, int));
 static void elf_copy_symbol_attributes PARAMS ((symbolS *, symbolS *));
 static int elf_sec_sym_ok_for_reloc PARAMS ((asection *));
 static void adjust_stab_sections PARAMS ((bfd *, asection *, PTR));
 static void elf_copy_symbol_attributes PARAMS ((symbolS *, symbolS *));
 static int elf_sec_sym_ok_for_reloc PARAMS ((asection *));
 static void adjust_stab_sections PARAMS ((bfd *, asection *, PTR));
+static int elf_separate_stab_sections PARAMS ((void));
+static void elf_init_stab_section PARAMS ((segT));
 
 #ifdef NEED_ECOFF_DEBUG
 static boolean elf_get_extr PARAMS ((asymbol *, EXTR *));
 
 #ifdef NEED_ECOFF_DEBUG
 static boolean elf_get_extr PARAMS ((asymbol *, EXTR *));
@@ -233,6 +236,14 @@ elf_s_get_other (sym)
   return elf_symbol (symbol_get_bfdsym (sym))->internal_elf_sym.st_other;
 }
 
   return elf_symbol (symbol_get_bfdsym (sym))->internal_elf_sym.st_other;
 }
 
+static void
+elf_s_set_other (sym, other)
+     symbolS *sym;
+     int other;
+{
+  S_SET_OTHER (sym, other);
+}
+
 static void
 elf_copy_symbol_attributes (dest, src)
      symbolS *dest, *src;
 static void
 elf_copy_symbol_attributes (dest, src)
      symbolS *dest, *src;
@@ -249,7 +260,7 @@ elf_sec_sym_ok_for_reloc (sec)
 
 void
 elf_file_symbol (s)
 
 void
 elf_file_symbol (s)
-     char *s;
+     const char *s;
 {
   symbolS *sym;
 
 {
   symbolS *sym;
 
@@ -1910,18 +1921,44 @@ sco_id ()
 
 #endif /* SCO_ELF */
 
 
 #endif /* SCO_ELF */
 
+static int
+elf_separate_stab_sections ()
+{
+#ifdef NEED_ECOFF_DEBUG
+  return (!ECOFF_DEBUGGING);
+#else
+  return 1;
+#endif
+}
+
+static void
+elf_init_stab_section (seg)
+     segT seg;
+{
+#ifdef NEED_ECOFF_DEBUG
+  if (!ECOFF_DEBUGGING)
+#endif
+    obj_elf_init_stab_section (seg);
+}
+
 const struct format_ops elf_format_ops =
 {
   bfd_target_elf_flavour,
   0,   /* dfl_leading_underscore */
   1,   /* emit_section_symbols */
 const struct format_ops elf_format_ops =
 {
   bfd_target_elf_flavour,
   0,   /* dfl_leading_underscore */
   1,   /* emit_section_symbols */
+  elf_begin,
+  elf_file_symbol,
   elf_frob_symbol,
   elf_frob_file,
   elf_frob_file_after_relocs,
   elf_s_get_size, elf_s_set_size,
   elf_s_get_align, elf_s_set_align,
   elf_s_get_other,
   elf_frob_symbol,
   elf_frob_file,
   elf_frob_file_after_relocs,
   elf_s_get_size, elf_s_set_size,
   elf_s_get_align, elf_s_set_align,
   elf_s_get_other,
+  elf_s_set_other,
   0,   /* s_get_desc */
   0,   /* s_get_desc */
+  0,   /* s_set_desc */
+  0,   /* s_get_type */
+  0,   /* s_set_type */
   elf_copy_symbol_attributes,
 #ifdef NEED_ECOFF_DEBUG
   ecoff_generate_asm_lineno,
   elf_copy_symbol_attributes,
 #ifdef NEED_ECOFF_DEBUG
   ecoff_generate_asm_lineno,
@@ -1930,6 +1967,8 @@ const struct format_ops elf_format_ops =
   0,   /* generate_asm_lineno */
   0,   /* process_stab */
 #endif
   0,   /* generate_asm_lineno */
   0,   /* process_stab */
 #endif
+  elf_separate_stab_sections,
+  elf_init_stab_section,
   elf_sec_sym_ok_for_reloc,
   elf_pop_insert,
 #ifdef NEED_ECOFF_DEBUG
   elf_sec_sym_ok_for_reloc,
   elf_pop_insert,
 #ifdef NEED_ECOFF_DEBUG
@@ -1938,5 +1977,5 @@ const struct format_ops elf_format_ops =
   0,   /* ecoff_set_ext */
 #endif
   elf_obj_read_begin_hook,
   0,   /* ecoff_set_ext */
 #endif
   elf_obj_read_begin_hook,
-  elf_obj_symbol_new_hook,
+  elf_obj_symbol_new_hook
 };
 };
index d6fd92ca131b5ee3f0934f669ad607a701efc2b7..743776521ac00145442d8edcf72597cbb92018c3 100644 (file)
@@ -6,7 +6,7 @@
 
    GAS is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    GAS is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 1, or (at your option)
+   the Free Software Foundation; either version 2, or (at your option)
    any later version.
 
    GAS is distributed in the hope that it will be useful,
    any later version.
 
    GAS is distributed in the hope that it will be useful,
@@ -28,6 +28,9 @@
 
 #define OBJ_ELF 1
 
 
 #define OBJ_ELF 1
 
+/* Note that all macros in this file should be wrapped in #ifndef, for
+   sake of obj-multi.h which includes this file.  */
+
 #ifndef OUTPUT_FLAVOR
 #define OUTPUT_FLAVOR bfd_target_elf_flavour
 #endif
 #ifndef OUTPUT_FLAVOR
 #define OUTPUT_FLAVOR bfd_target_elf_flavour
 #endif
@@ -88,7 +91,9 @@ struct elf_obj_sy
 #define TRUE  !FALSE
 #endif
 
 #define TRUE  !FALSE
 #endif
 
+#ifndef obj_begin
 #define obj_begin() elf_begin ()
 #define obj_begin() elf_begin ()
+#endif
 extern void elf_begin PARAMS ((void));
 
 /* should be conditional on address size! */
 extern void elf_begin PARAMS ((void));
 
 /* should be conditional on address size! */
@@ -133,8 +138,10 @@ extern void elf_frob_file PARAMS ((void));
 #endif
 extern void elf_frob_file_after_relocs PARAMS ((void));
 
 #endif
 extern void elf_frob_file_after_relocs PARAMS ((void));
 
+#ifndef obj_app_file
 #define obj_app_file elf_file_symbol
 #define obj_app_file elf_file_symbol
-extern void elf_file_symbol PARAMS ((char *));
+#endif
+extern void elf_file_symbol PARAMS ((const char *));
 
 extern void obj_elf_section_change_hook PARAMS ((void));
 
 
 extern void obj_elf_section_change_hook PARAMS ((void));
 
@@ -189,6 +196,12 @@ do                                                         \
 while (0)
 #endif
 
 while (0)
 #endif
 
+#ifndef SEPARATE_STAB_SECTIONS
+/* Avoid ifndef each separate macro setting by wrapping the whole of the
+   stab group on the assumption that whoever sets SEPARATE_STAB_SECTIONS
+   caters to ECOFF_DEBUGGING and the right setting of INIT_STAB_SECTIONS
+   and OBJ_PROCESS_STAB too, without needing the tweaks below.  */
+
 /* Stabs go in a separate section.  */
 #define SEPARATE_STAB_SECTIONS 1
 
 /* Stabs go in a separate section.  */
 #define SEPARATE_STAB_SECTIONS 1
 
@@ -214,6 +227,8 @@ extern void obj_elf_init_stab_section PARAMS ((segT));
     ecoff_stab ((seg), (what), (string), (type), (other), (desc))
 #endif /* ECOFF_DEBUGGING */
 
     ecoff_stab ((seg), (what), (string), (type), (other), (desc))
 #endif /* ECOFF_DEBUGGING */
 
+#endif /* SEPARATE_STAB_SECTIONS not defined. */
+
 extern void elf_frob_symbol PARAMS ((symbolS *, int *));
 #ifndef obj_frob_symbol
 #define obj_frob_symbol(symp, punt) elf_frob_symbol (symp, &punt)
 extern void elf_frob_symbol PARAMS ((symbolS *, int *));
 #ifndef obj_frob_symbol
 #define obj_frob_symbol(symp, punt) elf_frob_symbol (symp, &punt)
index 42b7eb33e3c4e62de2532ec5642b0911aebc9e35..3b80f3855e44e9a8ae5bdf906fd4d73f7c1d7c20 100644 (file)
@@ -6,7 +6,7 @@
 
    GAS is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    GAS is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 1, or (at your option)
+   the Free Software Foundation; either version 2, or (at your option)
    any later version.
 
    GAS is distributed in the hope that it will be useful,
    any later version.
 
    GAS is distributed in the hope that it will be useful,
 #define OUTPUT_FLAVOR                                  \
        (this_format->flavor)
 
 #define OUTPUT_FLAVOR                                  \
        (this_format->flavor)
 
+#define obj_begin()                                    \
+       (this_format->begin                             \
+        ? (*this_format->begin) ()                     \
+        : (void) 0)
+
+#define obj_app_file(NAME)                             \
+       (this_format->app_file                          \
+        ? (*this_format->app_file) (NAME)              \
+        : (void) 0)
+
 #define obj_frob_symbol(S,P)                           \
        (*this_format->frob_symbol) (S, &(P))
 
 #define obj_frob_symbol(S,P)                           \
        (*this_format->frob_symbol) (S, &(P))
 
 #define S_GET_SIZE                                     \
        (*this_format->s_get_size)
 
 #define S_GET_SIZE                                     \
        (*this_format->s_get_size)
 
-#define S_SET_SIZE                                     \
-       (*this_format->s_set_size)
+#define S_SET_SIZE(S, N)                               \
+       (this_format->s_set_size                        \
+        ? (*this_format->s_set_size) (S, N)            \
+        : (void) 0)
 
 #define S_GET_ALIGN                                    \
        (*this_format->s_get_align)
 
 
 #define S_GET_ALIGN                                    \
        (*this_format->s_get_align)
 
-#define S_SET_ALIGN                                    \
-       (*this_format->s_set_align)
+#define S_SET_ALIGN(S, N)                              \
+       (this_format->s_set_align                       \
+        ? (*this_format->s_set_align) (S, N)           \
+        : (void) 0)
 
 #define S_GET_OTHER                                    \
        (*this_format->s_get_other)
 
 
 #define S_GET_OTHER                                    \
        (*this_format->s_get_other)
 
+#define S_SET_OTHER(S, O)                              \
+       (this_format->s_set_other                       \
+        ? (*this_format->s_set_other) (S, O)           \
+        : (void) 0)
+
 #define S_GET_DESC                                     \
        (*this_format->s_get_desc)
 
 #define S_GET_DESC                                     \
        (*this_format->s_get_desc)
 
+#define S_SET_DESC(S, D)                               \
+       (this_format->s_set_desc                        \
+        ? (*this_format->s_set_desc) (S, D)            \
+        : (void) 0)
+
+#define S_GET_TYPE                                     \
+       (*this_format->s_get_desc)
+
+#define S_SET_TYPE(S, T)                               \
+       (this_format->s_set_type                        \
+        ? (*this_format->s_set_type) (S, T)            \
+        : (void) 0)
+
 #define OBJ_COPY_SYMBOL_ATTRIBUTES(d,s)                        \
        (this_format->copy_symbol_attributes            \
         ? (*this_format->copy_symbol_attributes) (d, s) \
 #define OBJ_COPY_SYMBOL_ATTRIBUTES(d,s)                        \
        (this_format->copy_symbol_attributes            \
         ? (*this_format->copy_symbol_attributes) (d, s) \
         ? (*this_format->process_stab) (SEG,W,S,T,O,D) \
         : (void) 0)
 
         ? (*this_format->process_stab) (SEG,W,S,T,O,D) \
         : (void) 0)
 
+#define SEPARATE_STAB_SECTIONS \
+       ((*this_format->separate_stab_sections) ())
+
+#define INIT_STAB_SECTION(S)                           \
+       (this_format->init_stab_section                 \
+        ? (*this_format->init_stab_section) (S)        \
+        : (void) 0)
+
+#define EMIT_SECTION_SYMBOLS (this_format->emit_section_symbols)
+
 #ifdef OBJ_MAYBE_ELF
 /* We need OBJ_SYMFIELD_TYPE so that symbol_get_obj is defined in symbol.c
    We also need various STAB defines for stab.c  */
 #include "obj-elf.h"
 #endif
 
 #ifdef OBJ_MAYBE_ELF
 /* We need OBJ_SYMFIELD_TYPE so that symbol_get_obj is defined in symbol.c
    We also need various STAB defines for stab.c  */
 #include "obj-elf.h"
 #endif
 
+#ifdef OBJ_MAYBE_AOUT
+/* We want aout_process_stab in stabs.c for the aout table.  Defining this
+   macro will have no other effect.  */
+#define AOUT_STABS
+#endif
+
 #endif /* !OBJ_HEADER */
 #endif /* _OBJ_MULTI_H */
 #endif /* !OBJ_HEADER */
 #endif /* _OBJ_MULTI_H */
index 7fe5551811d6d637dbc1948f69d8378666874597..71f35e81ee813b6b24970045f3ec170ae0ecff39 100644 (file)
--- a/gas/obj.h
+++ b/gas/obj.h
@@ -50,6 +50,8 @@ struct format_ops {
   int flavor;
   unsigned dfl_leading_underscore : 1;
   unsigned emit_section_symbols : 1;
   int flavor;
   unsigned dfl_leading_underscore : 1;
   unsigned emit_section_symbols : 1;
+  void (*begin) PARAMS ((void));
+  void (*app_file) PARAMS ((const char *));
   void (*frob_symbol) PARAMS ((symbolS *, int *));
   void (*frob_file) PARAMS ((void));
   void (*frob_file_after_relocs) PARAMS ((void));
   void (*frob_symbol) PARAMS ((symbolS *, int *));
   void (*frob_file) PARAMS ((void));
   void (*frob_file_after_relocs) PARAMS ((void));
@@ -58,10 +60,16 @@ struct format_ops {
   bfd_vma (*s_get_align) PARAMS ((symbolS *));
   void (*s_set_align) PARAMS ((symbolS *, bfd_vma));
   int (*s_get_other) PARAMS ((symbolS *));
   bfd_vma (*s_get_align) PARAMS ((symbolS *));
   void (*s_set_align) PARAMS ((symbolS *, bfd_vma));
   int (*s_get_other) PARAMS ((symbolS *));
+  void (*s_set_other) PARAMS ((symbolS *, int));
   int (*s_get_desc) PARAMS ((symbolS *));
   int (*s_get_desc) PARAMS ((symbolS *));
+  void (*s_set_desc) PARAMS ((symbolS *, int));
+  int (*s_get_type) PARAMS ((symbolS *));
+  void (*s_set_type) PARAMS ((symbolS *, int));
   void (*copy_symbol_attributes) PARAMS ((symbolS *, symbolS *));
   void (*generate_asm_lineno) PARAMS ((void));
   void (*process_stab) PARAMS ((segT, int, const char *, int, int, int));
   void (*copy_symbol_attributes) PARAMS ((symbolS *, symbolS *));
   void (*generate_asm_lineno) PARAMS ((void));
   void (*process_stab) PARAMS ((segT, int, const char *, int, int, int));
+  int (*separate_stab_sections) PARAMS ((void));
+  void (*init_stab_section) PARAMS ((segT));
   int (*sec_sym_ok_for_reloc) PARAMS ((asection *));
   void (*pop_insert) PARAMS ((void));
   /* For configurations using ECOFF_DEBUGGING, this callback is used.  */
   int (*sec_sym_ok_for_reloc) PARAMS ((asection *));
   void (*pop_insert) PARAMS ((void));
   /* For configurations using ECOFF_DEBUGGING, this callback is used.  */
This page took 0.039062 seconds and 4 git commands to generate.