/* NDS32-specific support for 32-bit ELF.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2017 Free Software Foundation, Inc.
Contributed by Andes Technology Corporation.
This file is part of BFD, the Binary File Descriptor library.
}
}
- if (add_symbol == TRUE)
+ if (add_symbol)
{
if (h)
{
if (bfd_link_pic (info))
{
_bfd_error_handler
- (_("%s: warning: cannot deal R_NDS32_25_ABS_RELA in shared "
- "mode."), bfd_get_filename (input_bfd));
+ (_("%B: warning: cannot deal R_NDS32_25_ABS_RELA in shared "
+ "mode."), input_bfd);
return FALSE;
}
break;
dyn.d_un.d_val = s->size;
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
-
- case DT_RELASZ:
- /* My reading of the SVR4 ABI indicates that the
- procedure linkage table relocs (DT_JMPREL) should be
- included in the overall relocs (DT_RELA). This is
- what Solaris does. However, UnixWare can not handle
- that case. Therefore, we override the DT_RELASZ entry
- here to make it not include the JMPREL relocs. Since
- the linker script arranges for .rela.plt to follow all
- other relocation sections, we don't have to worry
- about changing the DT_RELA entry. */
- if (htab->root.srelplt != NULL)
- {
- s = htab->root.srelplt;
- dyn.d_un.d_val -= s->size;
- }
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
- break;
}
}
unsigned long before, between;
bfd_byte *endp, *p;
- val = read_unsigned_leb128 (abfd, contents + irel->r_offset,
- &len);
+ val = _bfd_read_unsigned_leb128 (abfd, contents + irel->r_offset,
+ &len);
before = get_nds32_elf_blank_total (&blank_t, irel->r_addend, 0);
between = get_nds32_elf_blank_total (&blank_t,
irelend, isymbuf))
goto error_return;
- if (*again == FALSE)
+ if (!*again)
{
if (!nds32_fag_remove_unused_fpbase (abfd, sec, internal_relocs,
irelend))
nds32_elf_pick_relax (FALSE, sec, again, table, link_info);
- if (*again == FALSE)
+ if (!*again)
{
if (!nds32_relax_adjust_label (abfd, sec, internal_relocs, contents,
&relax_blank_list, optimize, opt_size))
relax_blank_list = NULL;
}
- if (*again == FALSE)
+ if (!*again)
{
/* Closing the section, so we don't relax it anymore. */
bfd_vma sec_size_align;
{
int num = 0;
bfd_byte *contents;
- unsigned long insn;
FILE *ex9_import_file;
int update_ex9_table;
struct elf_nds32_link_hash_table *table;
/* Read instructions from the input file and build the list. */
while (!feof (ex9_import_file))
{
+ unsigned long insn;
char *code;
struct elf_nds32_insn_times_entry *ptr;
size_t nread;
break;
insn = bfd_getb32 (contents);
code = bfd_malloc (sizeof (char) * 9);
- snprintf (code, 9, "%08lx", insn);
+ snprintf (code, 9, "%08lx", (insn & 0xffffffff));
ptr = bfd_malloc (sizeof (struct elf_nds32_insn_times_entry));
ptr->string = code;
ptr->order = num;
/* Incorrect alignment. */
_bfd_error_handler
/* xgettext:c-format */
- (_("%s: warning: unaligned small data access. "
+ (_("%B: warning: unaligned small data access. "
"For entry: {%d, %d, %d}, addr = 0x%x, align = 0x%x."),
- bfd_get_filename (abfd), irel->r_offset,
+ abfd, irel->r_offset,
irel->r_info, irel->r_addend, relocation, align);
off += 4;
continue;
#define elf_backend_may_use_rel_p 1
#define elf_backend_default_use_rela_p 1
#define elf_backend_may_use_rela_p 1
+#define elf_backend_dtrel_excludes_plt 1
#include "elf32-target.h"