This is the mail archive of the binutils@sourceware.org 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]

.reloc pseudo


On Thu, Feb 22, 2007 at 04:22:56PM +1030, Alan Modra wrote:
> BTW, the reason I'm looking at this code is that I intend to add
> a low level means of emitting relocations in gas.  Something like
> 
>   .reloc offset, reloc_name, symbol+addend
> 
> eg.
>   .reloc __speelf__+50, R_PPC_ADDR32, stdout
> 
> The particular use I have in mind is in embedspu, where it will be
> useful to to apply relocations to a block of code inserted by .incbin,
> but I guess this might be a generally useful feature so I'll make it
> available on all targets.

gas/
	* doc/as.texinfo (Reloc): Document.
	* read.c (potable): Add "reloc".
	(s_reloc): New function.
	* write.c (reloc_list): New global var.
	(resolve_reloc_expr_symbols): New function.
	(write_object_file): Call it.
	(write_relocs): Process reloc_list.
	* write.h (struct reloc_list): New.
	(reloc_list): Declare.
bfd/
	* aout-adobe.c (aout_32_bfd_reloc_name_lookup): Define.
	* aout-arm.c (MY_bfd_reloc_name_lookup): Define.
	(MY (bfd_reloc_name_lookup)): New function.
	* aout-ns32k.c (MY (bfd_reloc_name_lookup)): New function.
	* aout-target.h (NAME (aout, reloc_name_lookup)): Declare.
	(MY_bfd_reloc_name_lookup): Define.
	* aout-tic30.c (tic30_aout_reloc_name_lookup): New function.
	(MY_bfd_reloc_name_lookup): Define.
	* aoutx.h (NAME (aout, reloc_type_lookup)): Don't declare.
	(NAME (aout, reloc_name_lookup)): New function.
	* bout.c (b_out_bfd_reloc_name_lookup): New function.
	* coff-alpha.c (alpha_bfd_reloc_name_lookup): New function.
	(_bfd_ecoff_bfd_reloc_name_lookup): Define.
	* coff-arm.c (coff_arm_reloc_name_lookup): New function.
	(coff_bfd_reloc_name_lookup): Define.
	* coff-i386.c (coff_bfd_reloc_name_lookup): Define.
	(coff_i386_reloc_name_lookup): New function.
	* coff-i860.c (coff_i860_reloc_name_lookup): New function.
	(coff_bfd_reloc_name_lookup): Define.
	* coff-i960.c (coff_i960_reloc_name_lookup): New function.
	(coff_bfd_reloc_name_lookup): Define.
	* coff-m68k.c (m68k_reloc_name_lookup): New function.
	(coff_bfd_reloc_name_lookup): Define.
	* coff-maxq.c (maxq_reloc_name_lookup): New function.
	(coff_bfd_reloc_name_lookup): Define.
	* coff-mcore.c (mcore_coff_reloc_name_lookup): New function.
	(coff_bfd_reloc_name_lookup): Define.
	* coff-mips.c (mips_bfd_reloc_name_lookup): New function.
	(_bfd_ecoff_bfd_reloc_name_lookup): Define.
	* coff-ppc.c (ppc_coff_reloc_name_lookup): New function.
	(coff_bfd_reloc_name_lookup): Define.
	* coff-rs6000.c (coff_bfd_reloc_name_lookup): Define.
	(_bfd_xcoff_reloc_name_lookup): New function.
	(rs6000coff_vec, pmac_xcoff_vec): Init new field.
	* coff-sh.c (coff_bfd_reloc_name_lookup): Define.
	(sh_coff_reloc_name_lookup): New function.
	* coff-sparc.c (coff_sparc_reloc_name_lookup): New function.
	(coff_bfd_reloc_name_lookup): Define.
	* coff-tic30.c (coff_bfd_reloc_name_lookup): Define.
	(tic30_coff_reloc_name_lookup): New function.
	* coff-tic4x.c (coff_bfd_reloc_name_lookup): Define.
	(tic4x_coff_reloc_name_lookup): New function.
	* coff-tic54x.c (coff_bfd_reloc_name_lookup): Define.
	(tic54x_coff_reloc_name_lookup): New function.
	* coff-x86_64.c (coff_bfd_reloc_name_lookup): Define.
	(coff_amd64_reloc_name_lookup): New function.
	* coff-z80.c (coff_z80_reloc_name_lookup): New function.
	(coff_bfd_reloc_name_lookup): Define.
	* coff-z8k.c (coff_z8k_reloc_name_lookup): New function.
	(coff_bfd_reloc_name_lookup): Define.
	* coff64-rs6000.c (coff_bfd_reloc_name_lookup): Define.
	(xcoff64_reloc_name_lookup): New function.
	(rs6000coff64_vec, aix5coff64_vec): Init new field.
	* coffcode.h (coff_bfd_reloc_name_lookup): Define.
	* elf-hppa.h (elf_hppa_reloc_name_lookup): New function.
	* elf-m10200.c (bfd_elf32_bfd_reloc_name_lookup): New function.
	* elf-m10300.c (bfd_elf32_bfd_reloc_name_lookup): New function.
	* elf32-arc.c (bfd_elf32_bfd_reloc_name_lookup): New function.
	* elf32-arm.c (elf32_arm_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-avr.c (bfd_elf32_bfd_reloc_name_lookup): New function.
	* elf32-bfin.c (bfin_bfd_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-cr16c.c (elf_cr16c_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-cris.c (cris_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-crx.c (elf_crx_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-d10v.c (bfd_elf32_bfd_reloc_name_lookup): New function.
	* elf32-d30v.c (bfd_elf32_bfd_reloc_name_lookup): New function.
	* elf32-dlx.c (elf32_dlx_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-fr30.c (fr30_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-frv.c (frv_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-gen.c (bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-h8300.c (elf32_h8_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-hppa.c (bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-i370.c (i370_elf_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-i386.c (elf_i386_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-i860.c (elf32_i860_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-i960.c (elf32_i960_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-ip2k.c (ip2k_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-iq2000.c (iq2000_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-m32c.c (m32c_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-m32r.c (bfd_elf32_bfd_reloc_name_lookup): New function.
	* elf32-m68hc11.c (bfd_elf32_bfd_reloc_name_lookup): New function.
	* elf32-m68hc12.c (bfd_elf32_bfd_reloc_name_lookup): New function.
	* elf32-m68k.c (reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-m88k.c (bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-mcore.c (mcore_elf_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-mep.c (mep_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-mips.c (bfd_elf32_bfd_reloc_name_lookup): New function.
	(mips_vxworks_bfd_reloc_name_lookup): Likewise.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-msp430.c (bfd_elf32_bfd_reloc_name_lookup): New function.
	* elf32-mt.c (mt_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-openrisc.c (openrisc_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-or32.c (bfd_elf32_bfd_reloc_name_lookup): New function.
	* elf32-pj.c (pj_elf_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-ppc.c (ppc_elf_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-s390.c (elf_s390_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-score.c (elf32_score_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-sh.c (sh_elf_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-sparc.c (bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-spu.c (spu_elf_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-v850.c (v850_elf_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-vax.c (reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-xc16x.c (xc16x_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-xstormy16.c (xstormy16_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf32-xtensa.c (elf_xtensa_reloc_name_lookup): New function.
	(bfd_elf32_bfd_reloc_name_lookup): Define.
	* elf64-alpha.c (elf64_alpha_bfd_reloc_name_lookup): New function.
	(bfd_elf64_bfd_reloc_name_lookup): Define.
	* elf64-gen.c (bfd_elf64_bfd_reloc_name_lookup): Define.
	* elf64-hppa.c (bfd_elf64_bfd_reloc_name_lookup): Define.
	* elf64-mips.c (bfd_elf64_bfd_reloc_name_lookup): New function.
	* elf64-mmix.c (bfd_elf64_bfd_reloc_name_lookup): New function.
	* elf64-ppc.c (ppc64_elf_reloc_name_lookup): New function.
	(bfd_elf64_bfd_reloc_name_lookup): Define.
	* elf64-s390.c (elf_s390_reloc_name_lookup): New function.
	(bfd_elf64_bfd_reloc_name_lookup): Define.
	* elf64-sh64.c (sh_elf64_reloc_name_lookup): New function.
	(bfd_elf64_bfd_reloc_name_lookup): Define.
	* elf64-sparc.c (bfd_elf64_bfd_reloc_name_lookup): Define.
	* elf64-x86-64.c (elf64_x86_64_reloc_name_lookup): New function.
	(bfd_elf64_bfd_reloc_name_lookup): Define.
	* elfn32-mips.c (bfd_elf32_bfd_reloc_name_lookup): New function.
	* elfxx-ia64.c (elfNN_ia64_reloc_name_lookup): New function.
	(bfd_elfNN_bfd_reloc_name_lookup): Define.
	* elfxx-sparc.c (_bfd_sparc_elf_reloc_name_lookup): New function.
	* elfxx-sparc.h (_bfd_sparc_elf_reloc_name_lookup): Declare.
	* i386msdos.c (msdos_bfd_reloc_name_lookup): Define.
	* i386os9k.c (aout_32_bfd_reloc_name_lookup): Define.
	* ieee.c (ieee_bfd_reloc_name_lookup): Define.
	* libaout.h (NAME (aout, reloc_name_lookup)): Declare.
	* libbfd-in.h (_bfd_norelocs_bfd_reloc_name_lookup): Declare.
	* mipsbsd.c (MY_bfd_reloc_name_lookup): Define.
	(MY(reloc_type_lookup)): Rename from MY(reloc_howto_type_lookup).
	(MY(reloc_name_lookup)): New function.
	* nlm-target.h (nlm_bfd_reloc_name_lookup): Define.
	* oasys.c (oasys_bfd_reloc_name_lookup): Define.
	* pdp11.c (NAME (aout, reloc_name_lookup)): New function.
	* pe-mips.c (coff_mips_reloc_name_lookup): New function.
	(coff_bfd_reloc_name_lookup): Define.
	* reloc.c (bfd_reloc_name_lookup): New function.
	* riscix.c (riscix_reloc_name_lookup): New function.
	(MY_bfd_reloc_name_lookup): Define.
	* som.c (som_bfd_reloc_name_lookup): New function.
	* targets.c (struct bfd_target): Add reloc_name_lookup.
	(BFD_JUMP_TABLE_RELOCS): Add NAME##_bfd_reloc_name_lookup.
	* versados.c (versados_bfd_reloc_name_lookup): Define.
	* vms.c (vms_bfd_reloc_name_lookup): New function.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.

Index: gas/doc/as.texinfo
===================================================================
RCS file: /cvs/src/src/gas/doc/as.texinfo,v
retrieving revision 1.160
diff -u -p -r1.160 as.texinfo
--- gas/doc/as.texinfo	22 Mar 2007 21:18:31 -0000	1.160
+++ gas/doc/as.texinfo	26 Mar 2007 03:20:20 -0000
@@ -3886,6 +3886,7 @@ Some machine configurations provide addi
 @end ifset
 
 * Quad::                        @code{.quad @var{bignums}}
+* Reloc::			@code{.reloc @var{offset}, @var{reloc_name}[, @var{expression}]}
 * Rept::			@code{.rept @var{count}}
 * Sbttl::                       @code{.sbttl "@var{subheading}"}
 @ifset COFF
@@ -5433,6 +5434,20 @@ warning message; and just takes the lowe
 @cindex integer, 16-byte
 @end ifset
 
+@node Reloc
+@section @code{.reloc @var{offset}, @var{reloc_name}[, @var{expression}]}
+
+@cindex @code{reloc} directive
+Generate a relocation at @var{offset} of type @var{reloc_name} with value
+@var{expression}.  If @var{offset} is a number, the relocation is generated in
+the current section.  If @var{offset} is an expression that resolves to a
+symbol plus offset, the relocation is generated in the given symbol's section.
+@var{expression}, if present, must resolve to a symbol plus addend or to an
+absolute value, but note that not all targets support an addend.  e.g. ELF REL
+targets such as i386 store an addend in the section contents rather than in the
+relocation.  This low level interface does not support addends stored in the
+section.
+
 @node Rept
 @section @code{.rept @var{count}}
 
Index: gas/read.c
===================================================================
RCS file: /cvs/src/src/gas/read.c,v
retrieving revision 1.123
diff -u -p -r1.123 read.c
--- gas/read.c	9 Mar 2007 23:25:59 -0000	1.123
+++ gas/read.c	26 Mar 2007 00:14:14 -0000
@@ -213,6 +213,7 @@ static void do_align (int, char *, int, 
 static void s_align (int, int);
 static void s_altmacro (int);
 static void s_bad_end (int);
+static void s_reloc (int);
 static int hex_float (int, char *);
 static segT get_known_segmented_expression (expressionS * expP);
 static void pobegin (void);
@@ -391,6 +392,7 @@ static const pseudo_typeS potable[] = {
   {"psize", listing_psize, 0},	/* Set paper size.  */
   {"purgem", s_purgem, 0},
   {"quad", cons, 8},
+  {"reloc", s_reloc, 0},
   {"rep", s_rept, 0},
   {"rept", s_rept, 0},
   {"rva", s_rva, 4},
@@ -3669,6 +3671,113 @@ s_rva (int size)
   cons_worker (size, 1);
 }
 
+/* .reloc offset, reloc_name, symbol+addend.  */
+
+void
+s_reloc (int ignore ATTRIBUTE_UNUSED)
+{
+  char *stop = NULL;
+  char stopc = 0;
+  expressionS exp;
+  char *r_name;
+  int c;
+  struct reloc_list *reloc;
+
+  reloc = xmalloc (sizeof (*reloc));
+
+  if (flag_mri)
+    stop = mri_comment_field (&stopc);
+
+  expression (&exp);
+  switch (exp.X_op)
+    {
+    case O_illegal:
+    case O_absent:
+    case O_big:
+    case O_register:
+      as_bad (_("missing or bad offset expression"));
+      goto err_out;
+    case O_constant:
+      exp.X_add_symbol = section_symbol (now_seg);
+      exp.X_op = O_symbol;
+      /* Fall thru */
+    case O_symbol:
+      if (exp.X_add_number == 0)
+	{
+	  reloc->u.a.offset_sym = exp.X_add_symbol;
+	  break;
+	}
+      /* Fall thru */
+    default:
+      reloc->u.a.offset_sym = make_expr_symbol (&exp);
+      break;
+    }
+
+  SKIP_WHITESPACE ();
+  if (*input_line_pointer != ',')
+    {
+      as_bad (_("missing reloc type"));
+      goto err_out;
+    }
+
+  ++input_line_pointer;
+  SKIP_WHITESPACE ();
+  r_name = input_line_pointer;
+  c = get_symbol_end ();
+  reloc->u.a.howto = bfd_reloc_name_lookup (stdoutput, r_name);
+  *input_line_pointer = c;
+  if (reloc->u.a.howto == NULL)
+    {
+      as_bad (_("unrecognized reloc type"));
+      goto err_out;
+    }
+
+  exp.X_op = O_absent;
+  SKIP_WHITESPACE ();
+  if (*input_line_pointer == ',')
+    {
+      ++input_line_pointer;
+      expression_and_evaluate (&exp);
+    }
+  switch (exp.X_op)
+    {
+    case O_illegal:
+    case O_big:
+    case O_register:
+      as_bad (_("bad reloc expression"));
+    err_out:
+      ignore_rest_of_line ();
+      free (reloc);
+      if (flag_mri)
+	mri_comment_end (stop, stopc);
+      return;
+    case O_absent:
+      reloc->u.a.sym = NULL;
+      reloc->u.a.addend = 0;
+      break;
+    case O_constant:
+      reloc->u.a.sym = NULL;
+      reloc->u.a.addend = exp.X_add_number;
+      break;
+    case O_symbol:
+      reloc->u.a.sym = exp.X_add_symbol;
+      reloc->u.a.addend = exp.X_add_number;
+      break;
+    default:
+      reloc->u.a.sym = make_expr_symbol (&exp);
+      reloc->u.a.addend = 0;
+      break;
+    }
+
+  as_where (&reloc->file, &reloc->line);
+  reloc->next = reloc_list;
+  reloc_list = reloc;
+
+  demand_empty_rest_of_line ();
+  if (flag_mri)
+    mri_comment_end (stop, stopc);
+}
+
 /* Put the contents of expression EXP into the object file using
    NBYTES bytes.  If need_pass_2 is 1, this does nothing.  */
 
Index: gas/write.c
===================================================================
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.111
diff -u -p -r1.111 write.c
--- gas/write.c	14 Mar 2007 11:03:38 -0000	1.111
+++ gas/write.c	26 Mar 2007 00:14:14 -0000
@@ -117,6 +117,9 @@ symbolS *abs_section_sym;
 /* Remember the value of dot when parsing expressions.  */
 addressT dot_value;
 
+/* Relocs generated by ".reloc" pseudo.  */
+struct reloc_list* reloc_list;
+
 void print_fixup (fixS *);
 
 /* We generally attach relocs to frag chains.  However, after we have
@@ -624,6 +627,86 @@ dump_section_relocs (bfd *abfd ATTRIBUTE
 #define EMIT_SECTION_SYMBOLS 1
 #endif
 
+/* Resolve U.A.OFFSET_SYM and U.A.SYM fields of RELOC_LIST entries,
+   and check for validity.  Convert RELOC_LIST from using U.A fields
+   to U.B fields.  */
+static void
+resolve_reloc_expr_symbols (void)
+{
+  struct reloc_list *r;
+
+  for (r = reloc_list; r; r = r->next)
+    {
+      expressionS *symval;
+      symbolS *sym;
+      bfd_vma offset, addend;
+      asection *sec;
+      reloc_howto_type *howto;
+
+      resolve_symbol_value (r->u.a.offset_sym);
+      symval = symbol_get_value_expression (r->u.a.offset_sym);
+
+      offset = 0;
+      sym = NULL;
+      if (symval->X_op == O_constant)
+	sym = r->u.a.offset_sym;
+      else if (symval->X_op == O_symbol)
+	{
+	  sym = symval->X_add_symbol;
+	  offset = symval->X_add_number;
+	  symval = symbol_get_value_expression (symval->X_add_symbol);
+	}
+      if (sym == NULL
+	  || symval->X_op != O_constant
+	  || (sec = S_GET_SEGMENT (sym)) == NULL
+	  || !SEG_NORMAL (sec))
+	{
+	  as_bad_where (r->file, r->line, _("invalid offset expression"));
+	  sec = NULL;
+	}
+      else
+	offset += S_GET_VALUE (sym);
+
+      sym = NULL;
+      addend = r->u.a.addend;
+      if (r->u.a.sym != NULL)
+	{
+	  resolve_symbol_value (r->u.a.sym);
+	  symval = symbol_get_value_expression (r->u.a.sym);
+	  if (symval->X_op == O_constant)
+	    sym = r->u.a.sym;
+	  else if (symval->X_op == O_symbol)
+	    {
+	      sym = symval->X_add_symbol;
+	      addend += symval->X_add_number;
+	      symval = symbol_get_value_expression (symval->X_add_symbol);
+	    }
+	  if (symval->X_op != O_constant)
+	    {
+	      as_bad_where (r->file, r->line, _("invalid reloc expression"));
+	      sec = NULL;
+	    }
+	  else if (sym != NULL)
+	    symbol_mark_used_in_reloc (sym);
+	}
+      if (sym == NULL)
+	{
+	  if (abs_section_sym == NULL)
+	    abs_section_sym = section_symbol (absolute_section);
+	  sym = abs_section_sym;
+	}
+
+      howto = r->u.a.howto;
+
+      r->u.b.sec = sec;
+      r->u.b.s = symbol_get_bfdsym (sym);
+      r->u.b.r.sym_ptr_ptr = &r->u.b.s;
+      r->u.b.r.address = offset;
+      r->u.b.r.addend = addend;
+      r->u.b.r.howto = howto;
+    }
+}
+
 /* This pass over fixups decides whether symbols can be replaced with
    section symbols.  */
 
@@ -1027,6 +1110,7 @@ write_relocs (bfd *abfd, asection *sec, 
   segment_info_type *seginfo = seg_info (sec);
   unsigned int i;
   unsigned int n;
+  struct reloc_list *my_reloc_list, **rp, *r;
   arelent **relocs;
   fixS *fixp;
 
@@ -1044,6 +1128,22 @@ write_relocs (bfd *abfd, asection *sec, 
   n *= MAX_RELOC_EXPANSION;
 #endif
 
+  /* Extract relocs for this section from reloc_list.  */
+  rp = &reloc_list;
+  my_reloc_list = NULL;
+  while ((r = *rp) != NULL)
+    {
+      if (r->u.b.sec == sec)
+	{
+	  *rp = r->next;
+	  r->next = my_reloc_list;
+	  my_reloc_list = r;
+	  n++;
+	}
+      else
+	rp = &r->next;
+    }
+
   relocs = xcalloc (n, sizeof (arelent *));
 
   i = 0;
@@ -1107,6 +1207,23 @@ write_relocs (bfd *abfd, asection *sec, 
   }
 #endif
 
+  for (r = my_reloc_list; r != NULL; r = r->next)
+    {
+      fragS *f;
+      for (f = seginfo->frchainP->frch_root; f; f = f->fr_next)
+	if (f->fr_address <= r->u.b.r.address
+	    && r->u.b.r.address < f->fr_address + f->fr_fix)
+	  break;
+      if (f == NULL)
+	as_bad_where (r->file, r->line,
+		      _("reloc not within (fixed part of) section"));
+      else
+	{
+	  relocs[n++] = &r->u.b.r;
+	  install_reloc (sec, &r->u.b.r, f, r->file, r->line);
+	}
+    }
+
   if (n)
     {
       flagword flags = bfd_get_section_flags (abfd, sec);
@@ -1564,6 +1681,7 @@ write_object_file (void)
 	resolve_symbol_value (symp);
     }
   resolve_local_symbol_values ();
+  resolve_reloc_expr_symbols ();
 
   PROGRESS (1);
 
Index: gas/write.h
===================================================================
RCS file: /cvs/src/src/gas/write.h,v
retrieving revision 1.17
diff -u -p -r1.17 write.h
--- gas/write.h	5 Feb 2007 20:10:24 -0000	1.17
+++ gas/write.h	26 Mar 2007 00:14:14 -0000
@@ -142,11 +142,35 @@ struct fix
 
 typedef struct fix fixS;
 
+struct reloc_list
+{
+  struct reloc_list *next;
+  union
+  {
+    struct
+    {
+      symbolS *offset_sym;
+      reloc_howto_type *howto;
+      symbolS *sym;
+      bfd_vma addend;
+    } a;
+    struct
+    {
+      asection *sec;
+      asymbol *s;
+      arelent r;
+    } b;
+  } u;
+  char *file;
+  unsigned int line;
+};
+
 extern int finalize_syms;
 extern symbolS *abs_section_sym;
 extern addressT dot_value;
 extern long string_byte_count;
 extern int section_alignment[];
+extern struct reloc_list* reloc_list;
 
 extern void append (char **charPP, char *fromP, unsigned long length);
 extern void record_alignment (segT seg, int align);
Index: bfd/aout-adobe.c
===================================================================
RCS file: /cvs/src/src/bfd/aout-adobe.c,v
retrieving revision 1.26
diff -u -p -r1.26 aout-adobe.c
--- bfd/aout-adobe.c	19 Jun 2006 13:17:43 -0000	1.26
+++ bfd/aout-adobe.c	26 Mar 2007 00:12:03 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for a.out.adobe binaries.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005, 2006
+   2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    Written by Cygnus Support.  Based on bout.c.
 
@@ -450,6 +450,7 @@ aout_adobe_sizeof_headers (bfd *ignore_a
 
 #define aout_32_bfd_make_debug_symbol ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr)
 #define aout_32_bfd_reloc_type_lookup ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr)
+#define aout_32_bfd_reloc_name_lookup ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr)
 #define aout_32_close_and_cleanup                   aout_32_bfd_free_cached_info
 #define	aout_32_set_arch_mach		            aout_adobe_set_arch_mach
 #define	aout_32_set_section_contents	            aout_adobe_set_section_contents
Index: bfd/aout-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/aout-arm.c,v
retrieving revision 1.16
diff -u -p -r1.16 aout-arm.c
--- bfd/aout-arm.c	4 May 2005 15:52:59 -0000	1.16
+++ bfd/aout-arm.c	26 Mar 2007 00:12:03 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for raw ARM a.out binaries.
-   Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005
-   Free Software Foundation, Inc.
+   Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005,
+   2007 Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -50,6 +50,7 @@
 #define N_MAGIC(x) ((x).a_info & ~07200)
 
 #define MY_bfd_reloc_type_lookup aoutarm_bfd_reloc_type_lookup
+#define MY_bfd_reloc_name_lookup aoutarm_bfd_reloc_name_lookup
 
 #include "libaout.h"
 #include "aout/aout64.h"
@@ -317,6 +318,22 @@ MY (bfd_reloc_type_lookup) (bfd *abfd,
     }
 }
 
+static reloc_howto_type *
+MY (bfd_reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (MY (howto_table)) / sizeof (MY (howto_table)[0]);
+       i++)
+    if (MY (howto_table)[i].name != NULL
+	&& strcasecmp (MY (howto_table)[i].name, r_name) == 0)
+      return &MY (howto_table)[i];
+
+  return NULL;
+}
+
 #define MY_swap_std_reloc_in     MY (swap_std_reloc_in)
 #define MY_swap_std_reloc_out    MY (swap_std_reloc_out)
 #define MY_get_section_contents  _bfd_generic_get_section_contents
Index: bfd/aout-ns32k.c
===================================================================
RCS file: /cvs/src/src/bfd/aout-ns32k.c,v
retrieving revision 1.18
diff -u -p -r1.18 aout-ns32k.c
--- bfd/aout-ns32k.c	2 May 2006 10:01:56 -0000	1.18
+++ bfd/aout-ns32k.c	26 Mar 2007 00:12:03 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for ns32k a.out-ish binaries.
    Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-   2002, 2003, 2005 Free Software Foundation, Inc.
+   2002, 2003, 2005, 2007 Free Software Foundation, Inc.
    Contributed by Ian Dall (idall@eleceng.adelaide.edu.au).
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -28,8 +28,9 @@
    the tokens.  */
 #define MYNS(OP) CONCAT2 (ns32kaout_,OP)
 
-reloc_howto_type * MYNS (bfd_reloc_type_lookup) (bfd * abfd, bfd_reloc_code_real_type);
-bfd_boolean        MYNS (write_object_contents) (bfd *abfd);
+reloc_howto_type * MYNS (bfd_reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
+reloc_howto_type * MYNS (bfd_reloc_name_lookup) (bfd *, const char *);
+bfd_boolean        MYNS (write_object_contents) (bfd *);
 
 /* Avoid multiple definitions from aoutx if supporting
    standard a.out format(s) as well as this one.  */
@@ -246,6 +247,22 @@ MY (bfd_reloc_type_lookup) (bfd *abfd, b
 #undef ENTRY
 }
 
+reloc_howto_type *
+MY (bfd_reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (MY (howto_table)) / sizeof (MY (howto_table)[0]);
+       i++)
+    if (MY (howto_table)[i].name != NULL
+	&& strcasecmp (MY (howto_table)[i].name, r_name) == 0)
+      return &MY (howto_table)[i];
+
+  return NULL;
+}
+
 static void
 MY_swap_std_reloc_in (bfd *abfd,
 		      struct reloc_std_external *bytes,
Index: bfd/aout-target.h
===================================================================
RCS file: /cvs/src/src/bfd/aout-target.h,v
retrieving revision 1.33
diff -u -p -r1.33 aout-target.h
--- bfd/aout-target.h	23 May 2005 17:44:51 -0000	1.33
+++ bfd/aout-target.h	26 Mar 2007 00:12:03 -0000
@@ -1,6 +1,6 @@
 /* Define a target vector and some small routines for a variant of a.out.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005
+   2000, 2001, 2002, 2003, 2004, 2005, 2007
    Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -29,6 +29,7 @@
 #endif
 
 extern reloc_howto_type * NAME (aout, reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
+extern reloc_howto_type * NAME (aout, reloc_name_lookup) (bfd *, const char *);
 
 /* Set parameters about this a.out file that are machine-dependent.
    This routine is called from some_aout_object_p just before it returns.  */
@@ -494,6 +495,9 @@ MY_bfd_final_link (bfd *abfd, struct bfd
 #ifndef MY_bfd_reloc_type_lookup
 #define MY_bfd_reloc_type_lookup NAME (aout, reloc_type_lookup)
 #endif
+#ifndef MY_bfd_reloc_name_lookup
+#define MY_bfd_reloc_name_lookup NAME (aout, reloc_name_lookup)
+#endif
 #ifndef MY_bfd_make_debug_symbol
 #define MY_bfd_make_debug_symbol 0
 #endif
Index: bfd/aout-tic30.c
===================================================================
RCS file: /cvs/src/src/bfd/aout-tic30.c,v
retrieving revision 1.31
diff -u -p -r1.31 aout-tic30.c
--- bfd/aout-tic30.c	23 May 2005 17:44:51 -0000	1.31
+++ bfd/aout-tic30.c	26 Mar 2007 00:12:04 -0000
@@ -1,5 +1,5 @@
 /* BFD back-end for TMS320C30 a.out binaries.
-   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
    Free Software Foundation, Inc.
    Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
 
@@ -271,6 +271,23 @@ tic30_aout_reloc_type_lookup (bfd *abfd 
 }
 
 static reloc_howto_type *
+tic30_aout_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			      const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (tic30_aout_howto_table)
+	    / sizeof (tic30_aout_howto_table[0]));
+       i++)
+    if (tic30_aout_howto_table[i].name != NULL
+	&& strcasecmp (tic30_aout_howto_table[i].name, r_name) == 0)
+      return &tic30_aout_howto_table[i];
+
+  return NULL;
+}
+
+static reloc_howto_type *
 tic30_aout_reloc_howto (bfd *abfd,
 			struct reloc_std_external *relocs,
 			int *r_index,
@@ -936,6 +953,9 @@ tic30_aout_set_arch_mach (bfd *abfd,
 #ifndef MY_bfd_reloc_type_lookup
 #define MY_bfd_reloc_type_lookup tic30_aout_reloc_type_lookup
 #endif
+#ifndef MY_bfd_reloc_name_lookup
+#define MY_bfd_reloc_name_lookup tic30_aout_reloc_name_lookup
+#endif
 #ifndef MY_bfd_make_debug_symbol
 #define MY_bfd_make_debug_symbol 0
 #endif
Index: bfd/aoutx.h
===================================================================
RCS file: /cvs/src/src/bfd/aoutx.h,v
retrieving revision 1.62
diff -u -p -r1.62 aoutx.h
--- bfd/aoutx.h	19 Jun 2006 13:17:43 -0000	1.62
+++ bfd/aoutx.h	26 Mar 2007 00:12:06 -0000
@@ -129,8 +129,6 @@ DESCRIPTION
 #include "aout/stab_gnu.h"
 #include "aout/ar.h"
 
-reloc_howto_type * NAME (aout, reloc_type_lookup)  (bfd *, bfd_reloc_code_real_type);
-
 /*
 SUBSECTION
 	Relocations
@@ -319,6 +317,31 @@ NAME (aout, reloc_type_lookup) (bfd *abf
       }
 }
 
+reloc_howto_type *
+NAME (aout, reloc_name_lookup) (bfd *abfd, const char *r_name)
+{
+  unsigned int i, size;
+  reloc_howto_type *howto_table;
+
+  if (obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE)
+    {
+      howto_table = howto_table_ext;
+      size = sizeof (howto_table_ext) / sizeof (howto_table_ext[0]);
+    }
+  else
+    {
+      howto_table = howto_table_std;
+      size = sizeof (howto_table_std) / sizeof (howto_table_std[0]);
+    }
+
+  for (i = 0; i < size; i++)
+    if (howto_table[i].name != NULL
+	&& strcasecmp (howto_table[i].name, r_name) == 0)
+      return &howto_table[i];
+
+  return NULL;
+}
+
 /*
 SUBSECTION
 	Internal entry points
Index: bfd/bout.c
===================================================================
RCS file: /cvs/src/src/bfd/bout.c,v
retrieving revision 1.28
diff -u -p -r1.28 bout.c
--- bfd/bout.c	19 Jun 2006 13:17:43 -0000	1.28
+++ bfd/bout.c	26 Mar 2007 00:12:11 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for Intel 960 b.out binaries.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -635,7 +635,8 @@ callj_callback (bfd *abfd,
 }
 
 static reloc_howto_type *
-b_out_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code)
+b_out_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			     bfd_reloc_code_real_type code)
 {
   switch (code)
     {
@@ -651,6 +652,20 @@ b_out_bfd_reloc_type_lookup (bfd *abfd A
     }
 }
 
+static reloc_howto_type *
+b_out_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			     const char *r_name)
+{
+  if (strcasecmp (howto_reloc_callj.name, r_name) == 0)
+    return &howto_reloc_callj;
+  if (strcasecmp (howto_reloc_abs32.name, r_name) == 0)
+    return &howto_reloc_abs32;
+  if (strcasecmp (howto_reloc_pcrel24.name, r_name) == 0)
+    return &howto_reloc_pcrel24;
+
+  return NULL;
+}
+
 /* Allocate enough room for all the reloc entries, plus pointers to them all.  */
 
 static bfd_boolean
Index: bfd/coff-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-alpha.c,v
retrieving revision 1.33
diff -u -p -r1.33 coff-alpha.c
--- bfd/coff-alpha.c	14 Jul 2005 07:48:28 -0000	1.33
+++ bfd/coff-alpha.c	26 Mar 2007 00:12:12 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for ALPHA Extended-Coff files.
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2007 Free Software Foundation, Inc.
    Modified from coff-mips.c by Steve Chamberlain <sac@cygnus.com> and
    Ian Lance Taylor <ian@cygnus.com>.
 
@@ -1244,6 +1244,22 @@ alpha_bfd_reloc_type_lookup (abfd, code)
 
   return &alpha_howto_table[alpha_type];
 }
+
+static reloc_howto_type *
+alpha_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			     const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (alpha_howto_table) / sizeof (alpha_howto_table[0]);
+       i++)
+    if (alpha_howto_table[i].name != NULL
+	&& strcasecmp (alpha_howto_table[i].name, r_name) == 0)
+      return &alpha_howto_table[i];
+
+  return NULL;
+}
 
 /* A helper routine for alpha_relocate_section which converts an
    external reloc when generating relocatable output.  Returns the
@@ -2361,6 +2377,8 @@ static const struct ecoff_backend_data a
 
 /* Looking up a reloc type is Alpha specific.  */
 #define _bfd_ecoff_bfd_reloc_type_lookup alpha_bfd_reloc_type_lookup
+#define _bfd_ecoff_bfd_reloc_name_lookup \
+  alpha_bfd_reloc_name_lookup
 
 /* So is getting relocated section contents.  */
 #define _bfd_ecoff_bfd_get_relocated_section_contents \
Index: bfd/coff-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-arm.c,v
retrieving revision 1.69
diff -u -p -r1.69 coff-arm.c
--- bfd/coff-arm.c	10 Nov 2006 07:35:19 -0000	1.69
+++ bfd/coff-arm.c	26 Mar 2007 00:12:13 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for ARM COFF files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -853,6 +853,23 @@ coff_arm_reloc_type_lookup (bfd * abfd, 
     }
 }
 
+static reloc_howto_type *
+coff_arm_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (aoutarm_std_reloc_howto)
+	    / sizeof (aoutarm_std_reloc_howto[0]));
+       i++)
+    if (aoutarm_std_reloc_howto[i].name != NULL
+	&& strcasecmp (aoutarm_std_reloc_howto[i].name, r_name) == 0)
+      return &aoutarm_std_reloc_howto[i];
+
+  return NULL;
+}
+
 #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER  2
 #define COFF_PAGE_SIZE                        0x1000
 
@@ -2112,6 +2129,7 @@ bfd_arm_process_before_allocation (bfd *
 #endif /* ! defined (COFF_IMAGE_WITH_PE) */
 
 #define coff_bfd_reloc_type_lookup 		coff_arm_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup	coff_arm_reloc_name_lookup
 #define coff_relocate_section 			coff_arm_relocate_section
 #define coff_bfd_is_local_label_name 		coff_arm_is_local_label_name
 #define coff_adjust_symndx			coff_arm_adjust_symndx
Index: bfd/coff-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-i386.c,v
retrieving revision 1.23
diff -u -p -r1.23 coff-i386.c
--- bfd/coff-i386.c	4 May 2005 15:53:02 -0000	1.23
+++ bfd/coff-i386.c	26 Mar 2007 00:12:13 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for Intel 386 COFF files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004
+   2000, 2001, 2002, 2003, 2004, 2007
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -546,6 +546,7 @@ coff_i386_rtype_to_howto (abfd, sec, rel
 }
 
 #define coff_bfd_reloc_type_lookup coff_i386_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup coff_i386_reloc_name_lookup
 
 static reloc_howto_type *
 coff_i386_reloc_type_lookup (abfd, code)
@@ -578,6 +579,20 @@ coff_i386_reloc_type_lookup (abfd, code)
     }
 }
 
+static reloc_howto_type *
+coff_i386_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			     const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++)
+    if (howto_table[i].name != NULL
+	&& strcasecmp (howto_table[i].name, r_name) == 0)
+      return &howto_table[i];
+
+  return NULL;
+}
+
 #define coff_rtype_to_howto coff_i386_rtype_to_howto
 
 #ifdef TARGET_UNDERSCORE
Index: bfd/coff-i860.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-i860.c,v
retrieving revision 1.19
diff -u -p -r1.19 coff-i860.c
--- bfd/coff-i860.c	4 May 2005 15:53:02 -0000	1.19
+++ bfd/coff-i860.c	26 Mar 2007 00:12:14 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for Intel i860 COFF files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2007 Free Software Foundation, Inc.
    Created mostly by substituting "860" for "386" in coff-i386.c
    Harry Dolan <dolan@ssd.intel.com>, October 1995
 
@@ -555,6 +555,20 @@ coff_i860_reloc_type_lookup (bfd *abfd A
     }
 }
 
+static reloc_howto_type *
+coff_i860_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			     const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++)
+    if (howto_table[i].name != NULL
+	&& strcasecmp (howto_table[i].name, r_name) == 0)
+      return &howto_table[i];
+
+  return NULL;
+}
+
 /* This is called from coff_slurp_reloc_table for each relocation
    entry.  This special handling is due to the `PAIR' relocation
    which has a different meaning for the `r_symndx' field.  */
@@ -620,6 +634,7 @@ i860_reloc_processing (arelent *cache_pt
 
 #define coff_rtype_to_howto		coff_i860_rtype_to_howto
 #define coff_bfd_reloc_type_lookup	coff_i860_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup coff_i860_reloc_name_lookup
 
 #define RELOC_PROCESSING(relent, reloc, symbols, abfd, section) \
   i860_reloc_processing (relent, reloc, symbols, abfd, section)
Index: bfd/coff-i960.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-i960.c,v
retrieving revision 1.16
diff -u -p -r1.16 coff-i960.c
--- bfd/coff-i960.c	4 May 2005 15:53:02 -0000	1.16
+++ bfd/coff-i960.c	26 Mar 2007 00:12:14 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for Intel 960 COFF files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001,
-   2002, 2003, 2004 Free Software Foundation, Inc.
+   2002, 2003, 2004, 2007 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -296,6 +296,20 @@ coff_i960_reloc_type_lookup (abfd, code)
     }
 }
 
+static reloc_howto_type *
+coff_i960_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			     const char *r_name)
+{
+  if (strcasecmp (howto_optcall.name, r_name) == 0)
+    return &howto_optcall;
+  if (strcasecmp (howto_rellong.name, r_name) == 0)
+    return &howto_rellong;
+  if (strcasecmp (howto_iprmed.name, r_name) == 0)
+    return &howto_iprmed;
+
+  return NULL;
+}
+
 /* The real code is in coffcode.h */
 
 #define RTYPE2HOWTO(cache_ptr, dst) \
@@ -613,6 +627,7 @@ coff_i960_adjust_symndx (obfd, info, ibf
 #define coff_adjust_symndx coff_i960_adjust_symndx
 
 #define coff_bfd_reloc_type_lookup coff_i960_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup coff_i960_reloc_name_lookup
 
 #include "coffcode.h"
 
Index: bfd/coff-m68k.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-m68k.c,v
retrieving revision 1.16
diff -u -p -r1.16 coff-m68k.c
--- bfd/coff-m68k.c	4 May 2005 15:53:02 -0000	1.16
+++ bfd/coff-m68k.c	26 Mar 2007 00:12:14 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for Motorola 68000 COFF binaries.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999,
-   2000, 2001, 2002, 2003, 2005
+   2000, 2001, 2002, 2003, 2005, 2007
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -91,6 +91,7 @@ m68k_coff_is_local_label_name (abfd, nam
 #define m68k_rtype2howto	_bfd_m68kcoff_rtype2howto
 #define m68k_howto2rtype	_bfd_m68kcoff_howto2rtype
 #define m68k_reloc_type_lookup	_bfd_m68kcoff_reloc_type_lookup
+#define m68k_reloc_name_lookup _bfd_m68kcoff_reloc_name_lookup
 #endif
 
 #ifdef ONLY_DECLARE_RELOCS
@@ -123,6 +124,8 @@ extern void m68k_rtype2howto PARAMS ((ar
 extern int m68k_howto2rtype PARAMS ((reloc_howto_type *));
 extern reloc_howto_type *m68k_reloc_type_lookup
   PARAMS ((bfd *, bfd_reloc_code_real_type));
+extern reloc_howto_type *m68k_reloc_name_lookup
+  PARAMS ((bfd *, const char *));
 #else
 
 #ifdef STATIC_RELOCS
@@ -132,6 +135,7 @@ extern reloc_howto_type *m68k_reloc_type
 #endif
 
 STAT_REL reloc_howto_type * m68k_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
+STAT_REL reloc_howto_type * m68k_reloc_name_lookup PARAMS ((bfd *, const char *));
 STAT_REL int m68k_howto2rtype PARAMS ((reloc_howto_type *));
 STAT_REL void m68k_rtype2howto PARAMS ((arelent *, int));
 
@@ -198,6 +202,22 @@ m68k_reloc_type_lookup (abfd, code)
   /*NOTREACHED*/
 }
 
+STAT_REL reloc_howto_type *
+m68k_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+		        const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (m68kcoff_howto_table) / sizeof (m68kcoff_howto_table[0]);
+       i++)
+    if (m68kcoff_howto_table[i].name != NULL
+	&& strcasecmp (m68kcoff_howto_table[i].name, r_name) == 0)
+      return &m68kcoff_howto_table[i];
+
+  return NULL;
+}
+
 #endif /* not ONLY_DECLARE_RELOCS */
 
 #define RTYPE2HOWTO(internal, relocentry) \
@@ -207,6 +227,7 @@ m68k_reloc_type_lookup (abfd, code)
   external.r_type = m68k_howto2rtype (internal)
 
 #define coff_bfd_reloc_type_lookup m68k_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup m68k_reloc_name_lookup
 
 #ifndef COFF_COMMON_ADDEND
 #ifndef coff_rtype_to_howto
Index: bfd/coff-maxq.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-maxq.c,v
retrieving revision 1.4
diff -u -p -r1.4 coff-maxq.c
--- bfd/coff-maxq.c	26 Oct 2006 00:10:43 -0000	1.4
+++ bfd/coff-maxq.c	26 Mar 2007 00:12:14 -0000
@@ -1,5 +1,5 @@
 /* BFD back-end for MAXQ COFF binaries.
-   Copyright 2004    Free Software Foundation, Inc.
+   Copyright 2004, 2007  Free Software Foundation, Inc.
 
    Contributed by Vineet Sharma (vineets@noida.hcltech.com) Inderpreet S.
    (inderpreetb@noida.hcltech.com)
@@ -407,7 +407,21 @@ maxq_reloc_type_lookup (bfd * abfd ATTRI
     }
 }
 
+static reloc_howto_type *
+maxq_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++)
+    if (howto_table[i].name != NULL
+	&& strcasecmp (howto_table[i].name, r_name) == 0)
+      return &howto_table[i];
+
+  return NULL;
+}
+
 #define coff_bfd_reloc_type_lookup maxq_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup maxq_reloc_name_lookup
 
 /* Perform any necessary magic to the addend in a reloc entry.  */
 #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \
Index: bfd/coff-mcore.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-mcore.c,v
retrieving revision 1.35
diff -u -p -r1.35 coff-mcore.c
--- bfd/coff-mcore.c	4 May 2005 15:53:02 -0000	1.35
+++ bfd/coff-mcore.c	26 Mar 2007 00:12:15 -0000
@@ -1,5 +1,5 @@
 /* BFD back-end for Motorola MCore COFF/PE
-   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -283,9 +283,25 @@ mcore_coff_reloc_type_lookup (abfd, code
     }
   /*NOTREACHED*/
 }
-
 #undef HOW2MAP
 
+static reloc_howto_type *
+mcore_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			      const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (mcore_coff_howto_table)
+	    / sizeof (mcore_coff_howto_table[0]));
+       i++)
+    if (mcore_coff_howto_table[i].name != NULL
+	&& strcasecmp (mcore_coff_howto_table[i].name, r_name) == 0)
+      return &mcore_coff_howto_table[i];
+
+  return NULL;
+}
+
 #define RTYPE2HOWTO(cache_ptr, dst) \
   (cache_ptr)->howto = mcore_coff_howto_table + (dst)->r_type;
 
@@ -538,6 +554,7 @@ coff_mcore_relocate_section (output_bfd,
 /* We use the special COFF backend linker, with our own special touch.  */
 
 #define coff_bfd_reloc_type_lookup   mcore_coff_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup mcore_coff_reloc_name_lookup
 #define coff_relocate_section        coff_mcore_relocate_section
 #define coff_rtype_to_howto          coff_mcore_rtype_to_howto
 
Index: bfd/coff-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-mips.c,v
retrieving revision 1.30
diff -u -p -r1.30 coff-mips.c
--- bfd/coff-mips.c	4 May 2005 15:53:02 -0000	1.30
+++ bfd/coff-mips.c	26 Mar 2007 00:12:15 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for MIPS Extended-Coff files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004
+   2000, 2001, 2002, 2003, 2004, 2007
    Free Software Foundation, Inc.
    Original version by Per Bothner.
    Full support added by Ian Lance Taylor, ian@cygnus.com.
@@ -769,6 +769,22 @@ mips_bfd_reloc_type_lookup (abfd, code)
 
   return &mips_howto_table[mips_type];
 }
+
+static reloc_howto_type *
+mips_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (mips_howto_table) / sizeof (mips_howto_table[0]);
+       i++)
+    if (mips_howto_table[i].name != NULL
+	&& strcasecmp (mips_howto_table[i].name, r_name) == 0)
+      return &mips_howto_table[i];
+
+  return NULL;
+}
 
 /* A helper routine for mips_relocate_section which handles the REFHI
    relocations.  The REFHI relocation must be followed by a REFLO
@@ -1375,6 +1391,7 @@ static const struct ecoff_backend_data m
 
 /* Looking up a reloc type is MIPS specific.  */
 #define _bfd_ecoff_bfd_reloc_type_lookup mips_bfd_reloc_type_lookup
+#define _bfd_ecoff_bfd_reloc_name_lookup mips_bfd_reloc_name_lookup
 
 /* Getting relocated section contents is generic.  */
 #define _bfd_ecoff_bfd_get_relocated_section_contents \
Index: bfd/coff-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-ppc.c,v
retrieving revision 1.30
diff -u -p -r1.30 coff-ppc.c
--- bfd/coff-ppc.c	16 Sep 2006 18:12:13 -0000	1.30
+++ bfd/coff-ppc.c	26 Mar 2007 00:12:17 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for PowerPC Microsoft Portable Executable files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
 
    Original version pieced together by Kim Knuttila (krk@cygnus.com)
@@ -1961,8 +1961,23 @@ ppc_coff_reloc_type_lookup (abfd, code)
       return NULL;
     }
 }
-
 #undef HOW2MAP
+
+static reloc_howto_type *
+ppc_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (ppc_coff_howto_table) / sizeof (ppc_coff_howto_table[0]);
+       i++)
+    if (ppc_coff_howto_table[i].name != NULL
+	&& strcasecmp (ppc_coff_howto_table[i].name, r_name) == 0)
+      return &ppc_coff_howto_table[i];
+
+  return NULL;
+}
 
 /* Tailor coffcode.h -- macro heaven.  */
 
@@ -1971,6 +1986,7 @@ ppc_coff_reloc_type_lookup (abfd, code)
 /* We use the special COFF backend linker, with our own special touch.  */
 
 #define coff_bfd_reloc_type_lookup   ppc_coff_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup ppc_coff_reloc_name_lookup
 #define coff_rtype_to_howto          coff_ppc_rtype_to_howto
 #define coff_relocate_section        coff_ppc_relocate_section
 #define coff_bfd_final_link          ppc_bfd_coff_final_link
Index: bfd/coff-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-rs6000.c,v
retrieving revision 1.77
diff -u -p -r1.77 coff-rs6000.c
--- bfd/coff-rs6000.c	19 Jun 2006 13:17:43 -0000	1.77
+++ bfd/coff-rs6000.c	26 Mar 2007 00:12:19 -0000
@@ -1,5 +1,5 @@
 /* BFD back-end for IBM RS/6000 "XCOFF" files.
-   Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    FIXME: Can someone provide a transliteration of this name into ASCII?
    Using the following chars caused a compiler warning on HIUX (so I replaced
@@ -98,6 +98,7 @@ void xcoff_rtype2howto
 #define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data
 #define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name
 #define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup _bfd_xcoff_reloc_name_lookup
 #ifdef AIX_CORE
 extern const bfd_target * rs6000coff_core_p
   PARAMS ((bfd *abfd));
@@ -1051,6 +1052,21 @@ _bfd_xcoff_reloc_type_lookup (abfd, code
     }
 }
 
+static reloc_howto_type *
+_bfd_xcoff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			      const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (xcoff_howto_table) / sizeof (xcoff_howto_table[0]);
+       i++)
+    if (xcoff_howto_table[i].name != NULL
+	&& strcasecmp (xcoff_howto_table[i].name, r_name) == 0)
+      return &xcoff_howto_table[i];
+
+  return NULL;
+}
 
 /* XCOFF archive support.  The original version of this code was by
    Damon A. Permezel.  It was enhanced to permit cross support, and
@@ -4178,6 +4194,7 @@ const bfd_target rs6000coff_vec =
     coff_get_reloc_upper_bound,
     coff_canonicalize_reloc,
     _bfd_xcoff_reloc_type_lookup,
+    _bfd_xcoff_reloc_name_lookup,
 
     /* Write */
     coff_set_arch_mach,
@@ -4428,6 +4445,7 @@ const bfd_target pmac_xcoff_vec =
     coff_get_reloc_upper_bound,
     coff_canonicalize_reloc,
     _bfd_xcoff_reloc_type_lookup,
+    _bfd_xcoff_reloc_name_lookup,
 
     /* Write */
     coff_set_arch_mach,
Index: bfd/coff-sh.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-sh.c,v
retrieving revision 1.34
diff -u -p -r1.34 coff-sh.c
--- bfd/coff-sh.c	13 Jul 2006 09:07:36 -0000	1.34
+++ bfd/coff-sh.c	26 Mar 2007 00:12:20 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for Renesas Super-H COFF binaries.
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2007 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    Written by Steve Chamberlain, <sac@cygnus.com>.
    Relaxing code written by Ian Lance Taylor, <ian@cygnus.com>.
@@ -494,6 +494,7 @@ static const struct shcoff_reloc_map sh_
 /* Given a BFD reloc code, return the howto structure for the
    corresponding SH PE reloc.  */
 #define coff_bfd_reloc_type_lookup	sh_coff_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup sh_coff_reloc_name_lookup
 
 static reloc_howto_type *
 sh_coff_reloc_type_lookup (abfd, code)
@@ -510,6 +511,20 @@ sh_coff_reloc_type_lookup (abfd, code)
   return NULL;
 }
 
+static reloc_howto_type *
+sh_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			   const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0; i < sizeof (sh_coff_howtos) / sizeof (sh_coff_howtos[0]); i++)
+    if (sh_coff_howtos[i].name != NULL
+	&& strcasecmp (sh_coff_howtos[i].name, r_name) == 0)
+      return &sh_coff_howtos[i];
+
+  return NULL;
+}
+
 /* This macro is used in coffcode.h to get the howto corresponding to
    an internal reloc.  */
 
Index: bfd/coff-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-sparc.c,v
retrieving revision 1.14
diff -u -p -r1.14 coff-sparc.c
--- bfd/coff-sparc.c	4 May 2005 15:53:03 -0000	1.14
+++ bfd/coff-sparc.c	26 Mar 2007 00:12:20 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for Sparc COFF files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001,
-   2002, 2003, 2005 Free Software Foundation, Inc.
+   2002, 2003, 2005, 2007 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -158,6 +158,24 @@ coff_sparc_reloc_type_lookup (abfd, code
 }
 #define coff_bfd_reloc_type_lookup	coff_sparc_reloc_type_lookup
 
+static reloc_howto_type *
+coff_sparc_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			      const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (coff_sparc_howto_table)
+	    / sizeof (coff_sparc_howto_table[0]));
+       i++)
+    if (coff_sparc_howto_table[i].name != NULL
+	&& strcasecmp (coff_sparc_howto_table[i].name, r_name) == 0)
+      return &coff_sparc_howto_table[i];
+
+  return NULL;
+}
+#define coff_bfd_reloc_name_lookup coff_sparc_reloc_name_lookup
+
 static void
 rtype2howto (cache_ptr, dst)
      arelent *cache_ptr;
Index: bfd/coff-tic30.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-tic30.c,v
retrieving revision 1.10
diff -u -p -r1.10 coff-tic30.c
--- bfd/coff-tic30.c	4 May 2005 15:53:04 -0000	1.10
+++ bfd/coff-tic30.c	26 Mar 2007 00:12:21 -0000
@@ -1,5 +1,6 @@
 /* BFD back-end for TMS320C30 coff binaries.
-   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2000, 2001, 2002, 2007
+   Free Software Foundation, Inc.
    Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -52,6 +53,7 @@ reloc_howto_type tic30_coff_howto_table[
 
 #ifndef coff_bfd_reloc_type_lookup
 #define coff_bfd_reloc_type_lookup tic30_coff_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup tic30_coff_reloc_name_lookup
 
 /* For the case statement use the code values used in tc_gen_reloc to
    map to the howto table entries that match those in both the aout
@@ -80,6 +82,23 @@ tic30_coff_reloc_type_lookup (abfd, code
     }
 }
 
+static reloc_howto_type *
+tic30_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			      const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (tic30_coff_howto_table)
+	    / sizeof (tic30_coff_howto_table[0]));
+       i++)
+    if (tic30_coff_howto_table[i].name != NULL
+	&& strcasecmp (tic30_coff_howto_table[i].name, r_name) == 0)
+      return &tic30_coff_howto_table[i];
+
+  return NULL;
+}
+
 #endif
 
 /* Turn a howto into a reloc number.  */
Index: bfd/coff-tic4x.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-tic4x.c,v
retrieving revision 1.12
diff -u -p -r1.12 coff-tic4x.c
--- bfd/coff-tic4x.c	4 May 2005 15:53:04 -0000	1.12
+++ bfd/coff-tic4x.c	26 Mar 2007 00:12:21 -0000
@@ -1,5 +1,5 @@
 /* BFD back-end for TMS320C4X coff binaries.
-   Copyright 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005
+   Copyright 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005, 2007
    Free Software Foundation, Inc.
 
    Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz)
@@ -117,6 +117,8 @@ reloc_howto_type tic4x_howto_table[] =
 
 #undef coff_bfd_reloc_type_lookup
 #define coff_bfd_reloc_type_lookup tic4x_coff_reloc_type_lookup
+#undef coff_bfd_reloc_name_lookup
+#define coff_bfd_reloc_name_lookup tic4x_coff_reloc_name_lookup
 
 /* For the case statement use the code values used tc_gen_reloc (defined in
    bfd/reloc.c) to map to the howto table entries.  */
@@ -150,6 +152,21 @@ tic4x_coff_reloc_type_lookup (abfd, code
   return NULL;
 }
 
+static reloc_howto_type *
+tic4x_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			      const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (tic4x_howto_table) / sizeof (tic4x_howto_table[0]);
+       i++)
+    if (tic4x_howto_table[i].name != NULL
+	&& strcasecmp (tic4x_howto_table[i].name, r_name) == 0)
+      return &tic4x_howto_table[i];
+
+  return NULL;
+}
 
 /* Code to turn a r_type into a howto ptr, uses the above howto table.
    Called after some initial checking by the tic4x_rtype_to_howto fn
Index: bfd/coff-tic54x.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-tic54x.c,v
retrieving revision 1.20
diff -u -p -r1.20 coff-tic54x.c
--- bfd/coff-tic54x.c	4 May 2005 15:53:04 -0000	1.20
+++ bfd/coff-tic54x.c	26 Mar 2007 00:12:21 -0000
@@ -1,5 +1,5 @@
 /* BFD back-end for TMS320C54X coff binaries.
-   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
    Free Software Foundation, Inc.
    Contributed by Timothy Wall (twall@cygnus.com)
 
@@ -229,6 +229,7 @@ reloc_howto_type tic54x_howto_table[] =
   };
 
 #define coff_bfd_reloc_type_lookup tic54x_coff_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup tic54x_coff_reloc_name_lookup
 
 /* For the case statement use the code values used tc_gen_reloc (defined in
    bfd/reloc.c) to map to the howto table entries.  */
@@ -259,6 +260,22 @@ tic54x_coff_reloc_type_lookup (abfd, cod
     }
 }
 
+static reloc_howto_type *
+tic54x_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			       const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (tic54x_howto_table) / sizeof (tic54x_howto_table[0]);
+       i++)
+    if (tic54x_howto_table[i].name != NULL
+	&& strcasecmp (tic54x_howto_table[i].name, r_name) == 0)
+      return &tic54x_howto_table[i];
+
+  return NULL;
+}
+
 /* Code to turn a r_type into a howto ptr, uses the above howto table.
    Called after some initial checking by the tic54x_rtype_to_howto fn below.  */
 
Index: bfd/coff-x86_64.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-x86_64.c,v
retrieving revision 1.1
diff -u -p -r1.1 coff-x86_64.c
--- bfd/coff-x86_64.c	20 Sep 2006 11:35:07 -0000	1.1
+++ bfd/coff-x86_64.c	26 Mar 2007 00:12:24 -0000
@@ -1,5 +1,5 @@
 /* BFD back-end for AMD 64 COFF files.
-   Copyright 2006 Free Software Foundation, Inc.
+   Copyright 2006, 2007 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -634,6 +634,7 @@ coff_amd64_rtype_to_howto (bfd *abfd ATT
 }
 
 #define coff_bfd_reloc_type_lookup coff_amd64_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup coff_amd64_reloc_name_lookup
 
 static reloc_howto_type *
 coff_amd64_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code)
@@ -674,6 +675,20 @@ coff_amd64_reloc_type_lookup (bfd *abfd 
     }
 }
 
+static reloc_howto_type *
+coff_amd64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			      const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++)
+    if (howto_table[i].name != NULL
+	&& strcasecmp (howto_table[i].name, r_name) == 0)
+      return &howto_table[i];
+
+  return NULL;
+}
+
 #define coff_rtype_to_howto coff_amd64_rtype_to_howto
 
 #ifdef TARGET_UNDERSCORE
Index: bfd/coff-z80.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-z80.c,v
retrieving revision 1.3
diff -u -p -r1.3 coff-z80.c
--- bfd/coff-z80.c	5 Feb 2006 11:57:34 -0000	1.3
+++ bfd/coff-z80.c	26 Mar 2007 00:12:24 -0000
@@ -1,5 +1,5 @@
 /* BFD back-end for Zilog Z80 COFF binaries.
-   Copyright 2005 Free Software Foundation, Inc.
+   Copyright 2005, 2007 Free Software Foundation, Inc.
    Contributed by Arnold Metselaar <arnold_m@operamail.com>
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -123,6 +123,26 @@ coff_z80_reloc_type_lookup (bfd *abfd AT
     }
 }
 
+static reloc_howto_type *
+coff_z80_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  if (strcasecmp (r_imm8.name, r_name) == 0)
+    return &r_imm8;
+  if (strcasecmp (r_imm16.name, r_name) == 0)
+    return &r_imm16;
+  if (strcasecmp (r_imm24.name, r_name) == 0)
+    return &r_imm24;
+  if (strcasecmp (r_imm32.name, r_name) == 0)
+    return &r_imm32;
+  if (strcasecmp (r_jr.name, r_name) == 0)
+    return &r_jr;
+  if (strcasecmp (r_off8.name, r_name) == 0)
+    return &r_off8;
+
+  return NULL;
+}
+
 /* Perform any necessary magic to the addend in a reloc entry.  */
 
 #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \
@@ -248,6 +268,7 @@ extra_case (bfd *in_abfd,
 
 #define coff_reloc16_extra_cases    extra_case
 #define coff_bfd_reloc_type_lookup  coff_z80_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup coff_z80_reloc_name_lookup
 
 #include "coffcode.h"
 
Index: bfd/coff-z8k.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-z8k.c,v
retrieving revision 1.21
diff -u -p -r1.21 coff-z8k.c
--- bfd/coff-z8k.c	27 Dec 2005 03:06:27 -0000	1.21
+++ bfd/coff-z8k.c	26 Mar 2007 00:12:24 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for Zilog Z800n COFF binaries.
    Copyright 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005 Free Software Foundation, Inc.
+   2004, 2005, 2007 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
    Written by Steve Chamberlain, <sac@cygnus.com>.
 
@@ -135,6 +135,30 @@ coff_z8k_reloc_type_lookup (bfd *abfd AT
     }
 }
 
+static reloc_howto_type *
+coff_z8k_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  if (strcasecmp (r_imm8.name, r_name) == 0)
+    return &r_imm8;
+  if (strcasecmp (r_da.name, r_name) == 0)
+    return &r_da;
+  if (strcasecmp (r_imm32.name, r_name) == 0)
+    return &r_imm32;
+  if (strcasecmp (r_jr.name, r_name) == 0)
+    return &r_jr;
+  if (strcasecmp (r_rel16.name, r_name) == 0)
+    return &r_rel16;
+  if (strcasecmp (r_disp7.name, r_name) == 0)
+    return &r_disp7;
+  if (strcasecmp (r_callr.name, r_name) == 0)
+    return &r_callr;
+  if (strcasecmp (r_imm4l.name, r_name) == 0)
+    return &r_imm4l;
+
+  return NULL;
+}
+
 /* Perform any necessary magic to the addend in a reloc entry.  */
 
 #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \
@@ -345,6 +369,7 @@ extra_case (bfd *in_abfd,
 
 #define coff_reloc16_extra_cases    extra_case
 #define coff_bfd_reloc_type_lookup  coff_z8k_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup coff_z8k_reloc_name_lookup
 
 #include "coffcode.h"
 
Index: bfd/coff64-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff64-rs6000.c,v
retrieving revision 1.67
diff -u -p -r1.67 coff64-rs6000.c
--- bfd/coff64-rs6000.c	19 Jun 2006 13:17:43 -0000	1.67
+++ bfd/coff64-rs6000.c	26 Mar 2007 00:12:24 -0000
@@ -1,5 +1,5 @@
 /* BFD back-end for IBM RS/6000 "XCOFF64" files.
-   Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    Written Clinton Popetz.
    Contributed by Cygnus Support.
@@ -237,6 +237,7 @@ bfd_boolean (*xcoff64_calculate_relocati
 #define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data
 #define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name
 #define coff_bfd_reloc_type_lookup xcoff64_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup xcoff64_reloc_name_lookup
 #ifdef AIX_CORE
 extern const bfd_target * rs6000coff_core_p
   PARAMS ((bfd *abfd));
@@ -1843,6 +1844,22 @@ xcoff64_reloc_type_lookup (abfd, code)
     }
 }
 
+static reloc_howto_type *
+xcoff64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			   const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (xcoff64_howto_table) / sizeof (xcoff64_howto_table[0]);
+       i++)
+    if (xcoff64_howto_table[i].name != NULL
+	&& strcasecmp (xcoff64_howto_table[i].name, r_name) == 0)
+      return &xcoff64_howto_table[i];
+
+  return NULL;
+}
+
 /* Read in the armap of an XCOFF archive.  */
 
 static bfd_boolean
@@ -2725,6 +2742,7 @@ const bfd_target rs6000coff64_vec =
     coff_get_reloc_upper_bound,
     coff_canonicalize_reloc,
     xcoff64_reloc_type_lookup,
+    xcoff64_reloc_name_lookup,
 
     /* Write */
     coff_set_arch_mach,
@@ -2976,6 +2994,7 @@ const bfd_target aix5coff64_vec =
     coff_get_reloc_upper_bound,
     coff_canonicalize_reloc,
     xcoff64_reloc_type_lookup,
+    xcoff64_reloc_name_lookup,
 
     /* Write */
     coff_set_arch_mach,
Index: bfd/coffcode.h
===================================================================
RCS file: /cvs/src/src/bfd/coffcode.h,v
retrieving revision 1.135
diff -u -p -r1.135 coffcode.h
--- bfd/coffcode.h	20 Sep 2006 11:35:07 -0000	1.135
+++ bfd/coffcode.h	26 Mar 2007 00:12:26 -0000
@@ -1,6 +1,6 @@
 /* Support for the generic parts of most COFF variants, for BFD.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -5333,6 +5333,9 @@ static const bfd_coff_backend_data ticof
 #ifndef coff_bfd_reloc_type_lookup
 #define coff_bfd_reloc_type_lookup	    _bfd_norelocs_bfd_reloc_type_lookup
 #endif
+#ifndef coff_bfd_reloc_name_lookup
+#define coff_bfd_reloc_name_lookup    _bfd_norelocs_bfd_reloc_name_lookup
+#endif
 
 #ifndef coff_bfd_get_relocated_section_contents
 #define coff_bfd_get_relocated_section_contents \
Index: bfd/elf-hppa.h
===================================================================
RCS file: /cvs/src/src/bfd/elf-hppa.h,v
retrieving revision 1.83
diff -u -p -r1.83 elf-hppa.h
--- bfd/elf-hppa.h	7 Mar 2007 08:54:34 -0000	1.83
+++ bfd/elf-hppa.h	26 Mar 2007 00:12:28 -0000
@@ -1017,6 +1017,22 @@ elf_hppa_reloc_type_lookup (bfd *abfd AT
   return NULL;
 }
 
+static reloc_howto_type *
+elf_hppa_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (elf_hppa_howto_table) / sizeof (elf_hppa_howto_table[0]);
+       i++)
+    if (elf_hppa_howto_table[i].name != NULL
+	&& strcasecmp (elf_hppa_howto_table[i].name, r_name) == 0)
+      return &elf_hppa_howto_table[i];
+
+  return NULL;
+}
+
 /* Return TRUE if SYM represents a local label symbol.  */
 
 static bfd_boolean
Index: bfd/elf-m10200.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-m10200.c,v
retrieving revision 1.31
diff -u -p -r1.31 elf-m10200.c
--- bfd/elf-m10200.c	7 Mar 2007 08:54:34 -0000	1.31
+++ bfd/elf-m10200.c	26 Mar 2007 00:12:28 -0000
@@ -207,6 +207,23 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, c
   return NULL;
 }
 
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (elf_mn10200_howto_table)
+	    / sizeof (elf_mn10200_howto_table[0]));
+       i++)
+    if (elf_mn10200_howto_table[i].name != NULL
+	&& strcasecmp (elf_mn10200_howto_table[i].name, r_name) == 0)
+      return &elf_mn10200_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an MN10200 ELF reloc.  */
 
 static void
Index: bfd/elf-m10300.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-m10300.c,v
retrieving revision 1.79
diff -u -p -r1.79 elf-m10300.c
--- bfd/elf-m10300.c	7 Mar 2007 08:54:34 -0000	1.79
+++ bfd/elf-m10300.c	26 Mar 2007 00:12:30 -0000
@@ -637,6 +637,23 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, c
   return NULL;
 }
 
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (elf_mn10300_howto_table)
+	    / sizeof (elf_mn10300_howto_table[0]));
+       i++)
+    if (elf_mn10300_howto_table[i].name != NULL
+	&& strcasecmp (elf_mn10300_howto_table[i].name, r_name) == 0)
+      return &elf_mn10300_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an MN10300 ELF reloc.  */
 
 static void
Index: bfd/elf32-arc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arc.c,v
retrieving revision 1.17
diff -u -p -r1.17 elf32-arc.c
--- bfd/elf32-arc.c	1 Jul 2005 11:16:29 -0000	1.17
+++ bfd/elf32-arc.c	26 Mar 2007 00:12:31 -0000
@@ -1,5 +1,5 @@
 /* ARC-specific support for 32-bit ELF
-   Copyright 1994, 1995, 1997, 1999, 2001, 2002, 2005
+   Copyright 1994, 1995, 1997, 1999, 2001, 2002, 2005, 2007
    Free Software Foundation, Inc.
    Contributed by Doug Evans (dje@cygnus.com).
 
@@ -147,6 +147,22 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *ab
   return NULL;
 }
 
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (elf_arc_howto_table) / sizeof (elf_arc_howto_table[0]);
+       i++)
+    if (elf_arc_howto_table[i].name != NULL
+	&& strcasecmp (elf_arc_howto_table[i].name, r_name) == 0)
+      return &elf_arc_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an ARC ELF reloc.  */
 
 static void
Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.108
diff -u -p -r1.108 elf32-arm.c
--- bfd/elf32-arm.c	20 Mar 2007 20:19:07 -0000	1.108
+++ bfd/elf32-arm.c	26 Mar 2007 00:12:36 -0000
@@ -1787,6 +1787,31 @@ elf32_arm_reloc_type_lookup (bfd *abfd A
   return NULL;
 }
 
+static reloc_howto_type *
+elf32_arm_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			     const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (elf32_arm_howto_table_1)
+	    / sizeof (elf32_arm_howto_table_1[0]));
+       i++)
+    if (elf32_arm_howto_table_1[i].name != NULL
+	&& strcasecmp (elf32_arm_howto_table_1[i].name, r_name) == 0)
+      return &elf32_arm_howto_table_1[i];
+
+  for (i = 0;
+       i < (sizeof (elf32_arm_howto_table_2)
+	    / sizeof (elf32_arm_howto_table_2[0]));
+       i++)
+    if (elf32_arm_howto_table_2[i].name != NULL
+	&& strcasecmp (elf32_arm_howto_table_2[i].name, r_name) == 0)
+      return &elf32_arm_howto_table_2[i];
+
+  return NULL;
+}
+
 /* Support for core dump NOTE sections */
 static bfd_boolean
 elf32_arm_nabi_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
@@ -10579,6 +10604,7 @@ const struct elf_size_info elf32_arm_siz
 #define bfd_elf32_bfd_print_private_bfd_data	elf32_arm_print_private_bfd_data
 #define bfd_elf32_bfd_link_hash_table_create    elf32_arm_link_hash_table_create
 #define bfd_elf32_bfd_reloc_type_lookup		elf32_arm_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	elf32_arm_reloc_name_lookup
 #define bfd_elf32_find_nearest_line	        elf32_arm_find_nearest_line
 #define bfd_elf32_find_inliner_info	        elf32_arm_find_inliner_info
 #define bfd_elf32_new_section_hook		elf32_arm_new_section_hook
Index: bfd/elf32-avr.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-avr.c,v
retrieving revision 1.29
diff -u -p -r1.29 elf32-avr.c
--- bfd/elf32-avr.c	7 Mar 2007 08:54:34 -0000	1.29
+++ bfd/elf32-avr.c	26 Mar 2007 00:12:37 -0000
@@ -688,6 +688,22 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *ab
   return NULL;
 }
 
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (elf_avr_howto_table) / sizeof (elf_avr_howto_table[0]);
+       i++)
+    if (elf_avr_howto_table[i].name != NULL
+	&& strcasecmp (elf_avr_howto_table[i].name, r_name) == 0)
+      return &elf_avr_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an AVR ELF reloc.  */
 
 static void
Index: bfd/elf32-bfin.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-bfin.c,v
retrieving revision 1.18
diff -u -p -r1.18 elf32-bfin.c
--- bfd/elf32-bfin.c	7 Mar 2007 08:54:34 -0000	1.18
+++ bfd/elf32-bfin.c	26 Mar 2007 00:12:40 -0000
@@ -1057,8 +1057,8 @@ bfin_info_to_howto (bfd *abfd ATTRIBUTE_
 
   else
     cache_ptr->howto = (reloc_howto_type *) NULL;
-
 }
+
 /* Given a BFD reloc type, return the howto.  */
 static reloc_howto_type *
 bfin_bfd_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
@@ -1078,8 +1078,33 @@ bfin_bfd_reloc_type_lookup (bfd * abfd A
    return &bfin_gnuext_howto_table [r_type - BFIN_GNUEXT_RELOC_MIN];
 
   return (reloc_howto_type *) NULL;
+}
+
+static reloc_howto_type *
+bfin_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (bfin_howto_table)
+	    / sizeof (bfin_howto_table[0]));
+       i++)
+    if (bfin_howto_table[i].name != NULL
+	&& strcasecmp (bfin_howto_table[i].name, r_name) == 0)
+      return &bfin_howto_table[i];
+
+  for (i = 0;
+       i < (sizeof (bfin_gnuext_howto_table)
+	    / sizeof (bfin_gnuext_howto_table[0]));
+       i++)
+    if (bfin_gnuext_howto_table[i].name != NULL
+	&& strcasecmp (bfin_gnuext_howto_table[i].name, r_name) == 0)
+      return &bfin_gnuext_howto_table[i];
 
+  return NULL;
 }
+
 /* Given a bfin relocation type, return the howto.  */
 static reloc_howto_type *
 bfin_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
@@ -1092,7 +1117,6 @@ bfin_reloc_type_lookup (bfd * abfd ATTRI
    return &bfin_gnuext_howto_table [r_type - BFIN_GNUEXT_RELOC_MIN];
 
   return (reloc_howto_type *) NULL;
-
 }
 
 /* Return TRUE if the name is a local label.
@@ -5475,6 +5499,8 @@ error_return:
 #define elf_symbol_leading_char		'_'
 
 #define bfd_elf32_bfd_reloc_type_lookup	bfin_bfd_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup \
+					bfin_bfd_reloc_name_lookup
 #define elf_info_to_howto		bfin_info_to_howto
 #define elf_info_to_howto_rel		0
 #define elf_backend_object_p		elf32_bfin_object_p
Index: bfd/elf32-cr16c.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cr16c.c,v
retrieving revision 1.9
diff -u -p -r1.9 elf32-cr16c.c
--- bfd/elf32-cr16c.c	7 Mar 2007 08:54:34 -0000	1.9
+++ bfd/elf32-cr16c.c	26 Mar 2007 00:12:41 -0000
@@ -150,6 +150,20 @@ elf_cr16c_reloc_type_lookup (bfd *abfd A
   return 0;
 }
 
+static reloc_howto_type *
+elf_cr16c_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			     const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++)
+    if (elf_howto_table[i].name != NULL
+	&& strcasecmp (elf_howto_table[i].name, r_name) == 0)
+      return &elf_howto_table[i];
+
+  return NULL;
+}
+
 static void
 elf_cr16c_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
 			 arelent *cache_ptr ATTRIBUTE_UNUSED,
@@ -943,6 +957,7 @@ elf32_cr16c_link_output_symbol_hook (str
 #define elf_symbol_leading_char		'_'
 
 #define bfd_elf32_bfd_reloc_type_lookup		elf_cr16c_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	elf_cr16c_reloc_name_lookup
 #define elf_info_to_howto			elf_cr16c_info_to_howto
 #define elf_info_to_howto_rel			elf_cr16c_info_to_howto_rel
 #define elf_backend_relocate_section		elf32_cr16c_relocate_section
Index: bfd/elf32-cris.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cris.c,v
retrieving revision 1.78
diff -u -p -r1.78 elf32-cris.c
--- bfd/elf32-cris.c	7 Mar 2007 08:54:34 -0000	1.78
+++ bfd/elf32-cris.c	26 Mar 2007 00:12:42 -0000
@@ -457,6 +457,21 @@ cris_reloc_type_lookup (abfd, code)
   return NULL;
 }
 
+static reloc_howto_type *
+cris_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (cris_elf_howto_table) / sizeof (cris_elf_howto_table[0]);
+       i++)
+    if (cris_elf_howto_table[i].name != NULL
+	&& strcasecmp (cris_elf_howto_table[i].name, r_name) == 0)
+      return &cris_elf_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an CRIS ELF reloc.  */
 
 static void
@@ -3405,6 +3420,7 @@ elf_cris_reloc_type_class (rela)
 	cris_elf_copy_private_bfd_data
 
 #define bfd_elf32_bfd_reloc_type_lookup		cris_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	cris_reloc_name_lookup
 
 #define bfd_elf32_bfd_link_hash_table_create \
 	elf_cris_link_hash_table_create
Index: bfd/elf32-crx.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-crx.c,v
retrieving revision 1.9
diff -u -p -r1.9 elf32-crx.c
--- bfd/elf32-crx.c	7 Mar 2007 08:54:34 -0000	1.9
+++ bfd/elf32-crx.c	26 Mar 2007 00:12:43 -0000
@@ -399,6 +399,22 @@ elf_crx_reloc_type_lookup (bfd *abfd ATT
   return 0;
 }
 
+static reloc_howto_type *
+elf_crx_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			   const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (crx_elf_howto_table) / sizeof (crx_elf_howto_table[0]);
+       i++)
+    if (crx_elf_howto_table[i].name != NULL
+	&& strcasecmp (crx_elf_howto_table[i].name, r_name) == 0)
+      return &crx_elf_howto_table[i];
+
+  return NULL;
+}
+
 /* Retrieve a howto ptr using an internal relocation entry.  */
 
 static void
@@ -1311,6 +1327,8 @@ elf32_crx_relax_section (bfd *abfd, asec
 #define elf_symbol_leading_char		'_'
 
 #define bfd_elf32_bfd_reloc_type_lookup	elf_crx_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup \
+					elf_crx_reloc_name_lookup
 #define elf_info_to_howto		elf_crx_info_to_howto
 #define elf_info_to_howto_rel		0
 #define elf_backend_relocate_section	elf32_crx_relocate_section
Index: bfd/elf32-d10v.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-d10v.c,v
retrieving revision 1.33
diff -u -p -r1.33 elf32-d10v.c
--- bfd/elf32-d10v.c	7 Mar 2007 08:54:34 -0000	1.33
+++ bfd/elf32-d10v.c	26 Mar 2007 00:12:43 -0000
@@ -203,6 +203,22 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *ab
   return NULL;
 }
 
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (elf_d10v_howto_table) / sizeof (elf_d10v_howto_table[0]);
+       i++)
+    if (elf_d10v_howto_table[i].name != NULL
+	&& strcasecmp (elf_d10v_howto_table[i].name, r_name) == 0)
+      return &elf_d10v_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an D10V ELF reloc.  */
 
 static void
Index: bfd/elf32-d30v.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-d30v.c,v
retrieving revision 1.18
diff -u -p -r1.18 elf32-d30v.c
--- bfd/elf32-d30v.c	1 Jul 2005 11:16:29 -0000	1.18
+++ bfd/elf32-d30v.c	26 Mar 2007 00:12:43 -0000
@@ -1,5 +1,5 @@
 /* D30V-specific support for 32-bit ELF
-   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
    Free Software Foundation, Inc.
    Contributed by Martin Hunt (hunt@cygnus.com).
 
@@ -491,6 +491,22 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *ab
   return NULL;
 }
 
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (elf_d30v_howto_table) / sizeof (elf_d30v_howto_table[0]);
+       i++)
+    if (elf_d30v_howto_table[i].name != NULL
+	&& strcasecmp (elf_d30v_howto_table[i].name, r_name) == 0)
+      return &elf_d30v_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an D30V ELF reloc (type REL).  */
 
 static void
Index: bfd/elf32-dlx.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-dlx.c,v
retrieving revision 1.17
diff -u -p -r1.17 elf32-dlx.c
--- bfd/elf32-dlx.c	2 May 2006 10:01:56 -0000	1.17
+++ bfd/elf32-dlx.c	26 Mar 2007 00:12:44 -0000
@@ -1,5 +1,6 @@
 /* DLX specific support for 32-bit ELF
-   Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright 2002, 2003, 2004, 2005, 2007
+   Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -27,6 +28,7 @@
 #define USE_REL 1
 
 #define bfd_elf32_bfd_reloc_type_lookup elf32_dlx_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup elf32_dlx_reloc_name_lookup
 #define elf_info_to_howto               elf32_dlx_info_to_howto
 #define elf_info_to_howto_rel           elf32_dlx_info_to_howto_rel
 #define elf_backend_check_relocs        elf32_dlx_check_relocs
@@ -506,6 +508,31 @@ elf32_dlx_reloc_type_lookup (bfd *abfd A
 }
 
 static reloc_howto_type *
+elf32_dlx_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			     const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (dlx_elf_howto_table) / sizeof (dlx_elf_howto_table[0]);
+       i++)
+    if (dlx_elf_howto_table[i].name != NULL
+	&& strcasecmp (dlx_elf_howto_table[i].name, r_name) == 0)
+      return &dlx_elf_howto_table[i];
+
+  if (strcasecmp (elf_dlx_gnu_rel16_s2.name, r_name) == 0)
+    return &elf_dlx_gnu_rel16_s2;
+  if (strcasecmp (elf_dlx_gnu_rel26_s2.name, r_name) == 0)
+    return &elf_dlx_gnu_rel26_s2;
+  if (strcasecmp (elf_dlx_reloc_16_hi.name, r_name) == 0)
+    return &elf_dlx_reloc_16_hi;
+  if (strcasecmp (elf_dlx_reloc_16_lo.name, r_name) == 0)
+    return &elf_dlx_reloc_16_lo;
+
+  return NULL;
+}
+
+static reloc_howto_type *
 dlx_rtype_to_howto (unsigned int r_type)
 {
   switch (r_type)
Index: bfd/elf32-fr30.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-fr30.c,v
retrieving revision 1.32
diff -u -p -r1.32 elf32-fr30.c
--- bfd/elf32-fr30.c	7 Mar 2007 08:54:34 -0000	1.32
+++ bfd/elf32-fr30.c	26 Mar 2007 00:12:44 -0000
@@ -366,6 +366,21 @@ fr30_reloc_type_lookup (abfd, code)
   return NULL;
 }
 
+static reloc_howto_type *
+fr30_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (fr30_elf_howto_table) / sizeof (fr30_elf_howto_table[0]);
+       i++)
+    if (fr30_elf_howto_table[i].name != NULL
+	&& strcasecmp (fr30_elf_howto_table[i].name, r_name) == 0)
+      return &fr30_elf_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an FR30 ELF reloc.  */
 
 static void
@@ -727,5 +742,6 @@ fr30_elf_check_relocs (abfd, info, sec, 
 #define elf_backend_rela_normal			1
 
 #define bfd_elf32_bfd_reloc_type_lookup		fr30_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	fr30_reloc_name_lookup
 
 #include "elf32-target.h"
Index: bfd/elf32-frv.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-frv.c,v
retrieving revision 1.50
diff -u -p -r1.50 elf32-frv.c
--- bfd/elf32-frv.c	7 Mar 2007 08:54:34 -0000	1.50
+++ bfd/elf32-frv.c	26 Mar 2007 00:12:47 -0000
@@ -2590,6 +2590,26 @@ frv_reloc_type_lookup (abfd, code)
   return NULL;
 }
 
+static reloc_howto_type *
+frv_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (elf32_frv_howto_table) / sizeof (elf32_frv_howto_table[0]);
+       i++)
+    if (elf32_frv_howto_table[i].name != NULL
+	&& strcasecmp (elf32_frv_howto_table[i].name, r_name) == 0)
+      return &elf32_frv_howto_table[i];
+
+  if (strcasecmp (elf32_frv_vtinherit_howto.name, r_name) == 0)
+    return &elf32_frv_vtinherit_howto;
+  if (strcasecmp (elf32_frv_vtentry_howto.name, r_name) == 0)
+    return &elf32_frv_vtentry_howto;
+
+  return NULL;
+}
+
 /* Set the howto pointer for an FRV ELF reloc.  */
 
 static void
@@ -6866,6 +6886,7 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_In
 #define elf_backend_rela_normal			1
 
 #define bfd_elf32_bfd_reloc_type_lookup		frv_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	frv_reloc_name_lookup
 #define bfd_elf32_bfd_set_private_flags		frv_elf_set_private_flags
 #define bfd_elf32_bfd_copy_private_bfd_data	frv_elf_copy_private_bfd_data
 #define bfd_elf32_bfd_merge_private_bfd_data	frv_elf_merge_private_bfd_data
Index: bfd/elf32-gen.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-gen.c,v
retrieving revision 1.15
diff -u -p -r1.15 elf32-gen.c
--- bfd/elf32-gen.c	4 May 2005 15:53:13 -0000	1.15
+++ bfd/elf32-gen.c	26 Mar 2007 00:12:47 -0000
@@ -94,6 +94,7 @@ elf32_generic_link_add_symbols (bfd *abf
 #define ELF_MACHINE_CODE		EM_NONE
 #define ELF_MAXPAGESIZE			0x1
 #define bfd_elf32_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
 #define bfd_elf32_bfd_link_add_symbols	elf32_generic_link_add_symbols
 #define elf_info_to_howto		elf_generic_info_to_howto
 #define elf_info_to_howto_rel		elf_generic_info_to_howto_rel
Index: bfd/elf32-h8300.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-h8300.c,v
retrieving revision 1.50
diff -u -p -r1.50 elf32-h8300.c
--- bfd/elf32-h8300.c	7 Mar 2007 08:54:34 -0000	1.50
+++ bfd/elf32-h8300.c	26 Mar 2007 00:12:48 -0000
@@ -251,6 +251,22 @@ elf32_h8_reloc_type_lookup (bfd *abfd AT
   return NULL;
 }
 
+static reloc_howto_type *
+elf32_h8_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (h8_elf_howto_table) / sizeof (h8_elf_howto_table[0]);
+       i++)
+    if (h8_elf_howto_table[i].name != NULL
+	&& strcasecmp (h8_elf_howto_table[i].name, r_name) == 0)
+      return &h8_elf_howto_table[i];
+
+  return NULL;
+}
+
 static void
 elf32_h8_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc,
 			Elf_Internal_Rela *elf_reloc)
@@ -1502,6 +1518,7 @@ elf32_h8_get_relocated_section_contents 
 #define ELF_MACHINE_CODE		EM_H8_300
 #define ELF_MAXPAGESIZE			0x1
 #define bfd_elf32_bfd_reloc_type_lookup elf32_h8_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup elf32_h8_reloc_name_lookup
 #define elf_info_to_howto		elf32_h8_info_to_howto
 #define elf_info_to_howto_rel		elf32_h8_info_to_howto_rel
 
Index: bfd/elf32-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-hppa.c,v
retrieving revision 1.152
diff -u -p -r1.152 elf32-hppa.c
--- bfd/elf32-hppa.c	14 Mar 2007 02:56:45 -0000	1.152
+++ bfd/elf32-hppa.c	26 Mar 2007 00:12:50 -0000
@@ -4615,6 +4615,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Inte
 /* Misc BFD support code.  */
 #define bfd_elf32_bfd_is_local_label_name    elf_hppa_is_local_label_name
 #define bfd_elf32_bfd_reloc_type_lookup	     elf_hppa_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup elf_hppa_reloc_name_lookup
 #define elf_info_to_howto		     elf_hppa_info_to_howto
 #define elf_info_to_howto_rel		     elf_hppa_info_to_howto_rel
 
Index: bfd/elf32-i370.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i370.c,v
retrieving revision 1.58
diff -u -p -r1.58 elf32-i370.c
--- bfd/elf32-i370.c	14 Mar 2007 02:56:45 -0000	1.58
+++ bfd/elf32-i370.c	26 Mar 2007 00:12:52 -0000
@@ -1,6 +1,6 @@
 /* i370-specific support for 32-bit ELF
    Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006 Free Software Foundation, Inc.
+   2005, 2006, 2007 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
    Hacked by Linas Vepstas for i370 linas@linas.org
 
@@ -267,6 +267,22 @@ i370_elf_reloc_type_lookup (bfd *abfd AT
   return i370_elf_howto_table[ (int)i370_reloc ];
 };
 
+static reloc_howto_type *
+i370_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (i370_elf_howto_raw) / sizeof (i370_elf_howto_raw[0]);
+       i++)
+    if (i370_elf_howto_raw[i].name != NULL
+	&& strcasecmp (i370_elf_howto_raw[i].name, r_name) == 0)
+      return &i370_elf_howto_raw[i];
+
+  return NULL;
+}
+
 /* The name of the dynamic interpreter.  This is put in the .interp
     section.  */
 
@@ -1434,6 +1450,7 @@ i370_elf_relocate_section (bfd *output_b
 #define elf_backend_rela_normal    1
 
 #define bfd_elf32_bfd_reloc_type_lookup		i370_elf_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	i370_elf_reloc_name_lookup
 #define bfd_elf32_bfd_set_private_flags		i370_elf_set_private_flags
 #define bfd_elf32_bfd_merge_private_bfd_data	i370_elf_merge_private_bfd_data
 #define elf_backend_relocate_section		i370_elf_relocate_section
Index: bfd/elf32-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i386.c,v
retrieving revision 1.170
diff -u -p -r1.170 elf32-i386.c
--- bfd/elf32-i386.c	14 Mar 2007 02:56:45 -0000	1.170
+++ bfd/elf32-i386.c	26 Mar 2007 00:12:53 -0000
@@ -330,6 +330,20 @@ elf_i386_reloc_type_lookup (bfd *abfd AT
   return 0;
 }
 
+static reloc_howto_type *
+elf_i386_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++)
+    if (elf_howto_table[i].name != NULL
+	&& strcasecmp (elf_howto_table[i].name, r_name) == 0)
+      return &elf_howto_table[i];
+
+  return NULL;
+}
+
 static void
 elf_i386_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
 			    arelent *cache_ptr,
@@ -3818,6 +3832,7 @@ elf_i386_hash_symbol (struct elf_link_ha
 #define bfd_elf32_bfd_is_local_label_name     elf_i386_is_local_label_name
 #define bfd_elf32_bfd_link_hash_table_create  elf_i386_link_hash_table_create
 #define bfd_elf32_bfd_reloc_type_lookup	      elf_i386_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup elf_i386_reloc_name_lookup
 
 #define elf_backend_adjust_dynamic_symbol     elf_i386_adjust_dynamic_symbol
 #define elf_backend_check_relocs	      elf_i386_check_relocs
Index: bfd/elf32-i860.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i860.c,v
retrieving revision 1.38
diff -u -p -r1.38 elf32-i860.c
--- bfd/elf32-i860.c	7 Mar 2007 08:54:34 -0000	1.38
+++ bfd/elf32-i860.c	26 Mar 2007 00:12:56 -0000
@@ -886,6 +886,23 @@ elf32_i860_reloc_type_lookup (bfd *abfd 
   return lookup_howto (rtype);
 }
 
+static reloc_howto_type *
+elf32_i860_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			      const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (elf32_i860_howto_table)
+	    / sizeof (elf32_i860_howto_table[0]));
+       i++)
+    if (elf32_i860_howto_table[i].name != NULL
+	&& strcasecmp (elf32_i860_howto_table[i].name, r_name) == 0)
+      return &elf32_i860_howto_table[i];
+
+  return NULL;
+}
+
 /* Given a ELF reloc, return the matching HOWTO structure.  */
 static void
 elf32_i860_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
@@ -1252,6 +1269,7 @@ elf32_i860_is_local_label_name (bfd *abf
 #define elf_info_to_howto			elf32_i860_info_to_howto_rela
 #define elf_backend_relocate_section		elf32_i860_relocate_section
 #define bfd_elf32_bfd_reloc_type_lookup		elf32_i860_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	elf32_i860_reloc_name_lookup
 #define bfd_elf32_bfd_is_local_label_name	elf32_i860_is_local_label_name
 
 #include "elf32-target.h"
Index: bfd/elf32-i960.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i960.c,v
retrieving revision 1.14
diff -u -p -r1.14 elf32-i960.c
--- bfd/elf32-i960.c	1 Jul 2005 11:16:29 -0000	1.14
+++ bfd/elf32-i960.c	26 Mar 2007 00:12:56 -0000
@@ -1,5 +1,6 @@
 /* Intel 960 specific support for 32-bit ELF
-   Copyright 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2007
+   Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -27,6 +28,8 @@
 #define USE_REL 1
 
 #define bfd_elf32_bfd_reloc_type_lookup	elf32_i960_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup \
+  elf32_i960_reloc_name_lookup
 #define elf_info_to_howto		elf32_i960_info_to_howto
 #define elf_info_to_howto_rel		elf32_i960_info_to_howto_rel
 
@@ -142,6 +145,20 @@ elf32_i960_reloc_type_lookup (bfd *abfd 
   return elf_howto_table + elf32_i960_bfd_to_reloc_type (code);
 }
 
+static reloc_howto_type *
+elf32_i960_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			      const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++)
+    if (elf_howto_table[i].name != NULL
+	&& strcasecmp (elf_howto_table[i].name, r_name) == 0)
+      return &elf_howto_table[i];
+
+  return NULL;
+}
+
 #define TARGET_LITTLE_SYM	bfd_elf32_i960_vec
 #define TARGET_LITTLE_NAME	"elf32-i960"
 #define ELF_ARCH		bfd_arch_i960
Index: bfd/elf32-ip2k.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ip2k.c,v
retrieving revision 1.22
diff -u -p -r1.22 elf32-ip2k.c
--- bfd/elf32-ip2k.c	7 Mar 2007 08:54:34 -0000	1.22
+++ bfd/elf32-ip2k.c	26 Mar 2007 00:12:56 -0000
@@ -223,6 +223,21 @@ ip2k_reloc_type_lookup (bfd * abfd ATTRI
   return NULL;
 }
 
+static reloc_howto_type *
+ip2k_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (ip2k_elf_howto_table) / sizeof (ip2k_elf_howto_table[0]);
+       i++)
+    if (ip2k_elf_howto_table[i].name != NULL
+	&& strcasecmp (ip2k_elf_howto_table[i].name, r_name) == 0)
+      return &ip2k_elf_howto_table[i];
+
+  return NULL;
+}
+
 static void
 ip2k_get_mem (bfd *abfd ATTRIBUTE_UNUSED,
 	      bfd_byte *addr,
@@ -1529,6 +1544,7 @@ ip2k_elf_relocate_section (bfd *output_b
 
 #define elf_symbol_leading_char			'_'
 #define bfd_elf32_bfd_reloc_type_lookup		ip2k_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	ip2k_reloc_name_lookup
 #define bfd_elf32_bfd_relax_section		ip2k_elf_relax_section
 
 #include "elf32-target.h"
Index: bfd/elf32-iq2000.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-iq2000.c,v
retrieving revision 1.18
diff -u -p -r1.18 elf32-iq2000.c
--- bfd/elf32-iq2000.c	7 Mar 2007 08:54:34 -0000	1.18
+++ bfd/elf32-iq2000.c	26 Mar 2007 00:12:56 -0000
@@ -350,6 +350,26 @@ iq2000_reloc_type_lookup (bfd *abfd ATTR
   return NULL;
 }
 
+static reloc_howto_type *
+iq2000_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (iq2000_elf_howto_table)
+	    / sizeof (iq2000_elf_howto_table[0]));
+       i++)
+    if (iq2000_elf_howto_table[i].name != NULL
+	&& strcasecmp (iq2000_elf_howto_table[i].name, r_name) == 0)
+      return &iq2000_elf_howto_table[i];
+
+  if (strcasecmp (iq2000_elf_vtinherit_howto.name, r_name) == 0)
+    return &iq2000_elf_vtinherit_howto;
+  if (strcasecmp (iq2000_elf_vtentry_howto.name, r_name) == 0)
+    return &iq2000_elf_vtentry_howto;
+
+  return NULL;
+}
 
 /* Perform a single relocation.	 By default we use the standard BFD
    routines.  */
@@ -864,6 +884,7 @@ iq2000_elf_object_p (bfd *abfd)
 #define elf_backend_can_gc_sections		1
 
 #define bfd_elf32_bfd_reloc_type_lookup		iq2000_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	iq2000_reloc_name_lookup
 #define bfd_elf32_bfd_set_private_flags		iq2000_elf_set_private_flags
 #define bfd_elf32_bfd_copy_private_bfd_data	iq2000_elf_copy_private_bfd_data
 #define bfd_elf32_bfd_merge_private_bfd_data	iq2000_elf_merge_private_bfd_data
Index: bfd/elf32-m32c.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m32c.c,v
retrieving revision 1.11
diff -u -p -r1.11 elf32-m32c.c
--- bfd/elf32-m32c.c	7 Mar 2007 08:54:34 -0000	1.11
+++ bfd/elf32-m32c.c	26 Mar 2007 00:12:56 -0000
@@ -272,6 +272,21 @@ m32c_reloc_type_lookup
   return NULL;
 }
 
+static reloc_howto_type *
+m32c_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (m32c_elf_howto_table) / sizeof (m32c_elf_howto_table[0]);
+       i++)
+    if (m32c_elf_howto_table[i].name != NULL
+	&& strcasecmp (m32c_elf_howto_table[i].name, r_name) == 0)
+      return &m32c_elf_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an M32C ELF reloc.  */
 
 static void
@@ -2003,6 +2018,7 @@ m32c_elf_relax_delete_bytes
 #define elf_backend_can_gc_sections		1
 
 #define bfd_elf32_bfd_reloc_type_lookup		m32c_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	m32c_reloc_name_lookup
 #define bfd_elf32_bfd_relax_section		m32c_elf_relax_section
 #define bfd_elf32_bfd_set_private_flags		m32c_elf_set_private_flags
 #define bfd_elf32_bfd_merge_private_bfd_data	m32c_elf_merge_private_bfd_data
Index: bfd/elf32-m32r.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m32r.c,v
retrieving revision 1.84
diff -u -p -r1.84 elf32-m32r.c
--- bfd/elf32-m32r.c	7 Mar 2007 08:54:34 -0000	1.84
+++ bfd/elf32-m32r.c	26 Mar 2007 00:12:58 -0000
@@ -1254,6 +1254,22 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *ab
   return NULL;
 }
 
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (m32r_elf_howto_table) / sizeof (m32r_elf_howto_table[0]);
+       i++)
+    if (m32r_elf_howto_table[i].name != NULL
+	&& strcasecmp (m32r_elf_howto_table[i].name, r_name) == 0)
+      return &m32r_elf_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an M32R ELF reloc.  */
 
 static void
Index: bfd/elf32-m68hc11.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68hc11.c,v
retrieving revision 1.34
diff -u -p -r1.34 elf32-m68hc11.c
--- bfd/elf32-m68hc11.c	28 Sep 2006 13:27:33 -0000	1.34
+++ bfd/elf32-m68hc11.c	26 Mar 2007 00:12:59 -0000
@@ -1,5 +1,5 @@
 /* Motorola 68HC11-specific support for 32-bit ELF
-   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    Contributed by Stephane Carrez (stcarrez@nerim.fr)
    (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com))
@@ -358,6 +358,23 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *ab
   return NULL;
 }
 
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (elf_m68hc11_howto_table)
+	    / sizeof (elf_m68hc11_howto_table[0]));
+       i++)
+    if (elf_m68hc11_howto_table[i].name != NULL
+	&& strcasecmp (elf_m68hc11_howto_table[i].name, r_name) == 0)
+      return &elf_m68hc11_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an M68HC11 ELF reloc.  */
 
 static void
Index: bfd/elf32-m68hc12.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68hc12.c,v
retrieving revision 1.26
diff -u -p -r1.26 elf32-m68hc12.c
--- bfd/elf32-m68hc12.c	28 Sep 2006 13:27:33 -0000	1.26
+++ bfd/elf32-m68hc12.c	26 Mar 2007 00:12:59 -0000
@@ -1,5 +1,5 @@
 /* Motorola 68HC12-specific support for 32-bit ELF
-   Copyright 1999, 2000, 2002, 2003, 2004, 2005, 2006
+   Copyright 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    Contributed by Stephane Carrez (stcarrez@nerim.fr)
    (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com))
@@ -407,6 +407,23 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *ab
   return NULL;
 }
 
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (elf_m68hc11_howto_table)
+	    / sizeof (elf_m68hc11_howto_table[0]));
+       i++)
+    if (elf_m68hc11_howto_table[i].name != NULL
+	&& strcasecmp (elf_m68hc11_howto_table[i].name, r_name) == 0)
+      return &elf_m68hc11_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an M68HC11 ELF reloc.  */
 
 static void
Index: bfd/elf32-m68k.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68k.c,v
retrieving revision 1.98
diff -u -p -r1.98 elf32-m68k.c
--- bfd/elf32-m68k.c	7 Mar 2007 08:54:34 -0000	1.98
+++ bfd/elf32-m68k.c	26 Mar 2007 00:13:00 -0000
@@ -174,7 +174,21 @@ reloc_type_lookup (abfd, code)
   return 0;
 }
 
+static reloc_howto_type *
+reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++)
+    if (howto_table[i].name != NULL
+	&& strcasecmp (howto_table[i].name, r_name) == 0)
+      return &howto_table[i];
+
+  return NULL;
+}
+
 #define bfd_elf32_bfd_reloc_type_lookup reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup reloc_name_lookup
 #define ELF_ARCH bfd_arch_m68k
 
 /* Functions for the m68k ELF linker.  */
Index: bfd/elf32-m88k.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m88k.c,v
retrieving revision 1.5
diff -u -p -r1.5 elf32-m88k.c
--- bfd/elf32-m88k.c	4 May 2005 15:53:17 -0000	1.5
+++ bfd/elf32-m88k.c	26 Mar 2007 00:13:00 -0000
@@ -31,6 +31,7 @@ Foundation, Inc., 51 Franklin Street - F
 #define ELF_MACHINE_CODE	EM_88K
 #define ELF_MAXPAGESIZE  	1 /* FIXME: This number is wrong,  It should be the page size in bytes.  */
 #define bfd_elf32_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
 #define elf_info_to_howto		_bfd_elf_no_info_to_howto
 
 #include "elf32-target.h"
Index: bfd/elf32-mcore.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-mcore.c,v
retrieving revision 1.47
diff -u -p -r1.47 elf32-mcore.c
--- bfd/elf32-mcore.c	7 Mar 2007 08:54:34 -0000	1.47
+++ bfd/elf32-mcore.c	26 Mar 2007 00:13:01 -0000
@@ -317,6 +317,22 @@ mcore_elf_reloc_type_lookup (bfd * abfd 
   return mcore_elf_howto_table [(int) mcore_reloc];
 };
 
+static reloc_howto_type *
+mcore_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			     const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (mcore_elf_howto_raw) / sizeof (mcore_elf_howto_raw[0]);
+       i++)
+    if (mcore_elf_howto_raw[i].name != NULL
+	&& strcasecmp (mcore_elf_howto_raw[i].name, r_name) == 0)
+      return &mcore_elf_howto_raw[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for a RCE ELF reloc.  */
 
 static void
@@ -651,6 +667,7 @@ static const struct bfd_elf_special_sect
 #define bfd_elf32_bfd_merge_private_bfd_data	mcore_elf_merge_private_bfd_data
 #define bfd_elf32_bfd_set_private_flags		mcore_elf_set_private_flags
 #define bfd_elf32_bfd_reloc_type_lookup		mcore_elf_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	mcore_elf_reloc_name_lookup
 #define elf_backend_relocate_section		mcore_elf_relocate_section
 #define elf_backend_gc_mark_hook		mcore_elf_gc_mark_hook
 #define elf_backend_gc_sweep_hook		mcore_elf_gc_sweep_hook
Index: bfd/elf32-mep.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-mep.c,v
retrieving revision 1.2
diff -u -p -r1.2 elf32-mep.c
--- bfd/elf32-mep.c	7 Mar 2007 08:54:34 -0000	1.2
+++ bfd/elf32-mep.c	26 Mar 2007 00:13:01 -0000
@@ -168,6 +168,20 @@ mep_reloc_type_lookup
 
 #undef MAP
 
+static reloc_howto_type *
+mep_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (mep_elf_howto_table) / sizeof (mep_elf_howto_table[0]);
+       i++)
+    if (mep_elf_howto_table[i].name != NULL
+	&& strcasecmp (mep_elf_howto_table[i].name, r_name) == 0)
+      return &mep_elf_howto_table[i];
+
+  return NULL;
+}
 
 /* Perform a single relocation.  */
 
@@ -929,6 +943,7 @@ mep_elf_fake_sections (bfd *            
 #define elf_backend_can_gc_sections		1
 
 #define bfd_elf32_bfd_reloc_type_lookup		mep_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	mep_reloc_name_lookup
 #define bfd_elf32_bfd_set_private_flags		mep_elf_set_private_flags
 #define bfd_elf32_bfd_copy_private_bfd_data	mep_elf_copy_private_bfd_data
 #define bfd_elf32_bfd_merge_private_bfd_data	mep_elf_merge_private_bfd_data
Index: bfd/elf32-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-mips.c,v
retrieving revision 1.193
diff -u -p -r1.193 elf32-mips.c
--- bfd/elf32-mips.c	28 Oct 2006 10:13:49 -0000	1.193
+++ bfd/elf32-mips.c	26 Mar 2007 00:13:02 -0000
@@ -1,6 +1,6 @@
 /* MIPS-specific support for 32-bit ELF
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2007 Free Software Foundation, Inc.
 
    Most of the information added by Ian Lance Taylor, Cygnus Support,
    <ian@cygnus.com>.
@@ -1274,6 +1274,40 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *ab
     }
 }
 
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (elf_mips_howto_table_rel)
+	    / sizeof (elf_mips_howto_table_rel[0]));
+       i++)
+    if (elf_mips_howto_table_rel[i].name != NULL
+	&& strcasecmp (elf_mips_howto_table_rel[i].name, r_name) == 0)
+      return &elf_mips_howto_table_rel[i];
+
+  for (i = 0;
+       i < (sizeof (elf_mips16_howto_table_rel)
+	    / sizeof (elf_mips16_howto_table_rel[0]));
+       i++)
+    if (elf_mips16_howto_table_rel[i].name != NULL
+	&& strcasecmp (elf_mips16_howto_table_rel[i].name, r_name) == 0)
+      return &elf_mips16_howto_table_rel[i];
+
+  if (strcasecmp (elf_mips_gnu_pcrel32.name, r_name) == 0)
+    return &elf_mips_gnu_pcrel32;
+  if (strcasecmp (elf_mips_gnu_rel16_s2.name, r_name) == 0)
+    return &elf_mips_gnu_rel16_s2;
+  if (strcasecmp (elf_mips_gnu_vtinherit_howto.name, r_name) == 0)
+    return &elf_mips_gnu_vtinherit_howto;
+  if (strcasecmp (elf_mips_gnu_vtentry_howto.name, r_name) == 0)
+    return &elf_mips_gnu_vtentry_howto;
+
+  return NULL;
+}
+
 /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure.  */
 
 static reloc_howto_type *
@@ -1664,6 +1698,17 @@ mips_vxworks_bfd_reloc_type_lookup (bfd 
     }
 }
 
+static reloc_howto_type *
+mips_vxworks_bfd_reloc_name_lookup (bfd *abfd, const char *r_name)
+{
+  if (strcasecmp (mips_vxworks_copy_howto_rela.name, r_name) == 0)
+    return &mips_vxworks_copy_howto_rela;
+  if (strcasecmp (mips_vxworks_jump_slot_howto_rela.name, r_name) == 0)
+    return &mips_vxworks_jump_slot_howto_rela;
+
+  return bfd_elf32_bfd_reloc_name_lookup (abfd, r_name);
+}
+
 /* Implement elf_backend_mips_rtype_to_lookup for VxWorks.  */
 
 static reloc_howto_type *
@@ -1730,6 +1775,9 @@ mips_vxworks_final_write_processing (bfd
 #undef bfd_elf32_bfd_reloc_type_lookup
 #define bfd_elf32_bfd_reloc_type_lookup \
   mips_vxworks_bfd_reloc_type_lookup
+#undef bfd_elf32_bfd_reloc_name_lookup
+#define bfd_elf32_bfd_reloc_name_lookup \
+  mips_vxworks_bfd_reloc_name_lookup
 #undef elf_backend_mips_rtype_to_howto
 #define elf_backend_mips_rtype_to_howto	\
   mips_vxworks_rtype_to_howto
Index: bfd/elf32-msp430.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-msp430.c,v
retrieving revision 1.16
diff -u -p -r1.16 elf32-msp430.c
--- bfd/elf32-msp430.c	14 Mar 2007 02:56:45 -0000	1.16
+++ bfd/elf32-msp430.c	26 Mar 2007 00:13:02 -0000
@@ -200,6 +200,23 @@ bfd_elf32_bfd_reloc_type_lookup (bfd * a
   return NULL;
 }
 
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (elf_msp430_howto_table)
+	    / sizeof (elf_msp430_howto_table[0]));
+       i++)
+    if (elf_msp430_howto_table[i].name != NULL
+	&& strcasecmp (elf_msp430_howto_table[i].name, r_name) == 0)
+      return &elf_msp430_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an MSP430 ELF reloc.  */
 
 static void
Index: bfd/elf32-mt.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-mt.c,v
retrieving revision 1.6
diff -u -p -r1.6 elf32-mt.c
--- bfd/elf32-mt.c	7 Mar 2007 08:54:34 -0000	1.6
+++ bfd/elf32-mt.c	26 Mar 2007 00:13:03 -0000
@@ -187,6 +187,22 @@ mt_reloc_type_lookup
   return NULL;
 }
 
+static reloc_howto_type *
+mt_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+		      const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (mt_elf_howto_table) / sizeof (mt_elf_howto_table[0]);
+       i++)
+    if (mt_elf_howto_table[i].name != NULL
+	&& strcasecmp (mt_elf_howto_table[i].name, r_name) == 0)
+      return &mt_elf_howto_table[i];
+
+  return NULL;
+}
+
 bfd_reloc_status_type
 mt_elf_relocate_hi16
     (bfd *               input_bfd,
@@ -592,6 +608,7 @@ mt_elf_print_private_bfd_data (bfd * abf
 #define elf_backend_relocate_section		mt_elf_relocate_section
 
 #define bfd_elf32_bfd_reloc_type_lookup	        mt_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup   mt_reloc_name_lookup
 
 #define elf_backend_check_relocs                mt_elf_check_relocs
 #define elf_backend_object_p		        mt_elf_object_p
Index: bfd/elf32-openrisc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-openrisc.c,v
retrieving revision 1.25
diff -u -p -r1.25 elf32-openrisc.c
--- bfd/elf32-openrisc.c	7 Mar 2007 08:54:34 -0000	1.25
+++ bfd/elf32-openrisc.c	26 Mar 2007 00:13:03 -0000
@@ -192,9 +192,9 @@ static const struct openrisc_reloc_map o
   { BFD_RELOC_32, 		R_OPENRISC_32 },
   { BFD_RELOC_16, 		R_OPENRISC_16 },
   { BFD_RELOC_8, 		R_OPENRISC_8 },
-  { BFD_RELOC_OPENRISC_REL_26,R_OPENRISC_INSN_REL_26 },
-  { BFD_RELOC_OPENRISC_ABS_26,R_OPENRISC_INSN_ABS_26 },
-    { BFD_RELOC_HI16, 		R_OPENRISC_HI_16_IN_INSN },
+  { BFD_RELOC_OPENRISC_REL_26,	R_OPENRISC_INSN_REL_26 },
+  { BFD_RELOC_OPENRISC_ABS_26,	R_OPENRISC_INSN_ABS_26 },
+  { BFD_RELOC_HI16, 		R_OPENRISC_HI_16_IN_INSN },
   { BFD_RELOC_LO16, 		R_OPENRISC_LO_16_IN_INSN },
   { BFD_RELOC_VTABLE_INHERIT,	R_OPENRISC_GNU_VTINHERIT },
   { BFD_RELOC_VTABLE_ENTRY, 	R_OPENRISC_GNU_VTENTRY }
@@ -214,6 +214,23 @@ openrisc_reloc_type_lookup (bfd * abfd A
   return NULL;
 }
 
+static reloc_howto_type *
+openrisc_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (openrisc_elf_howto_table)
+	    / sizeof (openrisc_elf_howto_table[0]));
+       i++)
+    if (openrisc_elf_howto_table[i].name != NULL
+	&& strcasecmp (openrisc_elf_howto_table[i].name, r_name) == 0)
+      return &openrisc_elf_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an OpenRISC ELF reloc.  */
 
 static void
@@ -550,6 +567,7 @@ openrisc_elf_final_write_processing (bfd
 #define elf_backend_rela_normal		1
 
 #define bfd_elf32_bfd_reloc_type_lookup openrisc_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup openrisc_reloc_name_lookup
 
 #define elf_backend_object_p                openrisc_elf_object_p
 #define elf_backend_final_write_processing  openrisc_elf_final_write_processing
Index: bfd/elf32-or32.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-or32.c,v
retrieving revision 1.10
diff -u -p -r1.10 elf32-or32.c
--- bfd/elf32-or32.c	1 Jul 2005 11:16:29 -0000	1.10
+++ bfd/elf32-or32.c	26 Mar 2007 00:13:03 -0000
@@ -1,5 +1,5 @@
 /* OR32-specific support for 32-bit ELF
-   Copyright 2002, 2004, 2005 Free Software Foundation, Inc.
+   Copyright 2002, 2004, 2005, 2007 Free Software Foundation, Inc.
    Contributed by Ivan Guzvinec  <ivang@opencores.org>
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -466,6 +466,22 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *ab
   return NULL;
 }
 
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (elf_or32_howto_table) / sizeof (elf_or32_howto_table[0]);
+       i++)
+    if (elf_or32_howto_table[i].name != NULL
+	&& strcasecmp (elf_or32_howto_table[i].name, r_name) == 0)
+      return &elf_or32_howto_table[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an OR32 ELF reloc.  */
 
 static void
Index: bfd/elf32-pj.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-pj.c,v
retrieving revision 1.10
diff -u -p -r1.10 elf32-pj.c
--- bfd/elf32-pj.c	1 Jul 2005 11:16:29 -0000	1.10
+++ bfd/elf32-pj.c	26 Mar 2007 00:13:03 -0000
@@ -1,5 +1,6 @@
 /* picoJava specific support for 32-bit ELF
-   Copyright 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002, 2005, 2007
+   Free Software Foundation, Inc.
    Contributed by Steve Chamberlan of Transmeta (sac@pobox.com).
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -291,6 +292,22 @@ pj_elf_reloc_type_lookup (bfd *abfd ATTR
   return NULL;
 }
 
+static reloc_howto_type *
+pj_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			  const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (pj_elf_howto_table) / sizeof (pj_elf_howto_table[0]);
+       i++)
+    if (pj_elf_howto_table[i].name != NULL
+	&& strcasecmp (pj_elf_howto_table[i].name, r_name) == 0)
+      return &pj_elf_howto_table[i];
+
+  return NULL;
+}
+
 /* Given an ELF reloc, fill in the howto field of a relent.  */
 
 static void
@@ -326,8 +343,10 @@ pj_elf_final_write_processing (bfd *abfd
 #define ELF_MACHINE_CODE	EM_PJ
 #define ELF_MACHINE_ALT1	EM_PJ_OLD
 #define ELF_MAXPAGESIZE		0x1000
-#define bfd_elf32_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define bfd_elf32_bfd_reloc_type_lookup	             pj_elf_reloc_type_lookup
-#define elf_backend_final_write_processing           pj_elf_final_write_processing
-#define elf_info_to_howto		             pj_elf_info_to_howto
+#define bfd_elf32_bfd_get_relocated_section_contents \
+  bfd_generic_get_relocated_section_contents
+#define bfd_elf32_bfd_reloc_type_lookup	        pj_elf_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup   pj_elf_reloc_name_lookup
+#define elf_backend_final_write_processing      pj_elf_final_write_processing
+#define elf_info_to_howto		        pj_elf_info_to_howto
 #include "elf32-target.h"
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.210
diff -u -p -r1.210 elf32-ppc.c
--- bfd/elf32-ppc.c	7 Mar 2007 08:54:34 -0000	1.210
+++ bfd/elf32-ppc.c	26 Mar 2007 00:13:07 -0000
@@ -1578,6 +1578,22 @@ ppc_elf_reloc_type_lookup (bfd *abfd ATT
   return ppc_elf_howto_table[r];
 };
 
+static reloc_howto_type *
+ppc_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			   const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (ppc_elf_howto_raw) / sizeof (ppc_elf_howto_raw[0]);
+       i++)
+    if (ppc_elf_howto_raw[i].name != NULL
+	&& strcasecmp (ppc_elf_howto_raw[i].name, r_name) == 0)
+      return &ppc_elf_howto_raw[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for a PowerPC ELF reloc.  */
 
 static void
@@ -7497,6 +7513,7 @@ ppc_elf_finish_dynamic_sections (bfd *ou
 #define bfd_elf32_bfd_merge_private_bfd_data	ppc_elf_merge_private_bfd_data
 #define bfd_elf32_bfd_relax_section		ppc_elf_relax_section
 #define bfd_elf32_bfd_reloc_type_lookup		ppc_elf_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	ppc_elf_reloc_name_lookup
 #define bfd_elf32_bfd_set_private_flags		ppc_elf_set_private_flags
 #define bfd_elf32_bfd_link_hash_table_create	ppc_elf_link_hash_table_create
 
Index: bfd/elf32-s390.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-s390.c,v
retrieving revision 1.90
diff -u -p -r1.90 elf32-s390.c
--- bfd/elf32-s390.c	7 Mar 2007 08:54:34 -0000	1.90
+++ bfd/elf32-s390.c	26 Mar 2007 00:13:08 -0000
@@ -334,6 +334,25 @@ elf_s390_reloc_type_lookup (abfd, code)
   return 0;
 }
 
+static reloc_howto_type *
+elf_s390_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++)
+    if (elf_howto_table[i].name != NULL
+	&& strcasecmp (elf_howto_table[i].name, r_name) == 0)
+      return &elf_howto_table[i];
+
+  if (strcasecmp (elf32_s390_vtinherit_howto.name, r_name) == 0)
+    return &elf32_s390_vtinherit_howto;
+  if (strcasecmp (elf32_s390_vtentry_howto.name, r_name) == 0)
+    return &elf32_s390_vtentry_howto;
+
+  return NULL;
+}
+
 /* We need to use ELF32_R_TYPE so we have our own copy of this function,
    and elf32-s390.c has its own copy.  */
 
@@ -3540,6 +3559,7 @@ elf_s390_plt_sym_val (bfd_vma i, const a
 #define bfd_elf32_bfd_is_local_label_name     elf_s390_is_local_label_name
 #define bfd_elf32_bfd_link_hash_table_create  elf_s390_link_hash_table_create
 #define bfd_elf32_bfd_reloc_type_lookup	      elf_s390_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup elf_s390_reloc_name_lookup
 
 #define elf_backend_adjust_dynamic_symbol     elf_s390_adjust_dynamic_symbol
 #define elf_backend_check_relocs	      elf_s390_check_relocs
Index: bfd/elf32-score.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-score.c,v
retrieving revision 1.8
diff -u -p -r1.8 elf32-score.c
--- bfd/elf32-score.c	7 Mar 2007 08:54:34 -0000	1.8
+++ bfd/elf32-score.c	26 Mar 2007 00:13:11 -0000
@@ -3699,6 +3699,23 @@ elf32_score_reloc_type_lookup (bfd *abfd
   return NULL;
 }
 
+static reloc_howto_type *
+elf32_score_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			       const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (elf32_score_howto_table)
+	    / sizeof (elf32_score_howto_table[0]));
+       i++)
+    if (elf32_score_howto_table[i].name != NULL
+	&& strcasecmp (elf32_score_howto_table[i].name, r_name) == 0)
+      return &elf32_score_howto_table[i];
+
+  return NULL;
+}
+
 /* Create a score elf linker hash table.  */
 
 static struct bfd_link_hash_table *
@@ -3856,6 +3873,8 @@ elf32_score_new_section_hook (bfd *abfd,
 #define elf_backend_type_change_ok        TRUE
 
 #define bfd_elf32_bfd_reloc_type_lookup      elf32_score_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup \
+  elf32_score_reloc_name_lookup
 #define bfd_elf32_bfd_link_hash_table_create elf32_score_link_hash_table_create
 #define bfd_elf32_bfd_print_private_bfd_data elf32_score_print_private_bfd_data
 #define bfd_elf32_bfd_merge_private_bfd_data elf32_score_merge_private_bfd_data
Index: bfd/elf32-sh.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sh.c,v
retrieving revision 1.146
diff -u -p -r1.146 elf32-sh.c
--- bfd/elf32-sh.c	7 Mar 2007 08:54:34 -0000	1.146
+++ bfd/elf32-sh.c	26 Mar 2007 00:13:14 -0000
@@ -402,6 +402,35 @@ sh_elf_reloc_type_lookup (bfd *abfd, bfd
   return NULL;
 }
 
+static reloc_howto_type *
+sh_elf_reloc_name_lookup (bfd *abfd, const char *r_name)
+{
+  unsigned int i;
+
+  if (vxworks_object_p (abfd))
+    {
+      for (i = 0;
+	   i < (sizeof (sh_vxworks_howto_table)
+		/ sizeof (sh_vxworks_howto_table[0]));
+	   i++)
+	if (sh_vxworks_howto_table[i].name != NULL
+	    && strcasecmp (sh_vxworks_howto_table[i].name, r_name) == 0)
+	  return &sh_vxworks_howto_table[i];
+    }
+  else
+    {
+      for (i = 0;
+	   i < (sizeof (sh_elf_howto_table)
+		/ sizeof (sh_elf_howto_table[0]));
+	   i++)
+	if (sh_elf_howto_table[i].name != NULL
+	    && strcasecmp (sh_elf_howto_table[i].name, r_name) == 0)
+	  return &sh_elf_howto_table[i];
+    }
+
+  return NULL;
+}
+
 /* Given an ELF reloc, fill in the howto field of a relent.  */
 
 static void
@@ -6010,6 +6039,8 @@ sh_elf_plt_sym_val (bfd_vma i, const ase
 #define elf_symbol_leading_char '_'
 
 #define bfd_elf32_bfd_reloc_type_lookup	sh_elf_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup \
+					sh_elf_reloc_name_lookup
 #define elf_info_to_howto		sh_elf_info_to_howto
 #define bfd_elf32_bfd_relax_section	sh_elf_relax_section
 #define elf_backend_relocate_section	sh_elf_relocate_section
Index: bfd/elf32-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sparc.c,v
retrieving revision 1.86
diff -u -p -r1.86 elf32-sparc.c
--- bfd/elf32-sparc.c	17 Oct 2006 13:41:47 -0000	1.86
+++ bfd/elf32-sparc.c	26 Mar 2007 00:13:14 -0000
@@ -1,6 +1,6 @@
 /* SPARC-specific support for 32-bit ELF
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2007 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -183,6 +183,8 @@ elf32_sparc_reloc_type_class (const Elf_
 
 #define elf_info_to_howto		_bfd_sparc_elf_info_to_howto
 #define bfd_elf32_bfd_reloc_type_lookup	_bfd_sparc_elf_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup \
+  _bfd_sparc_elf_reloc_name_lookup
 #define bfd_elf32_bfd_link_hash_table_create \
 					_bfd_sparc_elf_link_hash_table_create
 #define bfd_elf32_bfd_relax_section	_bfd_sparc_elf_relax_section
Index: bfd/elf32-spu.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-spu.c,v
retrieving revision 1.7
diff -u -p -r1.7 elf32-spu.c
--- bfd/elf32-spu.c	23 Mar 2007 00:42:00 -0000	1.7
+++ bfd/elf32-spu.c	26 Mar 2007 00:13:15 -0000
@@ -142,6 +142,20 @@ spu_elf_reloc_type_lookup (bfd *abfd ATT
   return elf_howto_table + spu_elf_bfd_to_reloc_type (code);
 }
 
+static reloc_howto_type *
+spu_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			   const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++)
+    if (elf_howto_table[i].name != NULL
+	&& strcasecmp (elf_howto_table[i].name, r_name) == 0)
+      return &elf_howto_table[i];
+
+  return NULL;
+}
+
 /* Apply R_SPU_REL9 and R_SPU_REL9I relocs.  */
 
 static bfd_reloc_status_type
@@ -1756,6 +1823,7 @@ spu_elf_section_processing (bfd *abfd AT
 #define elf_backend_can_gc_sections	1
 
 #define bfd_elf32_bfd_reloc_type_lookup		spu_elf_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	spu_elf_reloc_name_lookup
 #define elf_info_to_howto			spu_elf_info_to_howto
 #define elf_backend_gc_mark_hook		spu_elf_gc_mark_hook
 #define elf_backend_relocate_section		spu_elf_relocate_section
Index: bfd/elf32-v850.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-v850.c,v
retrieving revision 1.67
diff -u -p -r1.67 elf32-v850.c
--- bfd/elf32-v850.c	8 Mar 2007 11:38:58 -0000	1.67
+++ bfd/elf32-v850.c	26 Mar 2007 00:13:16 -0000
@@ -1339,6 +1339,22 @@ v850_elf_reloc_type_lookup (bfd *abfd AT
 
   return NULL;
 }
+
+static reloc_howto_type *
+v850_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (v850_elf_howto_table) / sizeof (v850_elf_howto_table[0]);
+       i++)
+    if (v850_elf_howto_table[i].name != NULL
+	&& strcasecmp (v850_elf_howto_table[i].name, r_name) == 0)
+      return &v850_elf_howto_table[i];
+
+  return NULL;
+}
 
 /* Set the howto pointer for an V850 ELF reloc.  */
 
@@ -3073,6 +3089,7 @@ static const struct bfd_elf_special_sect
 
 #define bfd_elf32_bfd_is_local_label_name	v850_elf_is_local_label_name
 #define bfd_elf32_bfd_reloc_type_lookup		v850_elf_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup	v850_elf_reloc_name_lookup
 #define bfd_elf32_bfd_merge_private_bfd_data 	v850_elf_merge_private_bfd_data
 #define bfd_elf32_bfd_set_private_flags		v850_elf_set_private_flags
 #define bfd_elf32_bfd_print_private_bfd_data	v850_elf_print_private_bfd_data
Index: bfd/elf32-vax.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-vax.c,v
retrieving revision 1.40
diff -u -p -r1.40 elf32-vax.c
--- bfd/elf32-vax.c	7 Mar 2007 08:54:34 -0000	1.40
+++ bfd/elf32-vax.c	26 Mar 2007 00:13:17 -0000
@@ -1,6 +1,6 @@
 /* VAX series support for 32-bit ELF
    Copyright 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005, 2006 Free Software Foundation, Inc.
+   2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    Contributed by Matt Thomas <matt@3am-software.com>.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -322,7 +322,22 @@ reloc_type_lookup (bfd *abfd ATTRIBUTE_U
   return 0;
 }
 
+static reloc_howto_type *
+reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+		   const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0; i < sizeof (howto_table) / sizeof (howto_table[0]); i++)
+    if (howto_table[i].name != NULL
+	&& strcasecmp (howto_table[i].name, r_name) == 0)
+      return &howto_table[i];
+
+  return NULL;
+}
+
 #define bfd_elf32_bfd_reloc_type_lookup reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup reloc_name_lookup
 #define ELF_ARCH bfd_arch_vax
 /* end code generated by elf.el */
 
Index: bfd/elf32-xc16x.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-xc16x.c,v
retrieving revision 1.2
diff -u -p -r1.2 elf32-xc16x.c
--- bfd/elf32-xc16x.c	7 Mar 2007 08:54:34 -0000	1.2
+++ bfd/elf32-xc16x.c	26 Mar 2007 00:13:18 -0000
@@ -205,6 +205,22 @@ xc16x_reloc_type_lookup (bfd *abfd ATTRI
   return NULL;
 }
 
+static reloc_howto_type *
+xc16x_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (xc16x_elf_howto_table) / sizeof (xc16x_elf_howto_table[0]);
+       i++)
+    if (xc16x_elf_howto_table[i].name != NULL
+	&& strcasecmp (xc16x_elf_howto_table[i].name, r_name) == 0)
+      return &xc16x_elf_howto_table[i];
+
+  return NULL;
+}
+
 /* For a particular operand this function is
    called to finalise the type of relocation.  */
 
@@ -454,6 +470,7 @@ elf32_xc16x_object_p (bfd *abfd)
 #define elf_backend_object_p   		elf32_xc16x_object_p
 #define elf_backend_can_gc_sections	1
 #define bfd_elf32_bfd_reloc_type_lookup	xc16x_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup xc16x_reloc_name_lookup
 #define elf_info_to_howto		elf32_xc16x_info_to_howto
 #define elf_info_to_howto_rel		elf32_xc16x_info_to_howto
 #define elf_backend_relocate_section  	elf32_xc16x_relocate_section
Index: bfd/elf32-xstormy16.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-xstormy16.c,v
retrieving revision 1.37
diff -u -p -r1.37 elf32-xstormy16.c
--- bfd/elf32-xstormy16.c	7 Mar 2007 08:54:34 -0000	1.37
+++ bfd/elf32-xstormy16.c	26 Mar 2007 00:13:18 -0000
@@ -349,6 +349,31 @@ xstormy16_reloc_type_lookup (bfd * abfd 
   return NULL;
 }
 
+static reloc_howto_type *
+xstormy16_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			     const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (xstormy16_elf_howto_table)
+	    / sizeof (xstormy16_elf_howto_table[0]));
+       i++)
+    if (xstormy16_elf_howto_table[i].name != NULL
+	&& strcasecmp (xstormy16_elf_howto_table[i].name, r_name) == 0)
+      return &xstormy16_elf_howto_table[i];
+
+  for (i = 0;
+       i < (sizeof (xstormy16_elf_howto_table2)
+	    / sizeof (xstormy16_elf_howto_table2[0]));
+       i++)
+    if (xstormy16_elf_howto_table2[i].name != NULL
+	&& strcasecmp (xstormy16_elf_howto_table2[i].name, r_name) == 0)
+      return &xstormy16_elf_howto_table2[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for an XSTORMY16 ELF reloc.  */
 
 static void
@@ -1019,6 +1044,8 @@ xstormy16_elf_gc_mark_hook (asection *se
 #define elf_backend_rela_normal			1
 
 #define bfd_elf32_bfd_reloc_type_lookup		xstormy16_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup \
+  xstormy16_reloc_name_lookup
 #define bfd_elf32_bfd_relax_section		xstormy16_elf_relax_section
 
 #include "elf32-target.h"
Index: bfd/elf32-xtensa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-xtensa.c,v
retrieving revision 1.82
diff -u -p -r1.82 elf32-xtensa.c
--- bfd/elf32-xtensa.c	7 Mar 2007 08:54:34 -0000	1.82
+++ bfd/elf32-xtensa.c	26 Mar 2007 00:13:23 -0000
@@ -389,6 +389,20 @@ elf_xtensa_reloc_type_lookup (bfd *abfd 
   return NULL;
 }
 
+static reloc_howto_type *
+elf_xtensa_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			      const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0; i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]); i++)
+    if (elf_howto_table[i].name != NULL
+	&& strcasecmp (elf_howto_table[i].name, r_name) == 0)
+      return &elf_howto_table[i];
+
+  return NULL;
+}
+
 
 /* Given an ELF "rela" relocation, find the corresponding howto and record
    it in the BFD internal arelent representation of the relocation.  */
@@ -9808,6 +9822,8 @@ static const struct bfd_elf_special_sect
 #define bfd_elf32_bfd_print_private_bfd_data elf_xtensa_print_private_bfd_data
 #define bfd_elf32_bfd_relax_section	     elf_xtensa_relax_section
 #define bfd_elf32_bfd_reloc_type_lookup	     elf_xtensa_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup \
+  elf_xtensa_reloc_name_lookup
 #define bfd_elf32_bfd_set_private_flags	     elf_xtensa_set_private_flags
 #define bfd_elf32_bfd_link_hash_table_create elf_xtensa_link_hash_table_create
 
Index: bfd/elf64-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-alpha.c,v
retrieving revision 1.157
diff -u -p -r1.157 elf64-alpha.c
--- bfd/elf64-alpha.c	14 Mar 2007 02:56:45 -0000	1.157
+++ bfd/elf64-alpha.c	26 Mar 2007 00:13:25 -0000
@@ -1055,6 +1055,23 @@ elf64_alpha_bfd_reloc_type_lookup (bfd *
   return 0;
 }
 
+static reloc_howto_type *
+elf64_alpha_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				   const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (elf64_alpha_howto_table)
+	    / sizeof (elf64_alpha_howto_table[0]));
+       i++)
+    if (elf64_alpha_howto_table[i].name != NULL
+	&& strcasecmp (elf64_alpha_howto_table[i].name, r_name) == 0)
+      return &elf64_alpha_howto_table[i];
+
+  return NULL;
+}
+
 /* Given an Alpha ELF reloc type, fill in an arelent structure.  */
 
 static void
@@ -5282,6 +5299,8 @@ static const struct elf_size_info alpha_
 
 #define bfd_elf64_bfd_reloc_type_lookup \
   elf64_alpha_bfd_reloc_type_lookup
+#define bfd_elf64_bfd_reloc_name_lookup \
+  elf64_alpha_bfd_reloc_name_lookup
 #define elf_info_to_howto \
   elf64_alpha_info_to_howto
 
Index: bfd/elf64-gen.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-gen.c,v
retrieving revision 1.15
diff -u -p -r1.15 elf64-gen.c
--- bfd/elf64-gen.c	4 May 2005 15:53:24 -0000	1.15
+++ bfd/elf64-gen.c	26 Mar 2007 00:13:26 -0000
@@ -1,5 +1,5 @@
 /* Generic support for 64-bit ELF
-   Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004, 2005
+   Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004, 2005, 2007
    Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -94,6 +94,7 @@ elf64_generic_link_add_symbols (bfd *abf
 #define ELF_MACHINE_CODE		EM_NONE
 #define ELF_MAXPAGESIZE			0x1
 #define bfd_elf64_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
+#define bfd_elf64_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
 #define bfd_elf64_bfd_link_add_symbols	elf64_generic_link_add_symbols
 #define elf_info_to_howto		elf_generic_info_to_howto
 #define elf_info_to_howto_rel		elf_generic_info_to_howto_rel
Index: bfd/elf64-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-hppa.c,v
retrieving revision 1.77
diff -u -p -r1.77 elf64-hppa.c
--- bfd/elf64-hppa.c	14 Mar 2007 02:56:45 -0000	1.77
+++ bfd/elf64-hppa.c	26 Mar 2007 00:13:29 -0000
@@ -1,5 +1,5 @@
 /* Support for HPPA 64-bit ELF
-   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -2796,6 +2796,7 @@ const struct elf_size_info hppa64_elf_si
 #define ELF_OSABI			ELFOSABI_HPUX
 
 #define bfd_elf64_bfd_reloc_type_lookup elf_hppa_reloc_type_lookup
+#define bfd_elf64_bfd_reloc_name_lookup elf_hppa_reloc_name_lookup
 #define bfd_elf64_bfd_is_local_label_name       elf_hppa_is_local_label_name
 #define elf_info_to_howto		elf_hppa_info_to_howto
 #define elf_info_to_howto_rel		elf_hppa_info_to_howto_rel
Index: bfd/elf64-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-mips.c,v
retrieving revision 1.78
diff -u -p -r1.78 elf64-mips.c
--- bfd/elf64-mips.c	28 Oct 2006 10:13:49 -0000	1.78
+++ bfd/elf64-mips.c	26 Mar 2007 00:13:29 -0000
@@ -1,6 +1,6 @@
 /* MIPS-specific support for 64-bit ELF
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-   Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+   2007 Free Software Foundation, Inc.
    Ian Lance Taylor, Cygnus Support
    Linker support added by Mark Mitchell, CodeSourcery, LLC.
    <mark@codesourcery.com>
@@ -2224,6 +2224,39 @@ bfd_elf64_bfd_reloc_type_lookup (bfd *ab
     }
 }
 
+static reloc_howto_type *
+bfd_elf64_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (mips_elf64_howto_table_rela)
+	    / sizeof (mips_elf64_howto_table_rela[0])); i++)
+    if (mips_elf64_howto_table_rela[i].name != NULL
+	&& strcasecmp (mips_elf64_howto_table_rela[i].name, r_name) == 0)
+      return &mips_elf64_howto_table_rela[i];
+
+  for (i = 0;
+       i < (sizeof (mips16_elf64_howto_table_rela)
+	    / sizeof (mips16_elf64_howto_table_rela[0]));
+       i++)
+    if (mips16_elf64_howto_table_rela[i].name != NULL
+	&& strcasecmp (mips16_elf64_howto_table_rela[i].name, r_name) == 0)
+      return &mips16_elf64_howto_table_rela[i];
+
+  if (strcasecmp (elf_mips_gnu_vtinherit_howto.name, r_name) == 0)
+    return &elf_mips_gnu_vtinherit_howto;
+  if (strcasecmp (elf_mips_gnu_vtentry_howto.name, r_name) == 0)
+    return &elf_mips_gnu_vtentry_howto;
+  if (strcasecmp (elf_mips_gnu_rel16_s2.name, r_name) == 0)
+    return &elf_mips_gnu_rel16_s2;
+  if (strcasecmp (elf_mips_gnu_rela16_s2.name, r_name) == 0)
+    return &elf_mips_gnu_rela16_s2;
+
+  return NULL;
+}
+
 /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure.  */
 
 static reloc_howto_type *
Index: bfd/elf64-mmix.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-mmix.c,v
retrieving revision 1.52
diff -u -p -r1.52 elf64-mmix.c
--- bfd/elf64-mmix.c	7 Mar 2007 08:54:34 -0000	1.52
+++ bfd/elf64-mmix.c	26 Mar 2007 00:13:30 -0000
@@ -848,6 +848,22 @@ bfd_elf64_bfd_reloc_type_lookup (abfd, c
   return NULL;
 }
 
+static reloc_howto_type *
+bfd_elf64_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (elf_mmix_howto_table) / sizeof (elf_mmix_howto_table[0]);
+       i++)
+    if (elf_mmix_howto_table[i].name != NULL
+	&& strcasecmp (elf_mmix_howto_table[i].name, r_name) == 0)
+      return &elf_mmix_howto_table[i];
+
+  return NULL;
+}
+
 static bfd_boolean
 mmix_elf_new_section_hook (abfd, sec)
      bfd *abfd;
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.259
diff -u -p -r1.259 elf64-ppc.c
--- bfd/elf64-ppc.c	7 Mar 2007 08:54:34 -0000	1.259
+++ bfd/elf64-ppc.c	26 Mar 2007 00:13:35 -0000
@@ -77,6 +77,7 @@ static bfd_vma opd_entry_value
 
 #define bfd_elf64_mkobject		      ppc64_elf_mkobject
 #define bfd_elf64_bfd_reloc_type_lookup	      ppc64_elf_reloc_type_lookup
+#define bfd_elf64_bfd_reloc_name_lookup ppc64_elf_reloc_name_lookup
 #define bfd_elf64_bfd_merge_private_bfd_data  ppc64_elf_merge_private_bfd_data
 #define bfd_elf64_new_section_hook	      ppc64_elf_new_section_hook
 #define bfd_elf64_bfd_link_hash_table_create  ppc64_elf_link_hash_table_create
@@ -2111,6 +2112,22 @@ ppc64_elf_reloc_type_lookup (bfd *abfd A
   return ppc64_elf_howto_table[r];
 };
 
+static reloc_howto_type *
+ppc64_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			     const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (ppc64_elf_howto_raw) / sizeof (ppc64_elf_howto_raw[0]);
+       i++)
+    if (ppc64_elf_howto_raw[i].name != NULL
+	&& strcasecmp (ppc64_elf_howto_raw[i].name, r_name) == 0)
+      return &ppc64_elf_howto_raw[i];
+
+  return NULL;
+}
+
 /* Set the howto pointer for a PowerPC ELF reloc.  */
 
 static void
Index: bfd/elf64-s390.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-s390.c,v
retrieving revision 1.90
diff -u -p -r1.90 elf64-s390.c
--- bfd/elf64-s390.c	7 Mar 2007 08:54:35 -0000	1.90
+++ bfd/elf64-s390.c	26 Mar 2007 00:13:37 -0000
@@ -356,6 +356,27 @@ elf_s390_reloc_type_lookup (abfd, code)
   return 0;
 }
 
+static reloc_howto_type *
+elf_s390_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (elf_howto_table) / sizeof (elf_howto_table[0]);
+       i++)
+    if (elf_howto_table[i].name != NULL
+	&& strcasecmp (elf_howto_table[i].name, r_name) == 0)
+      return &elf_howto_table[i];
+
+    if (strcasecmp (elf64_s390_vtinherit_howto.name, r_name) == 0)
+      return &elf64_s390_vtinherit_howto;
+    if (strcasecmp (elf64_s390_vtentry_howto.name, r_name) == 0)
+      return &elf64_s390_vtentry_howto;
+
+  return NULL;
+}
+
 /* We need to use ELF64_R_TYPE so we have our own copy of this function,
    and elf64-s390.c has its own copy.  */
 
@@ -3448,6 +3469,7 @@ const struct elf_size_info s390_elf64_si
 #define bfd_elf64_bfd_is_local_label_name     elf_s390_is_local_label_name
 #define bfd_elf64_bfd_link_hash_table_create  elf_s390_link_hash_table_create
 #define bfd_elf64_bfd_reloc_type_lookup	      elf_s390_reloc_type_lookup
+#define bfd_elf64_bfd_reloc_name_lookup elf_s390_reloc_name_lookup
 
 #define elf_backend_adjust_dynamic_symbol     elf_s390_adjust_dynamic_symbol
 #define elf_backend_check_relocs	      elf_s390_check_relocs
Index: bfd/elf64-sh64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sh64.c,v
retrieving revision 1.73
diff -u -p -r1.73 elf64-sh64.c
--- bfd/elf64-sh64.c	7 Mar 2007 08:54:35 -0000	1.73
+++ bfd/elf64-sh64.c	26 Mar 2007 00:13:39 -0000
@@ -1392,6 +1392,22 @@ sh_elf64_reloc_type_lookup (bfd *abfd AT
   return NULL;
 }
 
+static reloc_howto_type *
+sh_elf64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			    const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (sh_elf64_howto_table) / sizeof (sh_elf64_howto_table[0]);
+       i++)
+    if (sh_elf64_howto_table[i].name != NULL
+	&& strcasecmp (sh_elf64_howto_table[i].name, r_name) == 0)
+      return &sh_elf64_howto_table[i];
+
+  return NULL;
+}
+
 /* Given an ELF reloc, fill in the howto field of a relent.
 
    See sh_elf_info_to_howto in elf32-sh.c for the original.  */
@@ -4060,6 +4076,8 @@ static const struct bfd_elf_special_sect
 #define elf_symbol_leading_char '_'
 
 #define bfd_elf64_bfd_reloc_type_lookup	sh_elf64_reloc_type_lookup
+#define bfd_elf64_bfd_reloc_name_lookup \
+					sh_elf64_reloc_name_lookup
 #define elf_info_to_howto		sh_elf64_info_to_howto
 
 /* Note: there's no relaxation at present.  */
Index: bfd/elf64-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sparc.c,v
retrieving revision 1.111
diff -u -p -r1.111 elf64-sparc.c
--- bfd/elf64-sparc.c	14 Mar 2007 02:56:45 -0000	1.111
+++ bfd/elf64-sparc.c	26 Mar 2007 00:13:39 -0000
@@ -1,6 +1,6 @@
 /* SPARC-specific support for 64-bit ELF
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2007 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -859,6 +859,8 @@ const struct elf_size_info elf64_sparc_s
   _bfd_sparc_elf_copy_indirect_symbol
 #define bfd_elf64_bfd_reloc_type_lookup \
   _bfd_sparc_elf_reloc_type_lookup
+#define bfd_elf64_bfd_reloc_name_lookup \
+  _bfd_sparc_elf_reloc_name_lookup
 #define bfd_elf64_bfd_relax_section \
   _bfd_sparc_elf_relax_section
 #define bfd_elf64_new_section_hook \
Index: bfd/elf64-x86-64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-x86-64.c,v
retrieving revision 1.130
diff -u -p -r1.130 elf64-x86-64.c
--- bfd/elf64-x86-64.c	14 Mar 2007 02:56:45 -0000	1.130
+++ bfd/elf64-x86-64.c	26 Mar 2007 00:13:42 -0000
@@ -246,6 +246,23 @@ elf64_x86_64_reloc_type_lookup (bfd *abf
   return 0;
 }
 
+static reloc_howto_type *
+elf64_x86_64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (x86_64_elf_howto_table)
+	    / sizeof (x86_64_elf_howto_table[0]));
+       i++)
+    if (x86_64_elf_howto_table[i].name != NULL
+	&& strcasecmp (x86_64_elf_howto_table[i].name, r_name) == 0)
+      return &x86_64_elf_howto_table[i];
+
+  return NULL;
+}
+
 /* Given an x86_64 ELF reloc type, fill in an arelent structure.  */
 
 static void
@@ -3660,6 +3677,8 @@ static const struct bfd_elf_special_sect
 #define bfd_elf64_bfd_link_hash_table_create \
   elf64_x86_64_link_hash_table_create
 #define bfd_elf64_bfd_reloc_type_lookup	    elf64_x86_64_reloc_type_lookup
+#define bfd_elf64_bfd_reloc_name_lookup \
+  elf64_x86_64_reloc_name_lookup
 
 #define elf_backend_adjust_dynamic_symbol   elf64_x86_64_adjust_dynamic_symbol
 #define elf_backend_check_relocs	    elf64_x86_64_check_relocs
Index: bfd/elfn32-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfn32-mips.c,v
retrieving revision 1.36
diff -u -p -r1.36 elfn32-mips.c
--- bfd/elfn32-mips.c	28 Oct 2006 10:13:49 -0000	1.36
+++ bfd/elfn32-mips.c	26 Mar 2007 00:13:42 -0000
@@ -1,6 +1,6 @@
 /* MIPS-specific support for 32-bit ELF
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2007 Free Software Foundation, Inc.
 
    Most of the information added by Ian Lance Taylor, Cygnus Support,
    <ian@cygnus.com>.
@@ -2081,6 +2081,40 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *ab
     }
 }
 
+static reloc_howto_type *
+bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				 const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (elf_mips_howto_table_rela)
+	    / sizeof (elf_mips_howto_table_rela[0]));
+       i++)
+    if (elf_mips_howto_table_rela[i].name != NULL
+	&& strcasecmp (elf_mips_howto_table_rela[i].name, r_name) == 0)
+      return &elf_mips_howto_table_rela[i];
+
+  for (i = 0;
+       i < (sizeof (elf_mips16_howto_table_rela)
+	    / sizeof (elf_mips16_howto_table_rela[0]));
+       i++)
+    if (elf_mips16_howto_table_rela[i].name != NULL
+	&& strcasecmp (elf_mips16_howto_table_rela[i].name, r_name) == 0)
+      return &elf_mips16_howto_table_rela[i];
+
+  if (strcasecmp (elf_mips_gnu_vtinherit_howto.name, r_name) == 0)
+    return &elf_mips_gnu_vtinherit_howto;
+  if (strcasecmp (elf_mips_gnu_vtentry_howto.name, r_name) == 0)
+    return &elf_mips_gnu_vtentry_howto;
+  if (strcasecmp (elf_mips_gnu_rel16_s2.name, r_name) == 0)
+    return &elf_mips_gnu_rel16_s2;
+  if (strcasecmp (elf_mips_gnu_rela16_s2.name, r_name) == 0)
+    return &elf_mips_gnu_rela16_s2;
+
+  return NULL;
+}
+
 /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure.  */
 
 static reloc_howto_type *
Index: bfd/elfxx-ia64.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-ia64.c,v
retrieving revision 1.195
diff -u -p -r1.195 elfxx-ia64.c
--- bfd/elfxx-ia64.c	14 Mar 2007 02:56:45 -0000	1.195
+++ bfd/elfxx-ia64.c	26 Mar 2007 00:13:45 -0000
@@ -613,6 +613,22 @@ elfNN_ia64_reloc_type_lookup (abfd, bfd_
   return lookup_howto (rtype);
 }
 
+static reloc_howto_type *
+elfNN_ia64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			      const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (ia64_howto_table) / sizeof (ia64_howto_table[0]);
+       i++)
+    if (ia64_howto_table[i].name != NULL
+	&& strcasecmp (ia64_howto_table[i].name, r_name) == 0)
+      return &ia64_howto_table[i];
+
+  return NULL;
+}
+
 /* Given a ELF reloc, return the matching HOWTO structure.  */
 
 static void
@@ -5748,6 +5764,8 @@ elfNN_hpux_backend_symbol_processing (bf
 
 #define bfd_elfNN_bfd_reloc_type_lookup \
 	elfNN_ia64_reloc_type_lookup
+#define bfd_elfNN_bfd_reloc_name_lookup \
+	elfNN_ia64_reloc_name_lookup
 #define bfd_elfNN_bfd_is_local_label_name \
 	elfNN_ia64_is_local_label_name
 #define bfd_elfNN_bfd_relax_section \
Index: bfd/elfxx-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-sparc.c,v
retrieving revision 1.29
diff -u -p -r1.29 elfxx-sparc.c
--- bfd/elfxx-sparc.c	7 Mar 2007 08:54:35 -0000	1.29
+++ bfd/elfxx-sparc.c	26 Mar 2007 00:13:47 -0000
@@ -385,6 +385,30 @@ _bfd_sparc_elf_reloc_type_lookup (bfd *a
 }
 
 reloc_howto_type *
+_bfd_sparc_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+				  const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < (sizeof (_bfd_sparc_elf_howto_table)
+	    / sizeof (_bfd_sparc_elf_howto_table[0]));
+       i++)
+    if (_bfd_sparc_elf_howto_table[i].name != NULL
+	&& strcasecmp (_bfd_sparc_elf_howto_table[i].name, r_name) == 0)
+      return &_bfd_sparc_elf_howto_table[i];
+
+  if (strcasecmp (sparc_vtinherit_howto.name, r_name) == 0)
+    return &sparc_vtinherit_howto;
+  if (strcasecmp (sparc_vtentry_howto.name, r_name) == 0)
+    return &sparc_vtentry_howto;
+  if (strcasecmp (sparc_rev32_howto.name, r_name) == 0)
+    return &sparc_rev32_howto;
+
+  return NULL;
+}
+
+reloc_howto_type *
 _bfd_sparc_elf_info_to_howto_ptr (unsigned int r_type)
 {
   switch (r_type)
Index: bfd/elfxx-sparc.h
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-sparc.h,v
retrieving revision 1.6
diff -u -p -r1.6 elfxx-sparc.h
--- bfd/elfxx-sparc.h	5 Apr 2006 12:41:57 -0000	1.6
+++ bfd/elfxx-sparc.h	26 Mar 2007 00:13:47 -0000
@@ -1,5 +1,5 @@
 /* SPARC ELF specific backend routines.
-   Copyright 2005 Free Software Foundation, Inc.
+   Copyright 2005, 2007 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -97,6 +97,8 @@ struct _bfd_sparc_elf_link_hash_table
 
 extern reloc_howto_type *_bfd_sparc_elf_reloc_type_lookup
   (bfd *, bfd_reloc_code_real_type);
+extern reloc_howto_type *_bfd_sparc_elf_reloc_name_lookup
+  (bfd *, const char *);
 extern void _bfd_sparc_elf_info_to_howto
   (bfd *, arelent *, Elf_Internal_Rela *);
 extern reloc_howto_type *_bfd_sparc_elf_info_to_howto_ptr
Index: bfd/i386msdos.c
===================================================================
RCS file: /cvs/src/src/bfd/i386msdos.c,v
retrieving revision 1.24
diff -u -p -r1.24 i386msdos.c
--- bfd/i386msdos.c	19 Jun 2006 13:17:43 -0000	1.24
+++ bfd/i386msdos.c	26 Mar 2007 00:13:48 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for MS-DOS executables.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002,
-   2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    Written by Bryan Ford of the University of Utah.
 
    Contributed by the Center for Software Science at the
@@ -130,6 +130,7 @@ msdos_set_section_contents (bfd *abfd,
 #define msdos_mkobject aout_32_mkobject
 #define msdos_make_empty_symbol aout_32_make_empty_symbol
 #define msdos_bfd_reloc_type_lookup aout_32_reloc_type_lookup
+#define msdos_bfd_reloc_name_lookup aout_32_reloc_name_lookup
 
 #define	msdos_close_and_cleanup _bfd_generic_close_and_cleanup
 #define msdos_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
Index: bfd/i386os9k.c
===================================================================
RCS file: /cvs/src/src/bfd/i386os9k.c,v
retrieving revision 1.20
diff -u -p -r1.20 i386os9k.c
--- bfd/i386os9k.c	19 Jun 2006 13:17:43 -0000	1.20
+++ bfd/i386os9k.c	26 Mar 2007 00:13:48 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for os9000 i386 binaries.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 2002,
-   2004, 2005, 2006 Free Software Foundation, Inc.
+   2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -158,6 +158,7 @@ os9k_sizeof_headers (bfd *abfd ATTRIBUTE
 #define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
 
 #define aout_32_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
+#define aout_32_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
 
 #define aout_32_get_section_contents_in_window \
   _bfd_generic_get_section_contents_in_window
Index: bfd/ieee.c
===================================================================
RCS file: /cvs/src/src/bfd/ieee.c,v
retrieving revision 1.57
diff -u -p -r1.57 ieee.c
--- bfd/ieee.c	16 Sep 2006 18:12:14 -0000	1.57
+++ bfd/ieee.c	26 Mar 2007 00:13:49 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for ieee-695 objects.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
 
    Written by Steve Chamberlain of Cygnus Support.
@@ -3747,6 +3747,7 @@ ieee_sizeof_headers (bfd *abfd ATTRIBUTE
 #define ieee_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
 
 #define ieee_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
+#define ieee_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
 
 #define ieee_set_arch_mach _bfd_generic_set_arch_mach
 
Index: bfd/libaout.h
===================================================================
RCS file: /cvs/src/src/bfd/libaout.h,v
retrieving revision 1.24
diff -u -p -r1.24 libaout.h
--- bfd/libaout.h	19 Jun 2006 13:17:43 -0000	1.24
+++ bfd/libaout.h	26 Mar 2007 00:13:50 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end data structures for a.out (and similar) files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -525,6 +525,9 @@ extern void NAME (aout, swap_std_reloc_i
 extern reloc_howto_type * NAME (aout, reloc_type_lookup)
   (bfd *, bfd_reloc_code_real_type);
 
+extern reloc_howto_type * NAME (aout, reloc_name_lookup)
+  (bfd *, const char *);
+
 extern bfd_boolean NAME (aout, slurp_reloc_table)
   (bfd *, sec_ptr, asymbol **);
 
Index: bfd/libbfd-in.h
===================================================================
RCS file: /cvs/src/src/bfd/libbfd-in.h,v
retrieving revision 1.69
diff -u -p -r1.69 libbfd-in.h
--- bfd/libbfd-in.h	15 Feb 2007 08:33:53 -0000	1.69
+++ bfd/libbfd-in.h	26 Mar 2007 00:13:50 -0000
@@ -353,6 +353,8 @@ extern long _bfd_norelocs_canonicalize_r
 					      arelent **, asymbol **);
 #define _bfd_norelocs_bfd_reloc_type_lookup \
   ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr)
+#define _bfd_norelocs_bfd_reloc_name_lookup \
+  ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr)
 
 /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not
    be written.  Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite).  */
Index: bfd/mipsbsd.c
===================================================================
RCS file: /cvs/src/src/bfd/mipsbsd.c,v
retrieving revision 1.16
diff -u -p -r1.16 mipsbsd.c
--- bfd/mipsbsd.c	18 Aug 2005 03:48:26 -0000	1.16
+++ bfd/mipsbsd.c	26 Mar 2007 00:13:51 -0000
@@ -1,6 +1,6 @@
 /* BFD backend for MIPS BSD (a.out) binaries.
-   Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+   2007 Free Software Foundation, Inc.
    Written by Ralph Campbell.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -56,7 +56,8 @@ static bfd_boolean MY(write_object_conte
 
 /* We can't use MY(x) here because it leads to a recursive call to CONCAT2
    when expanded inside JUMP_TABLE.  */
-#define MY_bfd_reloc_type_lookup mipsbsd_reloc_howto_type_lookup
+#define MY_bfd_reloc_type_lookup mipsbsd_reloc_type_lookup
+#define MY_bfd_reloc_name_lookup mipsbsd_reloc_name_lookup
 #define MY_canonicalize_reloc mipsbsd_canonicalize_reloc
 
 #define MY_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
@@ -72,8 +73,6 @@ static bfd_boolean MY(write_object_conte
 static bfd_reloc_status_type mips_fix_jmp_addr
   PARAMS ((bfd *, arelent *, struct bfd_symbol *, PTR, asection *,
 	   bfd *, char **));
-static reloc_howto_type *MY(reloc_howto_type_lookup)
-  PARAMS ((bfd *, bfd_reloc_code_real_type));
 
 long MY(canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, asymbol **));
 
@@ -302,9 +301,7 @@ static reloc_howto_type mips_howto_table
 };
 
 static reloc_howto_type *
-MY(reloc_howto_type_lookup) (abfd, code)
-     bfd *abfd;
-     bfd_reloc_code_real_type code;
+MY(reloc_type_lookup) (bfd *abfd, bfd_reloc_code_real_type code)
 {
 
   if (bfd_get_arch (abfd) != bfd_arch_mips)
@@ -330,6 +327,22 @@ MY(reloc_howto_type_lookup) (abfd, code)
     }
 }
 
+static reloc_howto_type *
+MY(reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED,
+			     const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (mips_howto_table_ext) / sizeof (mips_howto_table_ext[0]);
+       i++)
+    if (mips_howto_table_ext[i].name != NULL
+	&& strcasecmp (mips_howto_table_ext[i].name, r_name) == 0)
+      return &mips_howto_table_ext[i];
+
+  return NULL;
+}
+
 /* This is just like the standard aoutx.h version but we need to do our
    own mapping of external reloc type values to howto entries.  */
 long
Index: bfd/nlm-target.h
===================================================================
RCS file: /cvs/src/src/bfd/nlm-target.h,v
retrieving revision 1.17
diff -u -p -r1.17 nlm-target.h
--- bfd/nlm-target.h	23 May 2005 17:44:55 -0000	1.17
+++ bfd/nlm-target.h	26 Mar 2007 00:13:51 -0000
@@ -1,6 +1,6 @@
 /* Target definitions for 32/64-bit NLM (NetWare Loadable Module)
    Copyright 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005 Free Software Foundation, Inc.
+   2005, 2007 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -37,6 +37,7 @@
 #define nlm_get_reloc_upper_bound               nlmNAME (get_reloc_upper_bound)
 #define nlm_canonicalize_reloc                  nlmNAME (canonicalize_reloc)
 #define nlm_bfd_reloc_type_lookup               bfd_default_reloc_type_lookup
+#define nlm_bfd_reloc_name_lookup         _bfd_norelocs_bfd_reloc_name_lookup
 #define nlm_set_section_contents                nlmNAME (set_section_contents)
 
 #define nlm_sizeof_headers                      _bfd_nolink_sizeof_headers
Index: bfd/oasys.c
===================================================================
RCS file: /cvs/src/src/bfd/oasys.c,v
retrieving revision 1.35
diff -u -p -r1.35 oasys.c
--- bfd/oasys.c	19 Jun 2006 13:17:43 -0000	1.35
+++ bfd/oasys.c	26 Mar 2007 00:13:52 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for oasys objects.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001,
-   2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support, <sac@cygnus.com>.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -1187,6 +1187,7 @@ oasys_sizeof_headers (bfd *abfd ATTRIBUT
 #define oasys_read_minisymbols                     _bfd_generic_read_minisymbols
 #define oasys_minisymbol_to_symbol                 _bfd_generic_minisymbol_to_symbol
 #define oasys_bfd_reloc_type_lookup                _bfd_norelocs_bfd_reloc_type_lookup
+#define oasys_bfd_reloc_name_lookup          _bfd_norelocs_bfd_reloc_name_lookup
 #define oasys_set_arch_mach                        bfd_default_set_arch_mach
 #define oasys_get_section_contents_in_window       _bfd_generic_get_section_contents_in_window
 #define oasys_bfd_get_relocated_section_contents   bfd_generic_get_relocated_section_contents
Index: bfd/pdp11.c
===================================================================
RCS file: /cvs/src/src/bfd/pdp11.c,v
retrieving revision 1.36
diff -u -p -r1.36 pdp11.c
--- bfd/pdp11.c	19 Jun 2006 13:17:43 -0000	1.36
+++ bfd/pdp11.c	26 Mar 2007 00:13:54 -0000
@@ -1,5 +1,5 @@
 /* BFD back-end for PDP-11 a.out binaries.
-   Copyright 2001, 2002, 2003, 2004, 2005, 2006
+   Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -277,6 +277,22 @@ NAME (aout, reloc_type_lookup) (bfd * ab
     }
 }
 
+reloc_howto_type *
+NAME (aout, reloc_name_lookup) (bfd *abfd ATTRIBUTE_UNUSED,
+				      const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (howto_table_pdp11) / sizeof (howto_table_pdp11[0]);
+       i++)
+    if (howto_table_pdp11[i].name != NULL
+	&& strcasecmp (howto_table_pdp11[i].name, r_name) == 0)
+      return &howto_table_pdp11[i];
+
+  return NULL;
+}
+
 static int
 pdp11_aout_write_headers (bfd *abfd, struct internal_exec *execp)
 {
Index: bfd/pe-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/pe-mips.c,v
retrieving revision 1.18
diff -u -p -r1.18 pe-mips.c
--- bfd/pe-mips.c	4 May 2005 15:53:37 -0000	1.18
+++ bfd/pe-mips.c	26 Mar 2007 00:13:55 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for MIPS PE COFF files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
    Modified from coff-i386.c by DJ Delorie, dj@cygnus.com
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -453,6 +453,7 @@ coff_mips_rtype_to_howto (bfd *abfd ATTR
 
 #define coff_rtype_to_howto         coff_mips_rtype_to_howto
 #define coff_bfd_reloc_type_lookup  coff_mips_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup coff_mips_reloc_name_lookup
 
 /* Get the howto structure for a generic reloc type.  */
 
@@ -496,6 +497,22 @@ coff_mips_reloc_type_lookup (bfd *abfd A
   return & howto_table [mips_type];
 }
 
+static reloc_howto_type *
+coff_mips_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			     const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (howto_table) / sizeof (howto_table[0]);
+       i++)
+    if (howto_table[i].name != NULL
+	&& strcasecmp (howto_table[i].name, r_name) == 0)
+      return &howto_table[i];
+
+  return NULL;
+}
+
 static void
 mips_swap_reloc_in (bfd * abfd, void * src, void * dst)
 {
Index: bfd/reloc.c
===================================================================
RCS file: /cvs/src/src/bfd/reloc.c,v
retrieving revision 1.163
diff -u -p -r1.163 reloc.c
--- bfd/reloc.c	7 Mar 2007 14:40:33 -0000	1.163
+++ bfd/reloc.c	26 Mar 2007 00:13:57 -0000
@@ -4942,10 +4942,13 @@ CODE_FRAGMENT
 /*
 FUNCTION
 	bfd_reloc_type_lookup
+	bfd_reloc_name_lookup
 
 SYNOPSIS
 	reloc_howto_type *bfd_reloc_type_lookup
 	  (bfd *abfd, bfd_reloc_code_real_type code);
+	reloc_howto_type *bfd_reloc_name_lookup
+	  (bfd *abfd, const char *reloc_name);
 
 DESCRIPTION
 	Return a pointer to a howto structure which, when
@@ -4960,6 +4963,12 @@ bfd_reloc_type_lookup (bfd *abfd, bfd_re
   return BFD_SEND (abfd, reloc_type_lookup, (abfd, code));
 }
 
+reloc_howto_type *
+bfd_reloc_name_lookup (bfd *abfd, const char *reloc_name)
+{
+  return BFD_SEND (abfd, reloc_name_lookup, (abfd, reloc_name));
+}
+
 static reloc_howto_type bfd_howto_32 =
 HOWTO (0, 00, 2, 32, FALSE, 0, complain_overflow_dont, 0, "VRT32", FALSE, 0xffffffff, 0xffffffff, TRUE);
 
Index: bfd/riscix.c
===================================================================
RCS file: /cvs/src/src/bfd/riscix.c,v
retrieving revision 1.15
diff -u -p -r1.15 riscix.c
--- bfd/riscix.c	4 May 2005 15:53:38 -0000	1.15
+++ bfd/riscix.c	26 Mar 2007 00:13:57 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for RISC iX (Acorn, arm) binaries.
    Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004,
-   2005 Free Software Foundation, Inc.
+   2005, 2007 Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -274,12 +274,29 @@ riscix_reloc_type_lookup (bfd *abfd, bfd
     }
 }
 
+static reloc_howto_type *
+riscix_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			  const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (riscix_std_reloc_howto) / sizeof (riscix_std_reloc_howto[0]);
+       i++)
+    if (riscix_std_reloc_howto[i].name != NULL
+	&& strcasecmp (riscix_std_reloc_howto[i].name, r_name) == 0)
+      return &riscix_std_reloc_howto[i];
+
+  return NULL;
+}
+
 #define MY_bfd_link_hash_table_create  _bfd_generic_link_hash_table_create
 #define MY_bfd_link_add_symbols        _bfd_generic_link_add_symbols
 #define MY_final_link_callback         should_not_be_used
 #define MY_bfd_final_link              _bfd_generic_final_link
 
 #define MY_bfd_reloc_type_lookup       riscix_reloc_type_lookup
+#define MY_bfd_reloc_name_lookup riscix_reloc_name_lookup
 #define MY_canonicalize_reloc          riscix_canonicalize_reloc
 #define MY_object_p                    riscix_object_p
 
Index: bfd/som.c
===================================================================
RCS file: /cvs/src/src/bfd/som.c,v
retrieving revision 1.62
diff -u -p -r1.62 som.c
--- bfd/som.c	16 Sep 2006 18:12:14 -0000	1.62
+++ bfd/som.c	26 Mar 2007 00:14:01 -0000
@@ -1,6 +1,6 @@
 /* bfd back-end for HP PA-RISC SOM objects.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
 
    Contributed by the Center for Software Science at the
@@ -1626,6 +1626,22 @@ som_bfd_reloc_type_lookup (bfd *abfd ATT
   return NULL;
 }
 
+static reloc_howto_type *
+som_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			   const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (som_hppa_howto_table) / sizeof (som_hppa_howto_table[0]);
+       i++)
+    if (som_hppa_howto_table[i].name != NULL
+	&& strcasecmp (som_hppa_howto_table[i].name, r_name) == 0)
+      return &som_hppa_howto_table[i];
+
+  return NULL;
+}
+
 /* Perform some initialization for an object.  Save results of this
    initialization in the BFD.  */
 
Index: bfd/targets.c
===================================================================
RCS file: /cvs/src/src/bfd/targets.c,v
retrieving revision 1.159
diff -u -p -r1.159 targets.c
--- bfd/targets.c	18 Mar 2007 17:20:07 -0000	1.159
+++ bfd/targets.c	26 Mar 2007 00:14:01 -0000
@@ -402,7 +402,8 @@ BFD_JUMP_TABLE macros.
 .#define BFD_JUMP_TABLE_RELOCS(NAME) \
 .  NAME##_get_reloc_upper_bound, \
 .  NAME##_canonicalize_reloc, \
-.  NAME##_bfd_reloc_type_lookup
+.  NAME##_bfd_reloc_type_lookup, \
+.  NAME##_bfd_reloc_name_lookup
 .
 .  long        (*_get_reloc_upper_bound) (bfd *, sec_ptr);
 .  long        (*_bfd_canonicalize_reloc)
@@ -410,6 +411,8 @@ BFD_JUMP_TABLE macros.
 .  {* See documentation on reloc types.  *}
 .  reloc_howto_type *
 .              (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
+.  reloc_howto_type *
+.              (*reloc_name_lookup) (bfd *, const char *);
 .
 .
 .  {* Routines used when writing an object file.  *}
Index: bfd/versados.c
===================================================================
RCS file: /cvs/src/src/bfd/versados.c,v
retrieving revision 1.31
diff -u -p -r1.31 versados.c
--- bfd/versados.c	19 Jun 2006 13:17:43 -0000	1.31
+++ bfd/versados.c	26 Mar 2007 00:14:02 -0000
@@ -1,6 +1,6 @@
 /* BFD back-end for VERSAdos-E objects.
    Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-   2006 Free Software Foundation, Inc.
+   2006, 2007 Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
 
    Versados is a Motorola trademark.
@@ -798,6 +798,7 @@ versados_canonicalize_reloc (bfd *abfd,
 #define versados_read_minisymbols                     _bfd_generic_read_minisymbols
 #define versados_minisymbol_to_symbol                 _bfd_generic_minisymbol_to_symbol
 #define versados_bfd_reloc_type_lookup                _bfd_norelocs_bfd_reloc_type_lookup
+#define versados_bfd_reloc_name_lookup          _bfd_norelocs_bfd_reloc_name_lookup
 #define versados_set_arch_mach                        bfd_default_set_arch_mach
 #define versados_bfd_get_relocated_section_contents   bfd_generic_get_relocated_section_contents
 #define versados_bfd_relax_section                    bfd_generic_relax_section
Index: bfd/vms.c
===================================================================
RCS file: /cvs/src/src/bfd/vms.c,v
retrieving revision 1.40
diff -u -p -r1.40 vms.c
--- bfd/vms.c	19 Jun 2006 13:17:43 -0000	1.40
+++ bfd/vms.c	26 Mar 2007 00:14:02 -0000
@@ -1,7 +1,7 @@
 /* vms.c -- BFD back-end for VAX (openVMS/VAX) and
    EVAX (openVMS/Alpha) files.
    Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-   2006 Free Software Foundation, Inc.
+   2006, 2007 Free Software Foundation, Inc.
 
    Written by Klaus K"ampf (kkaempf@rmi.de)
 
@@ -1353,6 +1353,22 @@ vms_bfd_reloc_type_lookup (bfd * abfd AT
   return & alpha_howto_table[alpha_type];
 }
 
+static reloc_howto_type *
+vms_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			   const char *r_name)
+{
+  unsigned int i;
+
+  for (i = 0;
+       i < sizeof (alpha_howto_table) / sizeof (alpha_howto_table[0]);
+       i++)
+    if (alpha_howto_table[i].name != NULL
+	&& strcasecmp (alpha_howto_table[i].name, r_name) == 0)
+      return &alpha_howto_table[i];
+
+  return NULL;
+}
+
 /* Part 4.7, writing an object file.  */
 
 /* Set the architecture and machine type in BFD abfd to arch and mach.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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