/* DLX specific support for 32-bit ELF
- Copyright (C) 2002-2014 Free Software Foundation, Inc.
+ Copyright (C) 2002-2017 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#include "libbfd.h"
#include "elf-bfd.h"
#include "elf/dlx.h"
+#include "elf32-dlx.h"
#define USE_REL 1
static int skip_dlx_elf_hi16_reloc = 0;
-extern int set_dlx_skip_hi16_flag (int);
-
int
set_dlx_skip_hi16_flag (int flag)
{
/* Can not support a long jump to sections other then .text. */
if (strcmp (input_section->name, symbol->section->output_section->name) != 0)
{
- (*_bfd_error_handler) (_("BFD Link Error: branch (PC rel16) to section (%s) not supported"),
- symbol->section->output_section->name);
+ _bfd_error_handler
+ (_("BFD Link Error: branch (PC rel16) to section (%s) not supported"),
+ symbol->section->output_section->name);
return bfd_reloc_undefined;
}
/* Can not support a long jump to sections other then .text */
if (strcmp (input_section->name, symbol->section->output_section->name) != 0)
{
- (*_bfd_error_handler) (_("BFD Link Error: jump (PC rel26) to section (%s) not supported"),
- symbol->section->output_section->name);
+ _bfd_error_handler
+ (_("BFD Link Error: jump (PC rel26) to section (%s) not supported"),
+ symbol->section->output_section->name);
return bfd_reloc_undefined;
}
/* No relocation. */
HOWTO (R_DLX_NONE, /* Type. */
0, /* Rightshift. */
- 0, /* size (0 = byte, 1 = short, 2 = long). */
+ 3, /* size (0 = byte, 1 = short, 2 = long). */
0, /* Bitsize. */
FALSE, /* PC_relative. */
0, /* Bitpos. */
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- if (info->relocatable)
+ if (bfd_link_relocatable (info))
return TRUE;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
case R_DLX_RELOC_16_LO:
return & elf_dlx_reloc_16_lo;
default:
- BFD_ASSERT (r_type < (unsigned int) R_DLX_max);
+ if (r_type >= (unsigned int) R_DLX_max)
+ {
+ _bfd_error_handler (_("Invalid DLX reloc number: %d"), r_type);
+ r_type = 0;
+ }
return & dlx_elf_howto_table[r_type];
}
}
return;
}
-#define TARGET_BIG_SYM bfd_elf32_dlx_big_vec
+#define TARGET_BIG_SYM dlx_elf32_be_vec
#define TARGET_BIG_NAME "elf32-dlx"
#define ELF_ARCH bfd_arch_dlx
#define ELF_MACHINE_CODE EM_DLX