This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

New members in struct format_ops in gas/obj.h used with multiformat targets


More members in struct format_ops are needed to make ELF and a.out play
nice together in a multi-object-format "emulation" target.  I made
corresponding adjustments to ECOFF and COFF, but not as my primary
concern.  If those targets did not play nice before, they might not play
nice now, although the testsuite says nothing changed.  A few related bugs
are fixed too.

I did this because I want to use the multiformat/emulations machinery for
the CRIS target.  I initially saw the "missing" members and other bugs as
breakages in the CRIS binutils testsuite when converting to the
table-driven obj-multi.h machinery.  These patches are target-independent,
however.  It seems this machinery has not been used more widely than the
initial testing or perhaps it has caught bitrot.

BTW, does anyone know why the term "emulations" is used, instead of
e.g. the IMHO more intuitive "multiformat"?  I thought emulations were
only a term of the linker.  I'll naively use multiformat here.

Before we get to the patches, I'll mention a few things from test-results
with and without these patches.  This is from CVS as of today 2000-05-21.
If you believe the tests are irrelevant, just skip this part (let me sell
you some fine Florida waterfront estate instead).  I should mention that
only tests needing no cross-compiler were run.  I ran these tests with the
patch to elf.exp in the gas testsuite, that I've previously submitted.


Tested with:

i386-unknown-elf (--enable-targets=all):
Note that the "primary" object format for a multiformat target must be
something else than a.out for i386 or it will not build at all.  It seems
to be due to the lack of multiformat support for i386-unknown-aout since
it's a non-BFD_ASSEMBLER target.

"make check".
No differences, no unexpected failures.

"env GNUTARGET=a.out-i386 AS_EMULATION=i386aout make check".
Slightly better with these patches: the ld test "check sections" now
assemble and run correctly (test 1 and 2).  ELF-specific tests break with
and without the patches of course, but then they are expected to.  Perhaps
the testsuite should be corrected to look at the current emulation, not
the configured target for which tests to run.  There are two testfailures
(with and without the patches) that look real: "i386 reloc" and "i386
white".  They complain about "cannot represent relocation type
BFD_RELOC_8", which seems unhealthy.

"env GNUTARGET=coff-i386 AS_EMULATION=i386coff make check"
Similar to the a.out test results.

Also tested with:

mipsel-linux-gnuecoff:  (Is that really a valid target?  There's
alpha*-*-linuxecoff* in gas/configure.in, but I dreamt this one up.)

"make check": No differences.  Note that there are 9 unexpected failures
with the gas tests with and without these patches.  To the untrained eye
they look like real problems.

"env GNUTARGET=elf32-bigmips AS_EMULATION=mipsbelf make check"
No differences with/without patches; similar results to the primary
results above but two less gas failures; instead an ld unexpected failure
with "check sections" (linker says there's endian difference, seems
unimportant).

In summary, nothing tangible except that the ld "check sections" test that
called NULL when assembled is now fixed.  Well, at least nothing obvious
broke.  I also ran native tests for i686-pc-linux-gnulibc1 (no
differences) to make sure I didn't go and break something big enough to
get lynched.

I somehow expected the bugs and omitted members to show up more clearly in
the testsuite.  I guess Someone should add some tests...  Sorry for not
doing it.  Building testcases for object formats and targets I don't know,
to specifically trap these field omissions and inconsistencies is not
within the amount of work I'm prepared to do right now.  I hope it's not a
prerequisite for patch acceptance.

Please advise of any further testing you think is needed.


Over to the patches.

As mentioned, they primarily add new members to struct format_ops and
usage in obj-multi.h, corresponding to differences in settings in a.out,
ELF, COFF, and ECOFF.  I added them on the assumption that they were left
out by oversight, not by design for some non-obvious reason, in which case
I think it should have been carefully described in the code (right).  Each
new field was added because not all of a.out, ECOFF, COFF and ELF have the
same definition or use any default value (well, at least I checked a.out
and ELF).  Hopefully I did not miss any; if so, it's an oversight, not a
conscious decision.

There are also a few other bugs fixed related to the use of the format_ops
tables and usage.  Perhaps they should be isolated into their own patch,
but since they touch the same area and files, I didn't.

- EMIT_SECTION_SYMBOLS was not defined in obj-multi.h although struct
  format_ops has an entry for it.  Note that there seems to be a bug with
  this in in obj-ecoff.c, because the table entry differs from the
  definition in obj-ecoff.h.  Since I don't know for sure and do not need
  ECOFF, I did not investigate.

- obj-aout.c had a zero entry for process_stab, but uses aout_process_stab
  in stabs.c normally, through AOUT_STABS in stabs.c.

- obj-aout.c had zero for sec_sym_ok_for_reloc, which contradicts obj-aout.h.

Random notes:

I'm not really a fan of the void-value-cast form for macro definitions for
void function pointers used in obj-multi.h:
 (vfp ? (*vfp)() : (void) 0)
I'd rather use:
 do { if (vfp) (*vfp)(); } while (0)
because having void-expressions in the arms of the ? : operator seems
brittle portabilitywise.  I kept the former since it was the existing
practice in that file (but not in other places, it seems).

I changed obj-multi.h to be GPLv2 too as with obj-elf.h in a previous
patch.  I also added NULL-tests to S_SET_ALIGN and S_SET_SIZE, since
S_SET_SIZE without the NULL test causes a segfault when generating a.out
objects.  This is the ld failure described above, the only failure spotted
with the testsuite.

Small comment in obj-elf.h seemed to be called for, about the necessity to
wrap macros ifndef, due to its inclusion from obj-multi.h.

I removed a spurious comma at the end of the initialization lists in
obj-*.c.  It's an ANSI feature of a compiler to accept a comma at the end
of an initialization list.

The use of S_SET_OTHER in elf_s_set_other might look strange but is
practice for the function definitions for elf_format_ops in obj-elf.c.
In contrast, having the actual expansion is practice in obj-aout.c.  One
is probably less bad than the other.  You either have the potential
recursion through obj-multi.h (not for real at the moment though) as with
obj-elf.c, or a redundant definition as with obj-aout.c.

To match the constness of the app_file member, I constipated the filename
argument of the app_file functions in obj-coff.c and obj-elf.c.  The ECOFF
app_file function already had constness.

Ok to commit?

gas/ChangeLog:
Sun May 21 14:25:16 2000  Hans-Peter Nilsson  <hp@axis.com>

	* 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.
	(AOUT_STABS) [OBJ_MAYBE_AOUT]: Define.

	* config/obj-elf.h: Mention that this file is included from
	obj-multi.h.

	* 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.c (c_dot_file_symbol): Constify argument.
	(coff_separate_stab_sections): New.
	(coff_separate_stab_sections): New.
	(coff_format_ops): Add new members.

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

	* 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.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.

Index: obj.h
===================================================================
RCS file: /cvs/src/src/gas/obj.h,v
retrieving revision 1.2
diff -p -c -r1.2 obj.h
*** obj.h	2000/01/26 22:48:31	1.2
--- obj.h	2000/05/21 12:19:41
*************** struct format_ops {
*** 50,55 ****
--- 50,57 ----
    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));
*************** struct format_ops {
*** 58,67 ****
--- 60,75 ----
    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 *));
+   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));
+   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.  */
Index: obj-aout.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-aout.c,v
retrieving revision 1.5
diff -p -c -r1.5 obj-aout.c
*** obj-aout.c	2000/01/26 22:48:31	1.5
--- obj-aout.c	2000/05/21 13:15:30
*************** DEFUN_VOID (s_sect)
*** 641,647 ****
--- 641,654 ----
  
  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 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 ()
*************** obj_aout_s_get_other (sym)
*** 656,661 ****
--- 663,695 ----
    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;
*************** obj_aout_s_get_desc (sym)
*** 663,674 ****
--- 697,740 ----
    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 */
+   0,	/* begin */
+   0,	/* app_file */
    obj_aout_frob_symbol,
    obj_aout_frob_file,
    0,	/* frob_file_after_relocs */
*************** const struct format_ops aout_format_ops 
*** 677,687 ****
    0,	/* s_get_align */
    0,	/* s_set_align */
    obj_aout_s_get_other,
    obj_aout_s_get_desc,
    0,	/* copy_symbol_attributes */
    0,	/* generate_asm_lineno */
!   0,	/* process_stab */
!   0,	/* sec_sym_ok_for_reloc */
    aout_pop_insert,
    0,	/* ecoff_set_ext */
    0,	/* read_begin_hook */
--- 743,759 ----
    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_set_desc,
+   obj_aout_s_get_type,
+   obj_aout_s_set_type,
    0,	/* copy_symbol_attributes */
    0,	/* generate_asm_lineno */
!   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 */
Index: config/obj-coff.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-coff.c,v
retrieving revision 1.23
diff -p -c -r1.23 obj-coff.c
*** obj-coff.c	2000/04/26 15:09:43	1.23
--- obj-coff.c	2000/05/21 12:19:55
*************** c_symbol_merge (debug, normal)
*** 346,352 ****
  
  void
  c_dot_file_symbol (filename)
!      char *filename;
  {
    symbolS *symbolP;
  
--- 346,352 ----
  
  void
  c_dot_file_symbol (filename)
!      const char *filename;
  {
    symbolS *symbolP;
  
*************** const pseudo_typeS coff_pseudo_table[] =
*** 4582,4587 ****
--- 4582,4588 ----
  /* 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 ()
*************** coff_pop_insert ()
*** 4589,4599 ****
--- 4590,4608 ----
    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 */
+   0,    /* begin */
+   c_dot_file_symbol,
    coff_frob_symbol,
    0,	/* frob_file */
    coff_frob_file_after_relocs,
*************** const struct format_ops coff_format_ops 
*** 4602,4611 ****
--- 4611,4626 ----
    0,	/* s_get_align */
    0,	/* s_set_align */
    0,	/* s_get_other */
+   0,	/* s_set_other */
    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 */
+   coff_separate_stab_sections,
+   obj_coff_init_stab_section,
    0,	/* sec_sym_ok_for_reloc */
    coff_pop_insert,
    0,	/* ecoff_set_ext */
Index: config/obj-coff.h
===================================================================
RCS file: /cvs/src/src/gas/config/obj-coff.h,v
retrieving revision 1.6
diff -p -c -r1.6 obj-coff.h
*** obj-coff.h	2000/02/24 19:46:27	1.6
--- obj-coff.h	2000/05/21 12:19:58
*************** extern int coff_n_line_nos;
*** 369,375 ****
  extern void coff_add_linesym PARAMS ((symbolS *));
  
  
! void c_dot_file_symbol PARAMS ((char *filename));
  #define obj_app_file c_dot_file_symbol
  
  extern void coff_frob_symbol PARAMS ((symbolS *, int *));
--- 369,375 ----
  extern void coff_add_linesym PARAMS ((symbolS *));
  
  
! 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 *));
Index: config/obj-ecoff.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-ecoff.c,v
retrieving revision 1.3
diff -p -c -r1.3 obj-ecoff.c
*** obj-ecoff.c	2000/01/26 22:48:31	1.3
--- obj-ecoff.c	2000/05/21 12:19:58
***************
*** 34,39 ****
--- 34,40 ----
  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.
*************** ecoff_pop_insert ()
*** 290,300 ****
--- 291,312 ----
    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 */
+ 
+   /* 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 */
+   0,	/* begin */
+   ecoff_new_file,
    obj_ecoff_frob_symbol,
    ecoff_frob_file,
    0,	/* frob_file_after_relocs */
*************** const struct format_ops ecoff_format_ops
*** 303,315 ****
    0,	/* s_get_align */
    0,	/* s_set_align */
    0,	/* s_get_other */
    0,	/* s_get_desc */
    0,	/* copy_symbol_attributes */
    ecoff_generate_asm_lineno,
    ecoff_stab,
    ecoff_sec_sym_ok_for_reloc,
    ecoff_pop_insert,
    ecoff_set_ext,
    ecoff_read_begin_hook,
!   ecoff_symbol_new_hook,
  };
--- 315,333 ----
    0,	/* s_get_align */
    0,	/* s_set_align */
    0,	/* s_get_other */
+   0,	/* s_set_other */
    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,
+   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_symbol_new_hook
  };
Index: config/obj-elf.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-elf.c,v
retrieving revision 1.16
diff -p -c -r1.16 obj-elf.c
*** obj-elf.c	2000/04/20 01:43:32	1.16
--- obj-elf.c	2000/05/21 12:20:01
*************** static bfd_vma elf_s_get_size PARAMS ((s
*** 54,62 ****
--- 54,65 ----
  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 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 *));
*************** elf_s_get_other (sym)
*** 234,239 ****
--- 237,250 ----
  }
  
  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;
  {
*************** elf_sec_sym_ok_for_reloc (sec)
*** 249,255 ****
  
  void
  elf_file_symbol (s)
!      char *s;
  {
    symbolS *sym;
  
--- 260,266 ----
  
  void
  elf_file_symbol (s)
!      const char *s;
  {
    symbolS *sym;
  
*************** sco_id ()
*** 1910,1927 ****
--- 1921,1964 ----
  
  #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 */
+   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_s_set_other,
    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,
*************** const struct format_ops elf_format_ops =
*** 1930,1935 ****
--- 1967,1974 ----
    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
*************** const struct format_ops elf_format_ops =
*** 1938,1942 ****
    0,	/* ecoff_set_ext */
  #endif
    elf_obj_read_begin_hook,
!   elf_obj_symbol_new_hook,
  };
--- 1977,1981 ----
    0,	/* ecoff_set_ext */
  #endif
    elf_obj_read_begin_hook,
!   elf_obj_symbol_new_hook
  };
Index: config/obj-elf.h
===================================================================
RCS file: /cvs/src/src/gas/config/obj-elf.h,v
retrieving revision 1.6
diff -p -c -r1.6 obj-elf.h
*** obj-elf.h	2000/05/02 00:12:51	1.6
--- obj-elf.h	2000/05/21 12:20:02
***************
*** 28,33 ****
--- 28,36 ----
  
  #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
Index: config/obj-multi.h
===================================================================
RCS file: /cvs/src/src/gas/config/obj-multi.h,v
retrieving revision 1.4
diff -p -c -r1.4 obj-multi.h
*** obj-multi.h	2000/01/26 22:48:31	1.4
--- obj-multi.h	2000/05/21 12:20:02
***************
*** 6,12 ****
  
     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)
     any later version.
  
     GAS is distributed in the hope that it will be useful,
--- 6,12 ----
  
     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 2, or (at your option)
     any later version.
  
     GAS is distributed in the hope that it will be useful,
***************
*** 32,37 ****
--- 32,47 ----
  #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))
  
***************
*** 69,89 ****
  #define S_GET_SIZE					\
  	(*this_format->s_get_size)
  
! #define S_SET_SIZE					\
! 	(*this_format->s_set_size)
  
  #define S_GET_ALIGN					\
  	(*this_format->s_get_align)
  
! #define S_SET_ALIGN					\
! 	(*this_format->s_set_align)
  
  #define S_GET_OTHER					\
  	(*this_format->s_get_other)
  
  #define S_GET_DESC					\
  	(*this_format->s_get_desc)
  
  #define OBJ_COPY_SYMBOL_ATTRIBUTES(d,s)			\
  	(this_format->copy_symbol_attributes		\
  	 ? (*this_format->copy_symbol_attributes) (d, s) \
--- 79,121 ----
  #define S_GET_SIZE					\
  	(*this_format->s_get_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_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_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_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) \
***************
*** 94,103 ****
--- 126,151 ----
  	 ? (*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_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 */

brgds, H-P

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]