* dwarf2.c: Formatting.
authorAlan Modra <amodra@gmail.com>
Tue, 2 May 2006 01:41:20 +0000 (01:41 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 2 May 2006 01:41:20 +0000 (01:41 +0000)
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Simplify
output section check.
* elf32-i370.c: Warning fixes inside #ifdef DEBUG.
* elf32-m32c.c: Similarly.
* elf32-ppc.c: Similarly.
* elf32-v850.c: Similarly.
* nlm32-sparc.c: Similarly.
* elfcode.h: Similarly.
(elf_symbol_flags): Delete.
* elflink.c (elf_link_input_bfd): Comment typo.

bfd/ChangeLog
bfd/dwarf2.c
bfd/elf-eh-frame.c
bfd/elf32-i370.c
bfd/elf32-m32c.c
bfd/elf32-ppc.c
bfd/elf32-v850.c
bfd/elfcode.h
bfd/elflink.c
bfd/nlm32-sparc.c

index dcfe7138af0c669fc21b2a5e82ca4231b00c9cfb..a25e15eddc3253cc4aa0576c8ce33e7b93fd871c 100644 (file)
@@ -1,3 +1,17 @@
+2006-05-02  Alan Modra  <amodra@bigpond.net.au>
+
+       * dwarf2.c: Formatting.
+       * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Simplify
+       output section check.
+       * elf32-i370.c: Warning fixes inside #ifdef DEBUG.
+       * elf32-m32c.c: Similarly.
+       * elf32-ppc.c: Similarly.
+       * elf32-v850.c: Similarly.
+       * nlm32-sparc.c: Similarly.
+       * elfcode.h: Similarly.
+       (elf_symbol_flags): Delete.
+       * elflink.c (elf_link_input_bfd): Comment typo.
+
 2006-05-01  DJ Delorie  <dj@redhat.com>
 
        * bfd-in.h (bfd_hash_table): Add count field.
index ae68d1886818f0bdc5ac0df6a9e691719d1706ca..ea4ece48330f11e88cabb4c5131dd8fd783617b3 100644 (file)
@@ -1625,7 +1625,7 @@ read_rangelist (struct comp_unit *unit, struct arange *arange, bfd_uint64_t offs
       if (low_pc == -1UL && high_pc != -1UL)
        base_address = high_pc;
       else
-         arange_add (unit->abfd, arange, base_address + low_pc, base_address + high_pc);
+       arange_add (unit->abfd, arange, base_address + low_pc, base_address + high_pc);
     }
 }
 
index ab0b995c0c238f485907b84bd331822cb284c420..4f9ed4a99a9f12a1496e84038978a183fbde66a2 100644 (file)
@@ -390,8 +390,7 @@ _bfd_elf_discard_section_eh_frame
       return FALSE;
     }
 
-  if ((sec->output_section != NULL
-       && bfd_is_abs_section (sec->output_section)))
+  if (bfd_is_abs_section (sec->output_section))
     {
       /* At least one of the sections is being discarded from the
         link, so we should just ignore them.  */
index d9e6fbf52806df2a726923050a4a6c2bf9477e0c..218aa23a68fb98af3aae5708d63a1fd2d6242700 100644 (file)
@@ -1,6 +1,6 @@
 /* i370-specific support for 32-bit ELF
-   Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005
-   Free Software Foundation, Inc.
+   Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004,
+   2005, 2006 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
    Hacked by Linas Vepstas for i370 linas@linas.org
 
@@ -567,7 +567,7 @@ i370_elf_adjust_dynindx (struct elf_link_hash_entry *h, void * cparg)
 
 #ifdef DEBUG
   fprintf (stderr,
-          "i370_elf_adjust_dynindx called, h->dynindx = %d, *cp = %d\n",
+          "i370_elf_adjust_dynindx called, h->dynindx = %ld, *cp = %d\n",
           h->dynindx, *cp);
 #endif
 
@@ -1296,7 +1296,7 @@ i370_elf_relocate_section (bfd *output_bfd,
 #ifdef DEBUG
                          if (indx <= 0)
                            {
-                             printf ("indx=%d section=%s flags=%08x name=%s\n",
+                             printf ("indx=%ld section=%s flags=%08x name=%s\n",
                                      indx, osec->name, osec->flags,
                                      h->root.root.string);
                            }
index 5e9f3ab28a2150c960d1d441dda90a97464f93ff..43204615e3bc991552c401c7dc158780a9a38b1d 100644 (file)
@@ -40,7 +40,8 @@ static bfd_boolean m32c_elf_check_relocs
   (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
 static bfd_boolean m32c_elf_relax_delete_bytes (bfd *, asection *, bfd_vma, int);
 #ifdef DEBUG
-static char * m32c_get_reloc (long reloc);
+char * m32c_get_reloc (long reloc);
+void dump_symtab (bfd *, void *, void *);
 #endif
 static bfd_boolean m32c_elf_relax_section
 (bfd *abfd, asection *sec, struct bfd_link_info *link_info, bfd_boolean *again);
@@ -936,7 +937,7 @@ m32c_elf_object_p (bfd *abfd)
  \f
 
 #ifdef DEBUG
-static void
+void
 dump_symtab (bfd * abfd, void *internal_syms, void *external_syms)
 {
   size_t locsymcount;
@@ -977,7 +978,6 @@ dump_symtab (bfd * abfd, void *internal_syms, void *external_syms)
        {
        case STT_FUNC: st_info_str = "STT_FUNC";
        case STT_SECTION: st_info_str = "STT_SECTION";
-       case STT_SRELC: st_info_str = "STT_SRELC";
        case STT_FILE: st_info_str = "STT_FILE";
        case STT_OBJECT: st_info_str = "STT_OBJECT";
        case STT_TLS: st_info_str = "STT_TLS";
@@ -1022,7 +1022,7 @@ dump_symtab (bfd * abfd, void *internal_syms, void *external_syms)
     free (external_syms);
 }
 
-static char *
+char *
 m32c_get_reloc (long reloc)
 {
   if (0 <= reloc && reloc < R_M32C_max)
index 6a2d5170d78d5a9b94a236ac7ff8a4cbb945879c..9ee2bcd85732df67164460f44f87a046d4b17496 100644 (file)
@@ -6293,7 +6293,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
                          BFD_ASSERT (indx > 0);
 #ifdef DEBUG
                          if (indx <= 0)
-                           printf ("indx=%d section=%s flags=%08x name=%s\n",
+                           printf ("indx=%ld section=%s flags=%08x name=%s\n",
                                    indx, osec->name, osec->flags,
                                    h->root.root.string);
 #endif
index e2c29ee192204ab839b211458332b780e4d57ab5..e3f1240bf580255ad7103aa4a3ba896717986981 100644 (file)
@@ -1,6 +1,6 @@
 /* V850-specific support for 32-bit ELF
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-   Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+   2006 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -33,6 +33,8 @@
 /* Sign-extend a 24-bit number.  */
 #define SEXT24(x)      ((((x) & 0xffffff) ^ 0x800000) - 0x800000)
 
+static reloc_howto_type v850_elf_howto_table[];
+
 /* Look through the relocs for a section during the first phase, and
    allocate space in the global offset table or procedure linkage
    table.  */
index 9bb66e11c0cf8f329708420da1909319bb025947..5a54fc2105bb01082b96f9f097f48912d944c6d0 100644 (file)
@@ -1,6 +1,6 @@
 /* ELF executable support for BFD.
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
    Written by Fred Fish @ Cygnus Support, from information published
    in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -139,10 +139,11 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
 #define LOG_FILE_ALIGN 2
 #endif
 
-#ifdef DEBUG
+#if DEBUG & 2
 static void elf_debug_section (int, Elf_Internal_Shdr *);
+#endif
+#if DEBUG & 1
 static void elf_debug_file (Elf_Internal_Ehdr *);
-static char *elf_symbol_flags (flagword);
 #endif
 \f
 /* Structure swapping routines */
@@ -545,7 +546,7 @@ elf_object_p (bfd *abfd)
   if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_type == ET_REL)
     goto got_wrong_format_error;
 
-  /* As a simple sanity check, verify that the what BFD thinks is the
+  /* As a simple sanity check, verify that what BFD thinks is the
      size of each section header table entry actually matches the size
      recorded in the file, but only if there are any sections.  */
   if (i_ehdrp->e_shentsize != sizeof (x_shdr) && i_ehdrp->e_shnum != 0)
@@ -1450,7 +1451,7 @@ elf_slurp_reloc_table (bfd *abfd,
   return TRUE;
 }
 
-#ifdef DEBUG
+#if DEBUG & 2
 static void
 elf_debug_section (int num, Elf_Internal_Shdr *hdr)
 {
@@ -1476,7 +1477,9 @@ elf_debug_section (int num, Elf_Internal_Shdr *hdr)
           (long) hdr->sh_entsize);
   fflush (stderr);
 }
+#endif
 
+#if DEBUG & 1
 static void
 elf_debug_file (Elf_Internal_Ehdr *ehdrp)
 {
@@ -1488,77 +1491,6 @@ elf_debug_file (Elf_Internal_Ehdr *ehdrp)
   fprintf (stderr, "e_shnum      = %ld\n", (long) ehdrp->e_shnum);
   fprintf (stderr, "e_shentsize  = %ld\n", (long) ehdrp->e_shentsize);
 }
-
-static char *
-elf_symbol_flags (flagword flags)
-{
-  static char buffer[1024];
-
-  buffer[0] = '\0';
-  if (flags & BSF_LOCAL)
-    strcat (buffer, " local");
-
-  if (flags & BSF_GLOBAL)
-    strcat (buffer, " global");
-
-  if (flags & BSF_DEBUGGING)
-    strcat (buffer, " debug");
-
-  if (flags & BSF_FUNCTION)
-    strcat (buffer, " function");
-
-  if (flags & BSF_KEEP)
-    strcat (buffer, " keep");
-
-  if (flags & BSF_KEEP_G)
-    strcat (buffer, " keep_g");
-
-  if (flags & BSF_WEAK)
-    strcat (buffer, " weak");
-
-  if (flags & BSF_SECTION_SYM)
-    strcat (buffer, " section-sym");
-
-  if (flags & BSF_OLD_COMMON)
-    strcat (buffer, " old-common");
-
-  if (flags & BSF_NOT_AT_END)
-    strcat (buffer, " not-at-end");
-
-  if (flags & BSF_CONSTRUCTOR)
-    strcat (buffer, " constructor");
-
-  if (flags & BSF_WARNING)
-    strcat (buffer, " warning");
-
-  if (flags & BSF_INDIRECT)
-    strcat (buffer, " indirect");
-
-  if (flags & BSF_FILE)
-    strcat (buffer, " file");
-
-  if (flags & DYNAMIC)
-    strcat (buffer, " dynamic");
-
-  if (flags & ~(BSF_LOCAL
-               | BSF_GLOBAL
-               | BSF_DEBUGGING
-               | BSF_FUNCTION
-               | BSF_KEEP
-               | BSF_KEEP_G
-               | BSF_WEAK
-               | BSF_SECTION_SYM
-               | BSF_OLD_COMMON
-               | BSF_NOT_AT_END
-               | BSF_CONSTRUCTOR
-               | BSF_WARNING
-               | BSF_INDIRECT
-               | BSF_FILE
-               | BSF_DYNAMIC))
-    strcat (buffer, " unknown-bits");
-
-  return buffer;
-}
 #endif
 \f
 /* Create a new BFD as if by bfd_openr.  Rather than opening a file,
index 0900220dbcac5b1b14ef11c6367cb0b5d0a62cdb..984e8282b8f6be3fd58fd705b6f56cc4aea33a1f 100644 (file)
@@ -7250,7 +7250,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
                      /* This is a reloc for a deleted entry or somesuch.
                         Turn it into an R_*_NONE reloc, at the same
                         offset as the last reloc.  elf_eh_frame.c and
-                        elf_bfd_discard_info rely on reloc offsets
+                        bfd_elf_discard_info rely on reloc offsets
                         being ordered.  */
                      irela->r_offset = last_offset;
                      irela->r_info = 0;
index e647ad082aa579f9da3c2f5bdd3d3363d2c23b03..701a6d81c1cd2b8846143d3dbf698e8ced2812f2 100644 (file)
@@ -1,5 +1,5 @@
 /* Support for 32-bit SPARC NLM (NetWare Loadable Module)
-   Copyright 1993, 1994, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright 1993, 1994, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -123,8 +123,9 @@ nlm_sparc_read_reloc (bfd *abfd,
       }
 
 #ifdef DEBUG
-  fprintf (stderr, "%s:  address = %08lx, addend = %08lx, type = %d, howto = %08lx\n",
-          __FUNCTION__, rel->address, rel->addend, type, rel->howto);
+  fprintf (stderr, "%s:  address = %08lx, addend = %08lx, type = %u, howto = %p\n",
+          __FUNCTION__, (unsigned long) rel->address,
+          (unsigned long) rel->addend, type, rel->howto);
 #endif
   return TRUE;
 
@@ -176,8 +177,9 @@ nlm_sparc_write_reloc (bfd * abfd, asection * sec, arelent * rel)
   val = bfd_get_section_vma (abfd, sec) + rel->address;
 
 #ifdef DEBUG
-  fprintf (stderr, "%s:  val = %08lx, addend = %08lx, type = %d\n",
-          __FUNCTION__, val, rel->addend, rel->howto->type);
+  fprintf (stderr, "%s:  val = %08lx, addend = %08lx, type = %u\n",
+          __FUNCTION__, (unsigned long) val, (unsigned long) rel->addend,
+          rel->howto->type);
 #endif
   bfd_put_32 (abfd, val, tmp_reloc.offset);
   bfd_put_32 (abfd, rel->addend, tmp_reloc.addend);
@@ -280,8 +282,8 @@ nlm_sparc_write_import (bfd * abfd, asection * sec, arelent * rel)
     base = 0;
 
 #ifdef DEBUG
-  fprintf (stderr, "%s:  <%x, 1>\n\t",
-          __FUNCTION__, base + (*rel->sym_ptr_ptr)->value);
+  fprintf (stderr, "%s:  <%lx, 1>\n\t",
+          __FUNCTION__, (unsigned long) (base + (*rel->sym_ptr_ptr)->value));
 #endif
   bfd_put_32 (abfd, base + (*rel->sym_ptr_ptr)->value, temp);
   if (bfd_bwrite (temp, (bfd_size_type) 4, abfd) != 4)
@@ -330,8 +332,8 @@ nlm_sparc_write_export (bfd * abfd, asymbol * sym, bfd_vma value)
   bfd_byte temp[4];
 
 #ifdef DEBUG
-  fprintf (stderr, "%s: <%x, %d, %s>\n",
-          __FUNCTION__, value, strlen (sym->name), sym->name);
+  fprintf (stderr, "%s: <%lx, %u, %s>\n",
+          __FUNCTION__, (unsigned long) value, strlen (sym->name), sym->name);
 #endif
   bfd_put_32 (abfd, value, temp);
   len = strlen (sym->name);
This page took 0.036469 seconds and 4 git commands to generate.