This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


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

ARM COFF won't relocate PC-relative offsets into other sections


Here's a patch that fixes this problem.  I'm checking it in, approved
by Nick Clifton.

Index: bfd/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* coff-arm.c (coff_arm_relocate_section): Do not ignore the symbol
	value of PC-relative offsets.

Index: bfd/coff-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-arm.c,v
retrieving revision 1.16
diff -u -r1.16 coff-arm.c
--- bfd/coff-arm.c	2000/03/01 20:39:07	1.16
+++ bfd/coff-arm.c	2000/07/04 05:07:31
@@ -1246,8 +1246,15 @@
         {
           if (info->relocateable)
             continue;
+#if 0  /* We must not ignore the symbol value.  If the symbol is
+	  within the same section, the relocation should have already
+	  been fixed, but if it is not, we'll be handed a reloc into
+	  the beginning of the symbol's section, so we must not cancel
+	  out the symbol's value, otherwise we'll be adding it in
+	  twice.  */
           if (sym != NULL && sym->n_scnum != 0)
             addend += sym->n_value;
+#endif
         }
 
       val = 0;

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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