correct reloc.c address test

Alan Modra amodra@bigpond.net.au
Mon Dec 3 15:17:00 GMT 2001


Committed.

	* reloc.c (bfd_install_relocation): Correct reloc address test.
	(bfd_perform_relocation): Formatting fix.
	* bfd-in2.h: Regenerate for 2001-12-02 reloc.c change.

Index: bfd/reloc.c
===================================================================
RCS file: /cvs/src/src/bfd/reloc.c,v
retrieving revision 1.49
diff -u -p -r1.49 reloc.c
--- reloc.c	2001/12/02 13:14:48	1.49
+++ reloc.c	2001/12/03 23:06:55
@@ -627,8 +627,8 @@ bfd_perform_relocation (abfd, reloc_entr
     }
 
   /* Is the address of the relocation really within the section?  */
-  if (reloc_entry->address > input_section->_cooked_size /
-      bfd_octets_per_byte (abfd))
+  if (reloc_entry->address > (input_section->_cooked_size
+			      / bfd_octets_per_byte (abfd)))
     return bfd_reloc_outofrange;
 
   /* Work out which section the relocation is targetted at and the
@@ -1023,7 +1023,8 @@ bfd_install_relocation (abfd, reloc_entr
     }
 
   /* Is the address of the relocation really within the section?  */
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > (input_section->_cooked_size
+			      / bfd_octets_per_byte (abfd)))
     return bfd_reloc_outofrange;
 
   /* Work out which section the relocation is targetted at and the



More information about the Binutils mailing list