public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* bfd nits
@ 2006-05-02  1:41 Alan Modra
  2006-05-02  9:55 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Modra @ 2006-05-02  1:41 UTC (permalink / raw)
  To: binutils

Fixes for assorted nits, most found when trying to build with -DDEBUG at
the top level to enable gas assertions.  An --enable-targets=all build
still won't work with -DDEBUG, because bfd/elf32-sh-symbian.c
unconditionally does "#define DEBUG 0" and opcodes/frv-opc.c has a line
    { { MNEM, OP (PACK), ' ', OP (DEBUG), 0 } },
with DEBUG being token pasted to form FRV_OPERAND_DEBUG.  Anyone care
enough to fix it?

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

Index: bfd/dwarf2.c
===================================================================
RCS file: /cvs/src/src/bfd/dwarf2.c,v
retrieving revision 1.87
diff -u -p -r1.87 dwarf2.c
--- bfd/dwarf2.c	11 Mar 2006 15:01:18 -0000	1.87
+++ bfd/dwarf2.c	2 May 2006 00:27:29 -0000
@@ -1625,7 +1625,7 @@ read_rangelist (struct comp_unit *unit, 
       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: bfd/elf-eh-frame.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-eh-frame.c,v
retrieving revision 1.48
diff -u -p -r1.48 elf-eh-frame.c
--- bfd/elf-eh-frame.c	27 Feb 2006 23:07:05 -0000	1.48
+++ bfd/elf-eh-frame.c	2 May 2006 00:27:29 -0000
@@ -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: bfd/elf32-i370.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i370.c,v
retrieving revision 1.51
diff -u -p -r1.51 elf32-i370.c
--- bfd/elf32-i370.c	24 Oct 2005 11:18:03 -0000	1.51
+++ bfd/elf32-i370.c	2 May 2006 00:27:29 -0000
@@ -567,7 +567,7 @@ i370_elf_adjust_dynindx (struct elf_link
 
 #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_b
 #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: bfd/elf32-m32c.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m32c.c,v
retrieving revision 1.6
diff -u -p -r1.6 elf32-m32c.c
--- bfd/elf32-m32c.c	7 Apr 2006 01:08:34 -0000	1.6
+++ bfd/elf32-m32c.c	2 May 2006 00:27:30 -0000
@@ -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_
 	{
 	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_
     free (external_syms);
 }
 
-static char *
+char *
 m32c_get_reloc (long reloc)
 {
   if (0 <= reloc && reloc < R_M32C_max)
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.196
diff -u -p -r1.196 elf32-ppc.c
--- bfd/elf32-ppc.c	17 Mar 2006 06:44:37 -0000	1.196
+++ bfd/elf32-ppc.c	2 May 2006 00:27:34 -0000
@@ -6293,7 +6293,7 @@ ppc_elf_relocate_section (bfd *output_bf
 			  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: bfd/elf32-v850.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-v850.c,v
retrieving revision 1.61
diff -u -p -r1.61 elf32-v850.c
--- bfd/elf32-v850.c	8 Jul 2005 00:26:45 -0000	1.61
+++ bfd/elf32-v850.c	2 May 2006 00:27:36 -0000
@@ -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: bfd/elfcode.h
===================================================================
RCS file: /cvs/src/src/bfd/elfcode.h,v
retrieving revision 1.74
diff -u -p -r1.74 elfcode.h
--- bfd/elfcode.h	18 Apr 2006 09:41:36 -0000	1.74
+++ bfd/elfcode.h	2 May 2006 00:27:37 -0000
@@ -139,10 +139,11 @@ Foundation, Inc., 51 Franklin Street - F
 #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
 	   (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: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.210
diff -u -p -r1.210 elflink.c
--- bfd/elflink.c	5 Apr 2006 13:37:32 -0000	1.210
+++ bfd/elflink.c	2 May 2006 00:27:42 -0000
@@ -7250,7 +7250,7 @@ elf_link_input_bfd (struct elf_final_lin
 		      /* 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: bfd/nlm32-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/nlm32-sparc.c,v
retrieving revision 1.15
diff -u -p -r1.15 nlm32-sparc.c
--- bfd/nlm32-sparc.c	4 May 2005 15:53:36 -0000	1.15
+++ bfd/nlm32-sparc.c	2 May 2006 00:27:42 -0000
@@ -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, asect
   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, asec
     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, asym
   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);

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: bfd nits
  2006-05-02  1:41 bfd nits Alan Modra
@ 2006-05-02  9:55 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2006-05-02  9:55 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

Hi Alan,

> Fixes for assorted nits, most found when trying to build with -DDEBUG at
> the top level to enable gas assertions.  An --enable-targets=all build
> still won't work with -DDEBUG, because bfd/elf32-sh-symbian.c
> unconditionally does "#define DEBUG 0" 

Well this one is my fault, so I am checking in the attached patch to fix 
it.  Tested by building an sh-symbianelf targeted toolchain.

Cheers
   Nick

bfd/ChangeLog
2006-05-02  Nick Clifton  <nickc@redhat.com>

	* elf32-sh-symbian.c: Rename local define DEBUG to SYMBIAN_DEBUG
	in order to avoid conflicts with the global DEBUG define.


[-- Attachment #2: elf32-sh-symbian.c.patch --]
[-- Type: text/x-patch, Size: 12621 bytes --]

Index: bfd/elf32-sh-symbian.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sh-symbian.c,v
retrieving revision 1.9
diff -c -3 -p -r1.9 elf32-sh-symbian.c
*** bfd/elf32-sh-symbian.c	4 May 2005 15:53:19 -0000	1.9
--- bfd/elf32-sh-symbian.c	2 May 2006 09:52:24 -0000
***************
*** 26,33 ****
  #include "elf32-sh.c"
  
  
! //#define DEBUG 1
! #define DEBUG 0
  
  #define DIRECTIVE_HEADER	"#<SYMEDIT>#\n"
  #define DIRECTIVE_IMPORT	"IMPORT "
--- 26,33 ----
  #include "elf32-sh.c"
  
  
! //#define SYMBIAN_DEBUG 1
! #define SYMBIAN_DEBUG 0
  
  #define DIRECTIVE_HEADER	"#<SYMEDIT>#\n"
  #define DIRECTIVE_IMPORT	"IMPORT "
***************
*** 36,42 ****
  
  /* Macro to advance 's' until either it reaches 'e' or the
     character pointed to by 's' is equal to 'c'.  If 'e' is
!    reached and DEBUG is enabled then the error message 'm'
     is displayed.  */
  #define SKIP_UNTIL(s,e,c,m)					\
    do								\
--- 36,42 ----
  
  /* Macro to advance 's' until either it reaches 'e' or the
     character pointed to by 's' is equal to 'c'.  If 'e' is
!    reached and SYMBIAN_DEBUG is enabled then the error message 'm'
     is displayed.  */
  #define SKIP_UNTIL(s,e,c,m)					\
    do								\
***************
*** 45,51 ****
  	++ s;							\
        if (s >= e)						\
  	{							\
!           if (DEBUG)						\
  	    fprintf (stderr, "Corrupt directive: %s\n", m);	\
  	  result = FALSE;					\
  	}							\
--- 45,51 ----
  	++ s;							\
        if (s >= e)						\
  	{							\
!           if (SYMBIAN_DEBUG)					\
  	    fprintf (stderr, "Corrupt directive: %s\n", m);	\
  	  result = FALSE;					\
  	}							\
***************
*** 63,69 ****
  	++ s;							\
        if (s >= e)						\
  	{							\
!           if (DEBUG)						\
  	    fprintf (stderr, "Corrupt directive: %s\n", m);	\
  	  result = FALSE;					\
  	}							\
--- 63,69 ----
  	++ s;							\
        if (s >= e)						\
  	{							\
!           if (SYMBIAN_DEBUG)					\
  	    fprintf (stderr, "Corrupt directive: %s\n", m);	\
  	  result = FALSE;					\
  	}							\
***************
*** 74,80 ****
  
  /* Macro to advance 's' until either it reaches 'e' or the
     character pointed to by 's' is not equal to 'c'.  If 'e'
!    is reached and DEBUG is enabled then the error message
     'm' is displayed.  */
  #define SKIP_WHILE(s,e,c,m)					\
    do								\
--- 74,80 ----
  
  /* Macro to advance 's' until either it reaches 'e' or the
     character pointed to by 's' is not equal to 'c'.  If 'e'
!    is reached and SYMBIAN_DEBUG is enabled then the error message
     'm' is displayed.  */
  #define SKIP_WHILE(s,e,c,m)					\
    do								\
***************
*** 83,89 ****
  	++ s;							\
        if (s >= e)						\
  	{							\
!           if (DEBUG)						\
  	    fprintf (stderr, "Corrupt directive: %s\n", m);	\
  	  result = FALSE;					\
  	}							\
--- 83,89 ----
  	++ s;							\
        if (s >= e)						\
  	{							\
!           if (SYMBIAN_DEBUG)					\
  	    fprintf (stderr, "Corrupt directive: %s\n", m);	\
  	  result = FALSE;					\
  	}							\
*************** sh_symbian_import_as (struct bfd_link_in
*** 114,120 ****
    struct elf_link_hash_entry * new_hash;
    symbol_rename * node;
  
!   if (DEBUG)
      fprintf (stderr, "IMPORT '%s' AS '%s'\n", current_name, new_name);
  
    for (node = rename_list; node; node = node->next)
--- 114,120 ----
    struct elf_link_hash_entry * new_hash;
    symbol_rename * node;
  
!   if (SYMBIAN_DEBUG)
      fprintf (stderr, "IMPORT '%s' AS '%s'\n", current_name, new_name);
  
    for (node = rename_list; node; node = node->next)
*************** sh_symbian_import_as (struct bfd_link_in
*** 132,145 ****
  
    if ((node = bfd_malloc (sizeof * node)) == NULL)
      {
!       if (DEBUG)
  	fprintf (stderr, "IMPORT AS: No mem for new rename node\n");
        return FALSE;
      }
  
    if ((node->current_name = bfd_malloc (strlen (current_name) + 1)) == NULL)
      {
!       if (DEBUG)
  	fprintf (stderr, "IMPORT AS: No mem for current name field in rename node\n");
        free (node);
        return FALSE;
--- 132,145 ----
  
    if ((node = bfd_malloc (sizeof * node)) == NULL)
      {
!       if (SYMBIAN_DEBUG)
  	fprintf (stderr, "IMPORT AS: No mem for new rename node\n");
        return FALSE;
      }
  
    if ((node->current_name = bfd_malloc (strlen (current_name) + 1)) == NULL)
      {
!       if (SYMBIAN_DEBUG)
  	fprintf (stderr, "IMPORT AS: No mem for current name field in rename node\n");
        free (node);
        return FALSE;
*************** sh_symbian_import_as (struct bfd_link_in
*** 149,155 ****
    
    if ((node->new_name = bfd_malloc (strlen (new_name) + 1)) == NULL)
      {
!       if (DEBUG)
  	fprintf (stderr, "IMPORT AS: No mem for new name field in rename node\n");
        free (node->current_name);
        free (node);
--- 149,155 ----
    
    if ((node->new_name = bfd_malloc (strlen (new_name) + 1)) == NULL)
      {
!       if (SYMBIAN_DEBUG)
  	fprintf (stderr, "IMPORT AS: No mem for new name field in rename node\n");
        free (node->current_name);
        free (node);
*************** sh_symbian_import_as (struct bfd_link_in
*** 175,181 ****
  static bfd_boolean
  sh_symbian_import (bfd * abfd ATTRIBUTE_UNUSED, char * name)
  {
!   if (DEBUG)
      fprintf (stderr, "IMPORT '%s'\n", name);
  
    /* XXX: Generate an import somehow ?  */
--- 175,181 ----
  static bfd_boolean
  sh_symbian_import (bfd * abfd ATTRIBUTE_UNUSED, char * name)
  {
!   if (SYMBIAN_DEBUG)
      fprintf (stderr, "IMPORT '%s'\n", name);
  
    /* XXX: Generate an import somehow ?  */
*************** sh_symbian_import (bfd * abfd ATTRIBUTE_
*** 186,192 ****
  static bfd_boolean
  sh_symbian_export (bfd * abfd ATTRIBUTE_UNUSED, char * name)
  {
!   if (DEBUG)
      fprintf (stderr, "EXPORT '%s'\n", name);
  
    /* XXX: Generate an export somehow ?  */
--- 186,192 ----
  static bfd_boolean
  sh_symbian_export (bfd * abfd ATTRIBUTE_UNUSED, char * name)
  {
!   if (SYMBIAN_DEBUG)
      fprintf (stderr, "EXPORT '%s'\n", name);
  
    /* XXX: Generate an export somehow ?  */
*************** sh_symbian_process_embedded_commands (st
*** 266,272 ****
  	      if (strncmp (s, DIRECTIVE_AS, strlen (DIRECTIVE_AS)))
  		{
  		  /* Skip the new-line at the end of the name.  */
! 		  if (DEBUG && name_end_char != '\n')
  		    fprintf (stderr, "IMPORT: No newline at end of directive\n");
  		  else
  		    s ++;
--- 266,272 ----
  	      if (strncmp (s, DIRECTIVE_AS, strlen (DIRECTIVE_AS)))
  		{
  		  /* Skip the new-line at the end of the name.  */
! 		  if (SYMBIAN_DEBUG && name_end_char != '\n')
  		    fprintf (stderr, "IMPORT: No newline at end of directive\n");
  		  else
  		    s ++;
*************** sh_symbian_process_embedded_commands (st
*** 276,282 ****
  		  /* Skip past the NUL character.  */
  		  if (* s ++ != 0)
  		    {
! 		      if (DEBUG)
  			fprintf (stderr, "IMPORT: No NUL at end of directive\n");
  		    }
  		}
--- 276,282 ----
  		  /* Skip past the NUL character.  */
  		  if (* s ++ != 0)
  		    {
! 		      if (SYMBIAN_DEBUG)
  			fprintf (stderr, "IMPORT: No NUL at end of directive\n");
  		    }
  		}
*************** sh_symbian_process_embedded_commands (st
*** 300,306 ****
  		  SKIP_WHILE (s, e, ' ', "IMPORT AS: Current name just followed by spaces");
  		  /* Skip past the newline character.  */
  		  if (* s ++ != '\n')
! 		    if (DEBUG)
  		      fprintf (stderr, "IMPORT AS: No newline at end of directive\n");
  
  		  /* Terminate the current name after having performed the skips.  */
--- 300,306 ----
  		  SKIP_WHILE (s, e, ' ', "IMPORT AS: Current name just followed by spaces");
  		  /* Skip past the newline character.  */
  		  if (* s ++ != '\n')
! 		    if (SYMBIAN_DEBUG)
  		      fprintf (stderr, "IMPORT AS: No newline at end of directive\n");
  
  		  /* Terminate the current name after having performed the skips.  */
*************** sh_symbian_process_embedded_commands (st
*** 311,317 ****
  		  /* The next character should be a NUL.  */
  		  if (* s != 0)
  		    {
! 		      if (DEBUG)
  			fprintf (stderr, "IMPORT AS: Junk at end of directive\n");
  		      result = FALSE;
  		    }
--- 311,317 ----
  		  /* The next character should be a NUL.  */
  		  if (* s != 0)
  		    {
! 		      if (SYMBIAN_DEBUG)
  			fprintf (stderr, "IMPORT AS: Junk at end of directive\n");
  		      result = FALSE;
  		    }
*************** sh_symbian_process_embedded_commands (st
*** 355,361 ****
  	      /* The next character should be a NUL.  */
  	      if (* s != 0)
  		{
! 		  if (DEBUG)
  		    fprintf (stderr, "EXPORT: Junk at end of directive\n");
  		  result = FALSE;
  		}
--- 355,361 ----
  	      /* The next character should be a NUL.  */
  	      if (* s != 0)
  		{
! 		  if (SYMBIAN_DEBUG)
  		    fprintf (stderr, "EXPORT: Junk at end of directive\n");
  		  result = FALSE;
  		}
*************** sh_symbian_process_embedded_commands (st
*** 373,379 ****
  
        if (! result)
  	{
! 	  if (DEBUG)
  	    fprintf (stderr, "offset into .directive section: %ld\n",
  		     (long) (directive - (char *) contents));
  	  
--- 373,379 ----
  
        if (! result)
  	{
! 	  if (SYMBIAN_DEBUG)
  	    fprintf (stderr, "offset into .directive section: %ld\n",
  		     (long) (directive - (char *) contents));
  	  
*************** sh_symbian_relocate_section (bfd *      
*** 464,470 ****
  
  	  if (ptr->current_hash == NULL)
  	    {
! 	      if (DEBUG)
  		fprintf (stderr, "IMPORT AS: current symbol '%s' does not exist\n", ptr->current_name);
  	      continue;
  	    }
--- 464,470 ----
  
  	  if (ptr->current_hash == NULL)
  	    {
! 	      if (SYMBIAN_DEBUG)
  		fprintf (stderr, "IMPORT AS: current symbol '%s' does not exist\n", ptr->current_name);
  	      continue;
  	    }
*************** sh_symbian_relocate_section (bfd *      
*** 511,517 ****
  	      if (new_hash->dynindx == -1)
  		new_hash->def_regular = 1;
  
! 	      if (DEBUG)
  		fprintf (stderr, "Created new symbol %s\n", ptr->new_name);
  	    }
  
--- 511,517 ----
  	      if (new_hash->dynindx == -1)
  		new_hash->def_regular = 1;
  
! 	      if (SYMBIAN_DEBUG)
  		fprintf (stderr, "Created new symbol %s\n", ptr->new_name);
  	    }
  
*************** sh_symbian_relocate_section (bfd *      
*** 521,527 ****
  	      if (* h == new_hash)
  		{
  		  ptr->new_symndx = h - sym_hashes + num_local_syms;
! 		  if (DEBUG)
  		    fprintf (stderr, "Converted new hash to index of %ld\n", ptr->new_symndx);
  		  break;
  		}
--- 521,527 ----
  	      if (* h == new_hash)
  		{
  		  ptr->new_symndx = h - sym_hashes + num_local_syms;
! 		  if (SYMBIAN_DEBUG)
  		    fprintf (stderr, "Converted new hash to index of %ld\n", ptr->new_symndx);
  		  break;
  		}
*************** sh_symbian_relocate_section (bfd *      
*** 539,545 ****
  	      new_sym_hashes = bfd_alloc (input_bfd, num_global_syms * sizeof * sym_hashes);
  	      if (new_sym_hashes == NULL)
  		{
! 		  if (DEBUG)
  		    fprintf (stderr, "Out of memory extending hash table\n");
  		  continue;
  		}
--- 539,545 ----
  	      new_sym_hashes = bfd_alloc (input_bfd, num_global_syms * sizeof * sym_hashes);
  	      if (new_sym_hashes == NULL)
  		{
! 		  if (SYMBIAN_DEBUG)
  		    fprintf (stderr, "Out of memory extending hash table\n");
  		  continue;
  		}
*************** sh_symbian_relocate_section (bfd *      
*** 551,557 ****
  
  	      ptr->new_symndx = num_global_syms - 1 + num_local_syms;
  
! 	      if (DEBUG)
  		fprintf (stderr, "Extended symbol hash table to insert new symbol as index %ld\n",
  			 ptr->new_symndx);
  	    }
--- 551,557 ----
  
  	      ptr->new_symndx = num_global_syms - 1 + num_local_syms;
  
! 	      if (SYMBIAN_DEBUG)
  		fprintf (stderr, "Extended symbol hash table to insert new symbol as index %ld\n",
  			 ptr->new_symndx);
  	    }
*************** sh_symbian_relocate_section (bfd *      
*** 601,607 ****
  	    if (h == ptr->current_hash)
  	      {
  		BFD_ASSERT (ptr->new_symndx);
! 		if (DEBUG)
  		  fprintf (stderr, "convert reloc %lx from using index %ld to using index %ld\n",
  			   (long) rel->r_info, (long) ELF32_R_SYM (rel->r_info), ptr->new_symndx);
  		rel->r_info = ELF32_R_INFO (ptr->new_symndx, r_type);
--- 601,607 ----
  	    if (h == ptr->current_hash)
  	      {
  		BFD_ASSERT (ptr->new_symndx);
! 		if (SYMBIAN_DEBUG)
  		  fprintf (stderr, "convert reloc %lx from using index %ld to using index %ld\n",
  			   (long) rel->r_info, (long) ELF32_R_SYM (rel->r_info), ptr->new_symndx);
  		rel->r_info = ELF32_R_INFO (ptr->new_symndx, r_type);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-05-02  9:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-02  1:41 bfd nits Alan Modra
2006-05-02  9:55 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).