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]

ifndef wrapping of macros in obj-elf.h soon to be defined in obj-multi.h


In preparation for adding a few fields to struct format_ops, to be used in
obj-multi.h; needed for correct operation as might be obvious by the
patches below.  Multi-obj with a.out was apparently broken, but within
repair.  I broke this out as a bite-size chunk.

These #ifndefs are needed because if OBJ_MAYBE_ELF, then obj-elf.h will be
included, and it has to be a very well-behaved citizen and not define
anything ELF-specific that obj-multi.h may have defined.
 The bulk ifndef of SEPARATE_STAB_SECTIONS, INIT_STAB_SECTION,
OBJ_PROCESS_STAB is because of the ifdef ECOFF_DEBUGGING tweaks going on
in that piece of code.  Trying to ifndef each would IMHO lead to less
readable code.

I took the liberty to update to GPL v2, since I believe that is something
that is wanted: <URL:http://gcc.gnu.org/ml/gcc/2000-05/msg00019.html>.
This file was just a random spotting by that magic emacs hook; there
might be others.

Ok to install?

Sat May 20 16:41:55 2000  Hans-Peter Nilsson  <hp@axis.com>

	* config/obj-elf.h: Update GPL notice to v2.
	(obj_begin): Wrap definition in ifndef.
	(obj_app_file): Ditto.
	(SEPARATE_STAB_SECTIONS, INIT_STAB_SECTION, OBJ_PROCESS_STAB):
	Wrap in ifndef SEPARATE_STAB_SECTIONS.

Index: 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/20 14:58:34
***************
*** 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,
*************** struct elf_obj_sy
*** 88,94 ****
--- 88,96 ----
  #define TRUE  !FALSE
  #endif
  
+ #ifndef obj_begin
  #define obj_begin() elf_begin ()
+ #endif
  extern void elf_begin PARAMS ((void));
  
  /* should be conditional on address size! */
*************** extern void elf_frob_file PARAMS ((void)
*** 133,140 ****
  #endif
  extern void elf_frob_file_after_relocs PARAMS ((void));
  
  #define obj_app_file elf_file_symbol
! extern void elf_file_symbol PARAMS ((char *));
  
  extern void obj_elf_section_change_hook PARAMS ((void));
  
--- 135,144 ----
  #endif
  extern void elf_frob_file_after_relocs PARAMS ((void));
  
+ #ifndef obj_app_file
  #define obj_app_file elf_file_symbol
! #endif
! extern void elf_file_symbol PARAMS ((const char *));
  
  extern void obj_elf_section_change_hook PARAMS ((void));
  
*************** do								\
*** 189,194 ****
--- 193,204 ----
  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
  
*************** extern void obj_elf_init_stab_section PA
*** 213,218 ****
--- 223,230 ----
    if (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

brgds, H-P

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