2f7f533
-R for 85880250e591a51624d24db653aaace0c5ce5943
2f7f533
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=85880250e591a51624d24db653aaace0c5ce5943;hp=fce10a8494efa8faec
2f7f533
2f7f533
[buildbot] GDB regression on 85880250e591a51624d24db653aaace0c5ce5943
2f7f533
https://sourceware.org/ml/binutils/2015-01/msg00044.html
2f7f533
2f7f533
diff --git a/bfd/coff-i860.c b/bfd/coff-i860.c
2f7f533
index 8573a8d..2122c0d 100644
2f7f533
--- a/bfd/coff-i860.c
2f7f533
+++ b/bfd/coff-i860.c
2f7f533
@@ -467,10 +467,7 @@ static reloc_howto_type howto_table[] =
2f7f533
    FIXME: This macro refers to symbols and asect; these are from the
2f7f533
    calling function, not the macro arguments.  */
2f7f533
 
2f7f533
-/* PR 17512: file: 0a38fb7c
2f7f533
-   Set an addend value, even if it is not going to be used.  A tool
2f7f533
-   like coffdump might be used to print out the contents of the reloc.  */
2f7f533
-#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) (cache_ptr)->addend = 0
2f7f533
+#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr)
2f7f533
 
2f7f533
 /* We use the special COFF backend linker.  */
2f7f533
 #define coff_relocate_section _bfd_coff_generic_relocate_section
2f7f533
diff --git a/bfd/tekhex.c b/bfd/tekhex.c
2f7f533
index 9444117..969b812 100644
2f7f533
--- a/bfd/tekhex.c
2f7f533
+++ b/bfd/tekhex.c
2f7f533
@@ -267,7 +267,7 @@ typedef struct tekhex_data_struct
2f7f533
 #define enda(x) (x->vma + x->size)
2f7f533
 
2f7f533
 static bfd_boolean
2f7f533
-getvalue (char **srcp, bfd_vma *valuep, char * endp)
2f7f533
+getvalue (char **srcp, bfd_vma *valuep)
2f7f533
 {
2f7f533
   char *src = *srcp;
2f7f533
   bfd_vma value = 0;
2f7f533
@@ -279,7 +279,7 @@ getvalue (char **srcp, bfd_vma *valuep, char * endp)
2f7f533
   len = hex_value (*src++);
2f7f533
   if (len == 0)
2f7f533
     len = 16;
2f7f533
-  while (len-- && src < endp)
2f7f533
+  while (len--)
2f7f533
     {
2f7f533
       if (!ISHEX (*src))
2f7f533
 	return FALSE;
2f7f533
@@ -288,11 +288,11 @@ getvalue (char **srcp, bfd_vma *valuep, char * endp)
2f7f533
 
2f7f533
   *srcp = src;
2f7f533
   *valuep = value;
2f7f533
-  return len == 0;
2f7f533
+  return TRUE;
2f7f533
 }
2f7f533
 
2f7f533
 static bfd_boolean
2f7f533
-getsym (char *dstp, char **srcp, unsigned int *lenp, char * endp)
2f7f533
+getsym (char *dstp, char **srcp, unsigned int *lenp)
2f7f533
 {
2f7f533
   char *src = *srcp;
2f7f533
   unsigned int i;
2f7f533
@@ -304,7 +304,7 @@ getsym (char *dstp, char **srcp, unsigned int *lenp, char * endp)
2f7f533
   len = hex_value (*src++);
2f7f533
   if (len == 0)
2f7f533
     len = 16;
2f7f533
-  for (i = 0; i < len && src < endp; i++)
2f7f533
+  for (i = 0; i < len; i++)
2f7f533
     dstp[i] = src[i];
2f7f533
   dstp[i] = 0;
2f7f533
   *srcp = src + i;
2f7f533
@@ -354,7 +354,7 @@ insert_byte (bfd *abfd, int value, bfd_vma addr)
2f7f533
   how big the data is.  */
2f7f533
 
2f7f533
 static bfd_boolean
2f7f533
-first_phase (bfd *abfd, int type, char *src, char * src_end)
2f7f533
+first_phase (bfd *abfd, int type, char *src)
2f7f533
 {
2f7f533
   asection *section, *alt_section;
2f7f533
   unsigned int len;
2f7f533
@@ -368,21 +368,21 @@ first_phase (bfd *abfd, int type, char *src, char * src_end)
2f7f533
       {
2f7f533
 	bfd_vma addr;
2f7f533
 
2f7f533
-	if (!getvalue (&src, &addr, src_end))
2f7f533
+	if (!getvalue (&src, &addr))
2f7f533
 	  return FALSE;
2f7f533
 
2f7f533
-	while (*src && src < src_end - 1)
2f7f533
+	while (*src)
2f7f533
 	  {
2f7f533
 	    insert_byte (abfd, HEX (src), addr);
2f7f533
 	    src += 2;
2f7f533
 	    addr++;
2f7f533
 	  }
2f7f533
-	return TRUE;
2f7f533
       }
2f7f533
 
2f7f533
+      return TRUE;
2f7f533
     case '3':
2f7f533
       /* Symbol record, read the segment.  */
2f7f533
-      if (!getsym (sym, &src, &len, src_end))
2f7f533
+      if (!getsym (sym, &src, &len))
2f7f533
 	return FALSE;
2f7f533
       section = bfd_get_section_by_name (abfd, sym);
2f7f533
       if (section == NULL)
2f7f533
@@ -403,9 +403,9 @@ first_phase (bfd *abfd, int type, char *src, char * src_end)
2f7f533
 	    {
2f7f533
 	    case '1':		/* Section range.  */
2f7f533
 	      src++;
2f7f533
-	      if (!getvalue (&src, &section->vma, src_end))
2f7f533
+	      if (!getvalue (&src, &section->vma))
2f7f533
 		return FALSE;
2f7f533
-	      if (!getvalue (&src, &val, src_end))
2f7f533
+	      if (!getvalue (&src, &val))
2f7f533
 		return FALSE;
2f7f533
 	      section->size = val - section->vma;
2f7f533
 	      section->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
2f7f533
@@ -432,7 +432,7 @@ first_phase (bfd *abfd, int type, char *src, char * src_end)
2f7f533
 		abfd->flags |= HAS_SYMS;
2f7f533
 		new_symbol->prev = abfd->tdata.tekhex_data->symbols;
2f7f533
 		abfd->tdata.tekhex_data->symbols = new_symbol;
2f7f533
-		if (!getsym (sym, &src, &len, src_end))
2f7f533
+		if (!getsym (sym, &src, &len))
2f7f533
 		  return FALSE;
2f7f533
 		new_symbol->symbol.name = (const char *)
2f7f533
                     bfd_alloc (abfd, (bfd_size_type) len + 1);
2f7f533
@@ -480,7 +480,7 @@ first_phase (bfd *abfd, int type, char *src, char * src_end)
2f7f533
 			new_symbol->symbol.section = alt_section;
2f7f533
 		      }
2f7f533
 		  }
2f7f533
-		if (!getvalue (&src, &val, src_end))
2f7f533
+		if (!getvalue (&src, &val))
2f7f533
 		  return FALSE;
2f7f533
 		new_symbol->symbol.value = val - section->vma;
2f7f533
 		break;
2f7f533
@@ -498,7 +498,7 @@ first_phase (bfd *abfd, int type, char *src, char * src_end)
2f7f533
    record.  */
2f7f533
 
2f7f533
 static bfd_boolean
2f7f533
-pass_over (bfd *abfd, bfd_boolean (*func) (bfd *, int, char *, char *))
2f7f533
+pass_over (bfd *abfd, bfd_boolean (*func) (bfd *, int, char *))
2f7f533
 {
2f7f533
   unsigned int chars_on_line;
2f7f533
   bfd_boolean is_eof = FALSE;
2f7f533
@@ -539,7 +539,8 @@ pass_over (bfd *abfd, bfd_boolean (*func) (bfd *, int, char *, char *))
2f7f533
 
2f7f533
       /* Put a null at the end.  */
2f7f533
       src[chars_on_line] = 0;
2f7f533
-      if (!func (abfd, type, src, src + chars_on_line))
2f7f533
+
2f7f533
+      if (!func (abfd, type, src))
2f7f533
 	return FALSE;
2f7f533
     }
2f7f533