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]
Other format: [Raw text]

[Xtensa] change to avoid aborting on undefined symbol


The relocate_section function for Xtensa used to immediately skip to the next 
relocation after finding an undefined symbol.  This was done to avoid extra 
error messages resulting from trying to perform the relocation with a value 
of zero.  However, for dynamic links, it skipped emitting the dynamic 
relocation and broke a subsequent check that the number of dynamic 
relocations matched the expected count.

I've committed the following patch which changes the code to set a flag to 
inhibit subsequent error messages and still continue to emit the dynamic 
relocation.

2003-04-10  Bob Wilson  <bob dot wilson at acm dot org>

	* elf32-xtensa.c (elf_xtensa_relocate_section): Don't continue to the
	next relocation on an undefined symbol.

Index: elf32-xtensa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-xtensa.c,v
retrieving revision 1.1
diff -c -3 -r1.1 elf32-xtensa.c
*** elf32-xtensa.c	1 Apr 2003 15:50:27 -0000	1.1
--- elf32-xtensa.c	10 Apr 2003 05:27:07 -0000
***************
*** 1893,1898 ****
--- 1893,1899 ----
        bfd_reloc_status_type r;
        bfd_boolean is_weak_undef;
        bfd_boolean unresolved_reloc;
+       bfd_boolean warned;
  
        r_type = ELF32_R_TYPE (rel->r_info);
        if (r_type == (int) R_XTENSA_GNU_VTINHERIT
***************
*** 1983,1988 ****
--- 1984,1990 ----
        sec = NULL;
        is_weak_undef = FALSE;
        unresolved_reloc = FALSE;
+       warned = FALSE;
  
        if (howto->partial_inplace)
  	{
***************
*** 2039,2048 ****
  		      (!info->shared || info->no_undefined
  		       || ELF_ST_VISIBILITY (h->other)))))
  		return FALSE;
! 
! 	      /* To avoid any more warning messages, like "call out of
! 		 range", we continue immediately to the next relocation.  */
! 	      continue;
  	    }
  	}
  
--- 2041,2047 ----
  		      (!info->shared || info->no_undefined
  		       || ELF_ST_VISIBILITY (h->other)))))
  		return FALSE;
! 	      warned = TRUE;
  	    }
  	}
  
***************
*** 2171,2177 ****
  			       contents, rel->r_offset, is_weak_undef,
  			       &error_message);
        
!       if (r != bfd_reloc_ok)
  	{
  	  const char *name;
  
--- 2170,2176 ----
  			       contents, rel->r_offset, is_weak_undef,
  			       &error_message);
        
!       if (r != bfd_reloc_ok && !warned)
  	{
  	  const char *name;
  

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