This is the mail archive of the binutils@sources.redhat.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]

[patch] to bfd: K&R C fix


Hi there,

bfd/elf.c fails to compile on 4.3BSD because automatic array debug_sec_names in
function _bfd_elf_make_section_from_shdr is initialised, and K&R C does not
allow automatic aggregate initialisation. However, the debug_sec_names array is
constant, so making it static both fixes the problem and makes it more
efficient. The patch is below.

--
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-09-10  Michael Sokolov  <msokolov@ivan.Harhan.ORG>

	* elf.c (_bfd_elf_make_section_from_shdr): Make debug_sec_names static.

Index: elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.51
diff -c -r1.51 elf.c
*** elf.c	2000/09/07 20:20:05	1.51
--- elf.c	2000/09/11 03:36:07
***************
*** 384,390 ****
    /* The debugging sections appear to be recognized only by name, not
       any sort of flag.  */
    {
!     const char *debug_sec_names [] =
      {
        ".debug",
        ".gnu.linkonce.wi.",
--- 384,390 ----
    /* The debugging sections appear to be recognized only by name, not
       any sort of flag.  */
    {
!     static const char *debug_sec_names [] =
      {
        ".debug",
        ".gnu.linkonce.wi.",

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