A little portability patch for BFD

Michael Sokolov msokolov@ivan.Harhan.ORG
Mon Apr 17 10:55:00 GMT 2000


Hi there,

A small portability patch in BFD for K&R C compilers. While compiling under
4.3BSD for the m68k-elf target, I bumped into these two problems:

* concat_filename() in dwarf2.c concatenates two string literals in one place,
which the C preprocessor on 4.3BSD didn't like.

* ieee_get_symtab() in ieee.c initializes a struct with a union inside it in a
way that the K&R C compiler didn't like. As far as I can tell initializing that
last member isn't necessary at all and I took it out.

The patch is below. Is it OK?

--
Michael Sokolov		Harhan Engineering Laboratory
Public Service Agent	International Free Computing Task Force
			International Engineering and Science Task Force
			615 N GOOD LATIMER EXPY STE #4
			DALLAS TX 75204-5852 USA

Phone: +1-214-824-7693 (Harhan Eng Lab office)
E-mail: msokolov@ivan.Harhan.ORG (ARPA TCP/SMTP) (UUCP coming soon)

2000-04-17  Michael Sokolov  <msokolov@ivan.Harhan.ORG>

	* dwarf2.c (concat_filename): avoid string literal concatenation.

	* ieee.c (ieee_get_symtab): avoid union-in-a-struct initialization that
	K&R C compilers choke on.

Index: dwarf2.c
===================================================================
RCS file: /cvs/src/src/bfd/dwarf2.c,v
retrieving revision 1.13
diff -c -3 -p -r1.13 dwarf2.c
*** dwarf2.c	2000/04/07 18:36:04	1.13
--- dwarf2.c	2000/04/17 17:42:37
*************** concat_filename (table, file)
*** 700,707 ****
  
    if (file - 1 >= table->num_files)
      {
!       (*_bfd_error_handler) (_("Dwarf Error: mangled line number "
! 			       "section (bad file number)."));
        return "<unknown>";
      }
  
--- 700,706 ----
  
    if (file - 1 >= table->num_files)
      {
!       (*_bfd_error_handler) (_("Dwarf Error: mangled line number section (bad file number)."));
        return "<unknown>";
      }
  
Index: ieee.c
===================================================================
RCS file: /cvs/src/src/bfd/ieee.c,v
retrieving revision 1.7
diff -c -3 -p -r1.7 ieee.c
*** ieee.c	2000/03/11 23:09:42	1.7
--- ieee.c	2000/04/17 17:42:42
*************** ieee_get_symtab (abfd, location)
*** 1010,1016 ****
    static bfd dummy_bfd;
    static asymbol empty_symbol =
    /* the_bfd, name, value, attr, section */
!   {&dummy_bfd, " ieee empty", (symvalue) 0, BSF_DEBUGGING, bfd_abs_section_ptr, { 0 }};
  
    if (abfd->symcount)
      {
--- 1010,1016 ----
    static bfd dummy_bfd;
    static asymbol empty_symbol =
    /* the_bfd, name, value, attr, section */
!   {&dummy_bfd, " ieee empty", (symvalue) 0, BSF_DEBUGGING, bfd_abs_section_ptr};
  
    if (abfd->symcount)
      {


More information about the Binutils mailing list