aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-dlx.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-dlx.c')
-rw-r--r--bfd/elf32-dlx.c37
1 files changed, 29 insertions, 8 deletions
diff --git a/bfd/elf32-dlx.c b/bfd/elf32-dlx.c
index ae42baf3a632..f57387bf5d6f 100644
--- a/bfd/elf32-dlx.c
+++ b/bfd/elf32-dlx.c
@@ -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.
@@ -18,8 +19,8 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
-#include "bfd.h"
#include "sysdep.h"
+#include "bfd.h"
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/dlx.h"
@@ -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,27 +508,46 @@ elf32_dlx_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
}
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)
{
case R_DLX_RELOC_16_PCREL:
return & elf_dlx_gnu_rel16_s2;
- break;
case R_DLX_RELOC_26_PCREL:
return & elf_dlx_gnu_rel26_s2;
- break;
case R_DLX_RELOC_16_HI:
return & elf_dlx_reloc_16_hi;
- break;
case R_DLX_RELOC_16_LO:
return & elf_dlx_reloc_16_lo;
- break;
-
default:
BFD_ASSERT (r_type < (unsigned int) R_DLX_max);
return & dlx_elf_howto_table[r_type];
- break;
}
}