public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Update relocation values for ARC platform.
@ 2005-04-25  9:15 Ramana Radhakrishnan
  2005-04-25  9:29 ` Nick Clifton
  0 siblings, 1 reply; 5+ messages in thread
From: Ramana Radhakrishnan @ 2005-04-25  9:15 UTC (permalink / raw)
  To: binutils

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

Hi ,

This patch corrects the values of the relocation types for
the ARC platform. Tested by building cross arc-elf32 and 
running the tests with no regressions.

Ok to commit. ?

cheers
Ramana
---
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)




[-- Attachment #2: chlg --]
[-- Type: text/plain, Size: 266 bytes --]

2005-04-21  Ramana Radhakrishnan  <ramana.radhakrishnan@codito.com>

	* arc.h: Correct relocation values for R_ARC_32,R_ARC_B26,
	R_ARC_B22_PCREL. 
	* elf32-arc.c(R_ARC_standard):Define.
	(bfd_elf32_bfd_reloc_type_lookup):Use it.
	(arc_info_to_howto_rel):Use it.




[-- Attachment #3: arc-relocations-corrections-patch --]
[-- Type: text/plain, Size: 1904 bytes --]

Index: include/elf/arc.h
===================================================================
RCS file: /cvs/src/src/include/elf/arc.h,v
retrieving revision 1.5
diff -a -u -r1.5 arc.h
--- include/elf/arc.h	14 Mar 2001 02:27:44 -0000	1.5
+++ include/elf/arc.h	21 Apr 2005 09:49:44 -0000
@@ -29,9 +29,10 @@
 
 START_RELOC_NUMBERS (elf_arc_reloc_type)
   RELOC_NUMBER (R_ARC_NONE, 0)
-  RELOC_NUMBER (R_ARC_32, 1)
-  RELOC_NUMBER (R_ARC_B26, 2)
-  RELOC_NUMBER (R_ARC_B22_PCREL, 3)
+     /* We have a gap here.  */
+  RELOC_NUMBER (R_ARC_32, 4)
+  RELOC_NUMBER (R_ARC_B26, 5)
+  RELOC_NUMBER (R_ARC_B22_PCREL, 6)
 END_RELOC_NUMBERS (R_ARC_max)
 
 /* Processor specific flags for the ELF header e_flags field.  */
Index: bfd/elf32-arc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arc.c,v
retrieving revision 1.14
diff -a -u -r1.14 elf32-arc.c
--- bfd/elf32-arc.c	30 Nov 2002 08:39:37 -0000	1.14
+++ bfd/elf32-arc.c	21 Apr 2005 09:49:44 -0000
@@ -58,7 +58,8 @@
 	 0,			/* src_mask  */
 	 0,			/* dst_mask  */
 	 FALSE),		/* pcrel_offset  */
-
+  /* There is a gap of 3 here between R_ARC_NONE and R_ARC_32.  */
+  #define R_ARC_standard (R_ARC_32 - 1)
   /* A standard 32 bit relocation.  */
   HOWTO (R_ARC_32,		/* type  */
 	 0,			/* rightshift  */
@@ -131,7 +132,8 @@
 
   for (i = ARRAY_SIZE (arc_reloc_map); i--;)
     if (arc_reloc_map[i].bfd_reloc_val == code)
-      return elf_arc_howto_table + arc_reloc_map[i].elf_reloc_val;
+      return (elf_arc_howto_table + arc_reloc_map[i].elf_reloc_val 
+	      - R_ARC_standard);
 
   return NULL;
 }
@@ -148,7 +150,7 @@
 
   r_type = ELF32_R_TYPE (dst->r_info);
   BFD_ASSERT (r_type < (unsigned int) R_ARC_max);
-  cache_ptr->howto = &elf_arc_howto_table[r_type];
+  cache_ptr->howto = &elf_arc_howto_table[r_type - R_ARC_standard];
 }
 
 /* Set the right machine number for an ARC ELF file.  */



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

end of thread, other threads:[~2005-04-27  9:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-25  9:15 [PATCH] Update relocation values for ARC platform Ramana Radhakrishnan
2005-04-25  9:29 ` Nick Clifton
2005-04-25 10:54   ` Ramana Radhakrishnan
2005-04-25 13:15     ` Nick Clifton
2005-04-27 10:42       ` Ramana Radhakrishnan

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