blob: 0aa7c9ee564c9201ca5574404211c84df36d9350 [file] [log] [blame]
/* NDS32-specific support for 32-bit ELF.
Copyright (C) 2012-2021 Free Software Foundation, Inc.
Contributed by Andes Technology Corporation.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
#include "sysdep.h"
#include "bfd.h"
#include "bfdlink.h"
#include "libbfd.h"
#include "elf-bfd.h"
#include "libiberty.h"
#include "elf/nds32.h"
#include "opcode/nds32.h"
#include "elf32-nds32.h"
#include "opcode/cgen.h"
#include "../opcodes/nds32-opc.h"
/* All users of this file have bfd_octets_per_byte (abfd, sec) == 1. */
#define OCTETS_PER_BYTE(ABFD, SEC) 1
/* Relocation HOWTO functions. */
static bfd_reloc_status_type nds32_elf_ignore_reloc
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
static bfd_reloc_status_type nds32_elf_9_pcrel_reloc
(bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
static bfd_reloc_status_type nds32_elf_hi20_reloc
(bfd *, arelent *, asymbol *, void *,
asection *, bfd *, char **);
static bfd_reloc_status_type nds32_elf_lo12_reloc
(bfd *, arelent *, asymbol *, void *,
asection *, bfd *, char **);
static bfd_reloc_status_type nds32_elf_generic_reloc
(bfd *, arelent *, asymbol *, void *,
asection *, bfd *, char **);
static bfd_reloc_status_type nds32_elf_sda15_reloc
(bfd *, arelent *, asymbol *, void *,
asection *, bfd *, char **);
/* Helper functions for HOWTO. */
static bfd_reloc_status_type nds32_elf_do_9_pcrel_reloc
(bfd *, reloc_howto_type *, asection *, bfd_byte *, bfd_vma,
asection *, bfd_vma, bfd_vma);
/* Nds32 helper functions. */
static bfd_vma calculate_memory_address
(bfd *, Elf_Internal_Rela *, Elf_Internal_Sym *, Elf_Internal_Shdr *);
static int nds32_get_section_contents (bfd *, asection *,
bfd_byte **, bool);
static int nds32_get_local_syms (bfd *, asection *ATTRIBUTE_UNUSED,
Elf_Internal_Sym **);
static bool nds32_relax_fp_as_gp
(struct bfd_link_info *link_info, bfd *abfd, asection *sec,
Elf_Internal_Rela *internal_relocs, Elf_Internal_Rela *irelend,
Elf_Internal_Sym *isymbuf);
static bool nds32_fag_remove_unused_fpbase
(bfd *abfd, asection *sec, Elf_Internal_Rela *internal_relocs,
Elf_Internal_Rela *irelend);
enum
{
MACH_V1 = bfd_mach_n1h,
MACH_V2 = bfd_mach_n1h_v2,
MACH_V3 = bfd_mach_n1h_v3,
MACH_V3M = bfd_mach_n1h_v3m
};
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
/* The name of the dynamic interpreter. This is put in the .interp
section. */
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
#define NDS32_GUARD_SEC_P(flags) ((flags) & SEC_ALLOC \
&& (flags) & SEC_LOAD \
&& (flags) & SEC_READONLY)
/* The nop opcode we use. */
#define NDS32_NOP32 0x40000009
#define NDS32_NOP16 0x9200
/* The size in bytes of an entry in the procedure linkage table. */
#define PLT_ENTRY_SIZE 24
#define PLT_HEADER_SIZE 24
/* The first entry in a procedure linkage table are reserved,
and the initial contents are unimportant (we zero them out).
Subsequent entries look like this. */
#define PLT0_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(.got+4) */
#define PLT0_ENTRY_WORD1 0x58f78000 /* ori r15, r25, LO12(.got+4) */
#define PLT0_ENTRY_WORD2 0x05178000 /* lwi r17, [r15+0] */
#define PLT0_ENTRY_WORD3 0x04f78001 /* lwi r15, [r15+4] */
#define PLT0_ENTRY_WORD4 0x4a003c00 /* jr r15 */
/* $ta is change to $r15 (from $r25). */
#define PLT0_PIC_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(got[1]@GOT) */
#define PLT0_PIC_ENTRY_WORD1 0x58f78000 /* ori r15, r15, LO12(got[1]@GOT) */
#define PLT0_PIC_ENTRY_WORD2 0x40f7f400 /* add r15, gp, r15 */
#define PLT0_PIC_ENTRY_WORD3 0x05178000 /* lwi r17, [r15+0] */
#define PLT0_PIC_ENTRY_WORD4 0x04f78001 /* lwi r15, [r15+4] */
#define PLT0_PIC_ENTRY_WORD5 0x4a003c00 /* jr r15 */
#define PLT_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(&got[n+3]) */
#define PLT_ENTRY_WORD1 0x04f78000 /* lwi r15, r15, LO12(&got[n+3]) */
#define PLT_ENTRY_WORD2 0x4a003c00 /* jr r15 */
#define PLT_ENTRY_WORD3 0x45000000 /* movi r16, sizeof(RELA) * n */
#define PLT_ENTRY_WORD4 0x48000000 /* j .plt0. */
#define PLT_PIC_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(got[n+3]@GOT) */
#define PLT_PIC_ENTRY_WORD1 0x58f78000 /* ori r15, r15, LO12(got[n+3]@GOT) */
#define PLT_PIC_ENTRY_WORD2 0x38febc02 /* lw r15, [gp+r15] */
#define PLT_PIC_ENTRY_WORD3 0x4a003c00 /* jr r15 */
#define PLT_PIC_ENTRY_WORD4 0x45000000 /* movi r16, sizeof(RELA) * n */
#define PLT_PIC_ENTRY_WORD5 0x48000000 /* j .plt0 */
/* These are macros used to get the relocation accurate value. */
#define ACCURATE_8BIT_S1 (0x100)
#define ACCURATE_U9BIT_S1 (0x400)
#define ACCURATE_12BIT_S1 (0x2000)
#define ACCURATE_14BIT_S1 (0x4000)
#define ACCURATE_19BIT (0x40000)
/* These are macros used to get the relocation conservative value. */
#define CONSERVATIVE_8BIT_S1 (0x100 - 4)
#define CONSERVATIVE_14BIT_S1 (0x4000 - 4)
#define CONSERVATIVE_16BIT_S1 (0x10000 - 4)
#define CONSERVATIVE_24BIT_S1 (0x1000000 - 4)
/* These must be more conservative because the address may be in
different segment. */
#define CONSERVATIVE_15BIT (0x4000 - 0x1000)
#define CONSERVATIVE_15BIT_S1 (0x8000 - 0x1000)
#define CONSERVATIVE_15BIT_S2 (0x10000 - 0x1000)
#define CONSERVATIVE_19BIT (0x40000 - 0x1000)
#define CONSERVATIVE_20BIT (0x80000 - 0x1000)
/* Size of small data/bss sections, used to calculate SDA_BASE. */
static long got_size = 0;
static int is_SDA_BASE_set = 0;
/* Convert ELF-VER in eflags to string for debugging purpose. */
static const char *const nds32_elfver_strtab[] =
{
"ELF-1.2",
"ELF-1.3",
"ELF-1.4",
};
/* The nds32 linker needs to keep track of the number of relocs that it
decides to copy in check_relocs for each symbol. This is so that
it can discard PC relative relocs if it doesn't need them when
linking with -Bsymbolic. We store the information in a field
extending the regular ELF linker hash table. */
/* This structure keeps track of the number of PC relative relocs we
have copied for a given symbol. */
struct elf_nds32_pcrel_relocs_copied
{
/* Next section. */
struct elf_nds32_pcrel_relocs_copied *next;
/* A section in dynobj. */
asection *section;
/* Number of relocs copied in this section. */
bfd_size_type count;
};
enum elf_nds32_tls_type
{
GOT_UNKNOWN = (0),
GOT_NORMAL = (1 << 0),
GOT_TLS_LE = (1 << 1),
GOT_TLS_IE = (1 << 2),
GOT_TLS_IEGP = (1 << 3),
GOT_TLS_LD = (1 << 4),
GOT_TLS_GD = (1 << 5),
GOT_TLS_DESC = (1 << 6),
};
/* Nds32 ELF linker hash entry. */
struct elf_nds32_link_hash_entry
{
struct elf_link_hash_entry root;
/* For checking relocation type. */
enum elf_nds32_tls_type tls_type;
int offset_to_gp;
};
/* Get the nds32 ELF linker hash table from a link_info structure. */
#define FP_BASE_NAME "_FP_BASE_"
static int check_start_export_sym = 0;
/* The offset for executable tls relaxation. */
#define TP_OFFSET 0x0
typedef struct
{
int min_id;
int max_id;
int count;
int bias;
int init;
} elf32_nds32_relax_group_t;
struct elf_nds32_obj_tdata
{
struct elf_obj_tdata root;
/* tls_type for each local got entry. */
char *local_got_tls_type;
/* GOTPLT entries for TLS descriptors. */
bfd_vma *local_tlsdesc_gotent;
/* for R_NDS32_RELAX_GROUP handling. */
elf32_nds32_relax_group_t relax_group;
unsigned int hdr_size;
int* offset_to_gp;
};
#define elf_nds32_tdata(bfd) \
((struct elf_nds32_obj_tdata *) (bfd)->tdata.any)
#define elf32_nds32_local_got_tls_type(bfd) \
(elf_nds32_tdata (bfd)->local_got_tls_type)
#define elf32_nds32_local_gp_offset(bfd) \
(elf_nds32_tdata (bfd)->offset_to_gp)
#define elf32_nds32_hash_entry(ent) ((struct elf_nds32_link_hash_entry *)(ent))
#define elf32_nds32_relax_group_ptr(bfd) \
&(elf_nds32_tdata (bfd)->relax_group)
static bool
nds32_elf_mkobject (bfd *abfd)
{
return bfd_elf_allocate_object (abfd, sizeof (struct elf_nds32_obj_tdata),
NDS32_ELF_DATA);
}
/* Relocations used for relocation. */
/* Define HOWTO2 (for relocation) and HOWTO3 (for relaxation) to
initialize array nds32_elf_howto_table in any order. The benefit
is that we can add any new relocations with any numbers and don't
need to fill the gap by lots of EMPTY_HOWTO. */
#define HOWTO2(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
[C] = HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC)
static reloc_howto_type nds32_elf_howto_table[] =
{
/* This reloc does nothing. */
HOWTO2 (R_NDS32_NONE, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_NONE", /* name */
false, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
false), /* pcrel_offset */
/* A 16 bit absolute relocation. */
HOWTO2 (R_NDS32_16, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
nds32_elf_generic_reloc,/* special_function */
"R_NDS32_16", /* name */
false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
false), /* pcrel_offset */
/* A 32 bit absolute relocation. */
HOWTO2 (R_NDS32_32, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
nds32_elf_generic_reloc,/* special_function */
"R_NDS32_32", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* A 20 bit address. */
HOWTO2 (R_NDS32_20, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_unsigned,/* complain_on_overflow */
nds32_elf_generic_reloc,/* special_function */
"R_NDS32_20", /* name */
false, /* partial_inplace */
0xfffff, /* src_mask */
0xfffff, /* dst_mask */
false), /* pcrel_offset */
/* An PC Relative 9-bit relocation, shifted by 2.
This reloc is complicated because relocations are relative to pc & -4.
i.e. branches in the right insn slot use the address of the left insn
slot for pc. */
/* It's not clear whether this should have partial_inplace set or not.
Branch relaxing in the assembler can store the addend in the insn,
and if bfd_install_relocation gets called the addend may get added
again. */
HOWTO2 (R_NDS32_9_PCREL, /* type */
1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
nds32_elf_9_pcrel_reloc,/* special_function */
"R_NDS32_9_PCREL", /* name */
false, /* partial_inplace */
0xff, /* src_mask */
0xff, /* dst_mask */
true), /* pcrel_offset */
/* A relative 15 bit relocation, right shifted by 1. */
HOWTO2 (R_NDS32_15_PCREL, /* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
14, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_15_PCREL", /* name */
false, /* partial_inplace */
0x3fff, /* src_mask */
0x3fff, /* dst_mask */
true), /* pcrel_offset */
/* A relative 17 bit relocation, right shifted by 1. */
HOWTO2 (R_NDS32_17_PCREL, /* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_17_PCREL", /* name */
false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
true), /* pcrel_offset */
/* A relative 25 bit relocation, right shifted by 1. */
/* It's not clear whether this should have partial_inplace set or not.
Branch relaxing in the assembler can store the addend in the insn,
and if bfd_install_relocation gets called the addend may get added
again. */
HOWTO2 (R_NDS32_25_PCREL, /* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
24, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_25_PCREL", /* name */
false, /* partial_inplace */
0xffffff, /* src_mask */
0xffffff, /* dst_mask */
true), /* pcrel_offset */
/* High 20 bits of address when lower 12 is or'd in. */
HOWTO2 (R_NDS32_HI20, /* type */
12, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_hi20_reloc, /* special_function */
"R_NDS32_HI20", /* name */
false, /* partial_inplace */
0x000fffff, /* src_mask */
0x000fffff, /* dst_mask */
false), /* pcrel_offset */
/* Lower 12 bits of address. */
HOWTO2 (R_NDS32_LO12S3, /* type */
3, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
9, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_lo12_reloc, /* special_function */
"R_NDS32_LO12S3", /* name */
false, /* partial_inplace */
0x000001ff, /* src_mask */
0x000001ff, /* dst_mask */
false), /* pcrel_offset */
/* Lower 12 bits of address. */
HOWTO2 (R_NDS32_LO12S2, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
10, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_lo12_reloc, /* special_function */
"R_NDS32_LO12S2", /* name */
false, /* partial_inplace */
0x000003ff, /* src_mask */
0x000003ff, /* dst_mask */
false), /* pcrel_offset */
/* Lower 12 bits of address. */
HOWTO2 (R_NDS32_LO12S1, /* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
11, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_lo12_reloc, /* special_function */
"R_NDS32_LO12S1", /* name */
false, /* partial_inplace */
0x000007ff, /* src_mask */
0x000007ff, /* dst_mask */
false), /* pcrel_offset */
/* Lower 12 bits of address. */
HOWTO2 (R_NDS32_LO12S0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_lo12_reloc, /* special_function */
"R_NDS32_LO12S0", /* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
false), /* pcrel_offset */
/* Small data area 15 bits offset. */
HOWTO2 (R_NDS32_SDA15S3, /* type */
3, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
nds32_elf_sda15_reloc, /* special_function */
"R_NDS32_SDA15S3", /* name */
false, /* partial_inplace */
0x00007fff, /* src_mask */
0x00007fff, /* dst_mask */
false), /* pcrel_offset */
/* Small data area 15 bits offset. */
HOWTO2 (R_NDS32_SDA15S2, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
nds32_elf_sda15_reloc, /* special_function */
"R_NDS32_SDA15S2", /* name */
false, /* partial_inplace */
0x00007fff, /* src_mask */
0x00007fff, /* dst_mask */
false), /* pcrel_offset */
/* Small data area 15 bits offset. */
HOWTO2 (R_NDS32_SDA15S1, /* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
nds32_elf_sda15_reloc, /* special_function */
"R_NDS32_SDA15S1", /* name */
false, /* partial_inplace */
0x00007fff, /* src_mask */
0x00007fff, /* dst_mask */
false), /* pcrel_offset */
/* Small data area 15 bits offset. */
HOWTO2 (R_NDS32_SDA15S0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
nds32_elf_sda15_reloc, /* special_function */
"R_NDS32_SDA15S0", /* name */
false, /* partial_inplace */
0x00007fff, /* src_mask */
0x00007fff, /* dst_mask */
false), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy */
HOWTO2 (R_NDS32_GNU_VTINHERIT,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
0, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
NULL, /* special_function */
"R_NDS32_GNU_VTINHERIT",/* name */
false, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
false), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage */
HOWTO2 (R_NDS32_GNU_VTENTRY, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
0, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
_bfd_elf_rel_vtable_reloc_fn,/* special_function */
"R_NDS32_GNU_VTENTRY", /* name */
false, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
false), /* pcrel_offset */
/* A 16 bit absolute relocation. */
HOWTO2 (R_NDS32_16_RELA, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_16_RELA", /* name */
false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
false), /* pcrel_offset */
/* A 32 bit absolute relocation. */
HOWTO2 (R_NDS32_32_RELA, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_32_RELA", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* A 20 bit address. */
HOWTO2 (R_NDS32_20_RELA, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_20_RELA", /* name */
false, /* partial_inplace */
0xfffff, /* src_mask */
0xfffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_9_PCREL_RELA, /* type */
1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_9_PCREL_RELA",/* name */
false, /* partial_inplace */
0xff, /* src_mask */
0xff, /* dst_mask */
true), /* pcrel_offset */
/* A relative 15 bit relocation, right shifted by 1. */
HOWTO2 (R_NDS32_15_PCREL_RELA,/* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
14, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_15_PCREL_RELA",/* name */
false, /* partial_inplace */
0x3fff, /* src_mask */
0x3fff, /* dst_mask */
true), /* pcrel_offset */
/* A relative 17 bit relocation, right shifted by 1. */
HOWTO2 (R_NDS32_17_PCREL_RELA,/* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_17_PCREL_RELA",/* name */
false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
true), /* pcrel_offset */
/* A relative 25 bit relocation, right shifted by 2. */
HOWTO2 (R_NDS32_25_PCREL_RELA,/* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
24, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_25_PCREL_RELA",/* name */
false, /* partial_inplace */
0xffffff, /* src_mask */
0xffffff, /* dst_mask */
true), /* pcrel_offset */
/* High 20 bits of address when lower 16 is or'd in. */
HOWTO2 (R_NDS32_HI20_RELA, /* type */
12, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_HI20_RELA", /* name */
false, /* partial_inplace */
0x000fffff, /* src_mask */
0x000fffff, /* dst_mask */
false), /* pcrel_offset */
/* Lower 12 bits of address. */
HOWTO2 (R_NDS32_LO12S3_RELA, /* type */
3, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
9, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_LO12S3_RELA", /* name */
false, /* partial_inplace */
0x000001ff, /* src_mask */
0x000001ff, /* dst_mask */
false), /* pcrel_offset */
/* Lower 12 bits of address. */
HOWTO2 (R_NDS32_LO12S2_RELA, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
10, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_LO12S2_RELA", /* name */
false, /* partial_inplace */
0x000003ff, /* src_mask */
0x000003ff, /* dst_mask */
false), /* pcrel_offset */
/* Lower 12 bits of address. */
HOWTO2 (R_NDS32_LO12S1_RELA, /* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
11, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_LO12S1_RELA", /* name */
false, /* partial_inplace */
0x000007ff, /* src_mask */
0x000007ff, /* dst_mask */
false), /* pcrel_offset */
/* Lower 12 bits of address. */
HOWTO2 (R_NDS32_LO12S0_RELA, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_LO12S0_RELA", /* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
false), /* pcrel_offset */
/* Small data area 15 bits offset. */
HOWTO2 (R_NDS32_SDA15S3_RELA, /* type */
3, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_SDA15S3_RELA",/* name */
false, /* partial_inplace */
0x00007fff, /* src_mask */
0x00007fff, /* dst_mask */
false), /* pcrel_offset */
/* Small data area 15 bits offset. */
HOWTO2 (R_NDS32_SDA15S2_RELA, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_SDA15S2_RELA",/* name */
false, /* partial_inplace */
0x00007fff, /* src_mask */
0x00007fff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_SDA15S1_RELA, /* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_SDA15S1_RELA",/* name */
false, /* partial_inplace */
0x00007fff, /* src_mask */
0x00007fff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_SDA15S0_RELA, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_SDA15S0_RELA",/* name */
false, /* partial_inplace */
0x00007fff, /* src_mask */
0x00007fff, /* dst_mask */
false), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy */
HOWTO2 (R_NDS32_RELA_GNU_VTINHERIT,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
0, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
NULL, /* special_function */
"R_NDS32_RELA_GNU_VTINHERIT",/* name */
false, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
false), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage */
HOWTO2 (R_NDS32_RELA_GNU_VTENTRY,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
0, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
_bfd_elf_rel_vtable_reloc_fn,/* special_function */
"R_NDS32_RELA_GNU_VTENTRY",/* name */
false, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
false), /* pcrel_offset */
/* Like R_NDS32_20, but referring to the GOT table entry for
the symbol. */
HOWTO2 (R_NDS32_GOT20, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOT20", /* name */
false, /* partial_inplace */
0xfffff, /* src_mask */
0xfffff, /* dst_mask */
false), /* pcrel_offset */
/* Like R_NDS32_PCREL, but referring to the procedure linkage table
entry for the symbol. */
HOWTO2 (R_NDS32_25_PLTREL, /* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
24, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_25_PLTREL", /* name */
false, /* partial_inplace */
0xffffff, /* src_mask */
0xffffff, /* dst_mask */
true), /* pcrel_offset */
/* This is used only by the dynamic linker. The symbol should exist
both in the object being run and in some shared library. The
dynamic linker copies the data addressed by the symbol from the
shared library into the object, because the object being
run has to have the data at some particular address. */
HOWTO2 (R_NDS32_COPY, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_COPY", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Like R_NDS32_20, but used when setting global offset table
entries. */
HOWTO2 (R_NDS32_GLOB_DAT, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GLOB_DAT", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Marks a procedure linkage table entry for a symbol. */
HOWTO2 (R_NDS32_JMP_SLOT, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_JMP_SLOT", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Used only by the dynamic linker. When the object is run, this
longword is set to the load address of the object, plus the
addend. */
HOWTO2 (R_NDS32_RELATIVE, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_RELATIVE", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_GOTOFF, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOTOFF", /* name */
false, /* partial_inplace */
0xfffff, /* src_mask */
0xfffff, /* dst_mask */
false), /* pcrel_offset */
/* An PC Relative 20-bit relocation used when setting PIC offset
table register. */
HOWTO2 (R_NDS32_GOTPC20, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOTPC20", /* name */
false, /* partial_inplace */
0xfffff, /* src_mask */
0xfffff, /* dst_mask */
true), /* pcrel_offset */
/* Like R_NDS32_HI20, but referring to the GOT table entry for
the symbol. */
HOWTO2 (R_NDS32_GOT_HI20, /* type */
12, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOT_HI20", /* name */
false, /* partial_inplace */
0x000fffff, /* src_mask */
0x000fffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_GOT_LO12, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOT_LO12", /* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
false), /* pcrel_offset */
/* An PC Relative relocation used when setting PIC offset table register.
Like R_NDS32_HI20, but referring to the GOT table entry for
the symbol. */
HOWTO2 (R_NDS32_GOTPC_HI20, /* type */
12, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOTPC_HI20", /* name */
false, /* partial_inplace */
0x000fffff, /* src_mask */
0x000fffff, /* dst_mask */
true), /* pcrel_offset */
HOWTO2 (R_NDS32_GOTPC_LO12, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOTPC_LO12", /* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
true), /* pcrel_offset */
HOWTO2 (R_NDS32_GOTOFF_HI20, /* type */
12, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOTOFF_HI20", /* name */
false, /* partial_inplace */
0x000fffff, /* src_mask */
0x000fffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_GOTOFF_LO12, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOTOFF_LO12", /* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
false), /* pcrel_offset */
/* Alignment hint for relaxable instruction. This is used with
R_NDS32_LABEL as a pair. Relax this instruction from 4 bytes to 2
in order to make next label aligned on word boundary. */
HOWTO2 (R_NDS32_INSN16, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_INSN16", /* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
false), /* pcrel_offset */
/* Alignment hint for label. */
HOWTO2 (R_NDS32_LABEL, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LABEL", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for unconditional call sequence */
HOWTO2 (R_NDS32_LONGCALL1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LONGCALL1", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for conditional call sequence. */
HOWTO2 (R_NDS32_LONGCALL2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LONGCALL2", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for conditional call sequence. */
HOWTO2 (R_NDS32_LONGCALL3, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LONGCALL3", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for unconditional branch sequence. */
HOWTO2 (R_NDS32_LONGJUMP1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LONGJUMP1", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for conditional branch sequence. */
HOWTO2 (R_NDS32_LONGJUMP2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LONGJUMP2", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for conditional branch sequence. */
HOWTO2 (R_NDS32_LONGJUMP3, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LONGJUMP3", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for load/store sequence. */
HOWTO2 (R_NDS32_LOADSTORE, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LOADSTORE", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for load/store sequence. */
HOWTO2 (R_NDS32_9_FIXED_RELA, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_9_FIXED_RELA",/* name */
false, /* partial_inplace */
0x000000ff, /* src_mask */
0x000000ff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for load/store sequence. */
HOWTO2 (R_NDS32_15_FIXED_RELA,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_15_FIXED_RELA",/* name */
false, /* partial_inplace */
0x00003fff, /* src_mask */
0x00003fff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for load/store sequence. */
HOWTO2 (R_NDS32_17_FIXED_RELA,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_17_FIXED_RELA",/* name */
false, /* partial_inplace */
0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for load/store sequence. */
HOWTO2 (R_NDS32_25_FIXED_RELA,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_25_FIXED_RELA",/* name */
false, /* partial_inplace */
0x00ffffff, /* src_mask */
0x00ffffff, /* dst_mask */
false), /* pcrel_offset */
/* High 20 bits of PLT symbol offset relative to PC. */
HOWTO2 (R_NDS32_PLTREL_HI20, /* type */
12, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_PLTREL_HI20", /* name */
false, /* partial_inplace */
0x000fffff, /* src_mask */
0x000fffff, /* dst_mask */
false), /* pcrel_offset */
/* Low 12 bits of PLT symbol offset relative to PC. */
HOWTO2 (R_NDS32_PLTREL_LO12, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_PLTREL_LO12", /* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
false), /* pcrel_offset */
/* High 20 bits of PLT symbol offset relative to GOT (GP). */
HOWTO2 (R_NDS32_PLT_GOTREL_HI20, /* type */
12, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_PLT_GOTREL_HI20",/* name */
false, /* partial_inplace */
0x000fffff, /* src_mask */
0x000fffff, /* dst_mask */
false), /* pcrel_offset */
/* Low 12 bits of PLT symbol offset relative to GOT (GP). */
HOWTO2 (R_NDS32_PLT_GOTREL_LO12,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_PLT_GOTREL_LO12",/* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
false), /* pcrel_offset */
/* Small data area 12 bits offset. */
HOWTO2 (R_NDS32_SDA12S2_DP_RELA,/* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_SDA12S2_DP_RELA",/* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
false), /* pcrel_offset */
/* Small data area 12 bits offset. */
HOWTO2 (R_NDS32_SDA12S2_SP_RELA,/* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_SDA12S2_SP_RELA",/* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
false), /* pcrel_offset */
/* Lower 12 bits of address. */
HOWTO2 (R_NDS32_LO12S2_DP_RELA, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
10, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_LO12S2_DP_RELA",/* name */
false, /* partial_inplace */
0x000003ff, /* src_mask */
0x000003ff, /* dst_mask */
false), /* pcrel_offset */
/* Lower 12 bits of address. */
HOWTO2 (R_NDS32_LO12S2_SP_RELA,/* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
10, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_LO12S2_SP_RELA",/* name */
false, /* partial_inplace */
0x000003ff, /* src_mask */
0x000003ff, /* dst_mask */
false), /* pcrel_offset */
/* Lower 12 bits of address. Special identity for or case. */
HOWTO2 (R_NDS32_LO12S0_ORI_RELA,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_LO12S0_ORI_RELA",/* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
false), /* pcrel_offset */
/* Small data area 19 bits offset. */
HOWTO2 (R_NDS32_SDA16S3_RELA, /* type */
3, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_SDA16S3_RELA",/* name */
false, /* partial_inplace */
0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */
false), /* pcrel_offset */
/* Small data area 15 bits offset. */
HOWTO2 (R_NDS32_SDA17S2_RELA, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
17, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_SDA17S2_RELA",/* name */
false, /* partial_inplace */
0x0001ffff, /* src_mask */
0x0001ffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_SDA18S1_RELA, /* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
18, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_SDA18S1_RELA",/* name */
false, /* partial_inplace */
0x0003ffff, /* src_mask */
0x0003ffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_SDA19S0_RELA, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
19, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_SDA19S0_RELA",/* name */
false, /* partial_inplace */
0x0007ffff, /* src_mask */
0x0007ffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_DWARF2_OP1_RELA,/* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_DWARF2_OP1_RELA",/* name */
false, /* partial_inplace */
0xff, /* src_mask */
0xff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_DWARF2_OP2_RELA,/* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_DWARF2_OP2_RELA",/* name */
false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_DWARF2_LEB_RELA,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_DWARF2_LEB_RELA",/* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_UPDATE_TA_RELA,/* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_UPDATE_TA_RELA",/* name */
false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
false), /* pcrel_offset */
/* Like R_NDS32_PCREL, but referring to the procedure linkage table
entry for the symbol. */
HOWTO2 (R_NDS32_9_PLTREL, /* type */
1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_9_PLTREL", /* name */
false, /* partial_inplace */
0xff, /* src_mask */
0xff, /* dst_mask */
true), /* pcrel_offset */
/* Low 20 bits of PLT symbol offset relative to GOT (GP). */
HOWTO2 (R_NDS32_PLT_GOTREL_LO20,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_PLT_GOTREL_LO20",/* name */
false, /* partial_inplace */
0x000fffff, /* src_mask */
0x000fffff, /* dst_mask */
false), /* pcrel_offset */
/* low 15 bits of PLT symbol offset relative to GOT (GP) */
HOWTO2 (R_NDS32_PLT_GOTREL_LO15,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_PLT_GOTREL_LO15",/* name */
false, /* partial_inplace */
0x00007fff, /* src_mask */
0x00007fff, /* dst_mask */
false), /* pcrel_offset */
/* Low 19 bits of PLT symbol offset relative to GOT (GP). */
HOWTO2 (R_NDS32_PLT_GOTREL_LO19,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
19, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_PLT_GOTREL_LO19",/* name */
false, /* partial_inplace */
0x0007ffff, /* src_mask */
0x0007ffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_GOT_LO15, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOT_LO15", /* name */
false, /* partial_inplace */
0x00007fff, /* src_mask */
0x00007fff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_GOT_LO19, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
19, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOT_LO19", /* name */
false, /* partial_inplace */
0x0007ffff, /* src_mask */
0x0007ffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_GOTOFF_LO15, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOTOFF_LO15", /* name */
false, /* partial_inplace */
0x00007fff, /* src_mask */
0x00007fff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_GOTOFF_LO19, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
19, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOTOFF_LO19", /* name */
false, /* partial_inplace */
0x0007ffff, /* src_mask */
0x0007ffff, /* dst_mask */
false), /* pcrel_offset */
/* GOT 15 bits offset. */
HOWTO2 (R_NDS32_GOT15S2_RELA, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOT15S2_RELA",/* name */
false, /* partial_inplace */
0x00007fff, /* src_mask */
0x00007fff, /* dst_mask */
false), /* pcrel_offset */
/* GOT 17 bits offset. */
HOWTO2 (R_NDS32_GOT17S2_RELA, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
17, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_GOT17S2_RELA",/* name */
false, /* partial_inplace */
0x0001ffff, /* src_mask */
0x0001ffff, /* dst_mask */
false), /* pcrel_offset */
/* A 5 bit address. */
HOWTO2 (R_NDS32_5_RELA, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
5, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_5_RELA", /* name */
false, /* partial_inplace */
0x1f, /* src_mask */
0x1f, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_10_UPCREL_RELA,/* type */
1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
9, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_unsigned,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_10_UPCREL_RELA",/* name */
false, /* partial_inplace */
0x1ff, /* src_mask */
0x1ff, /* dst_mask */
true), /* pcrel_offset */
HOWTO2 (R_NDS32_SDA_FP7U2_RELA,/* type */
2, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
7, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_unsigned,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_SDA_FP7U2_RELA",/* name */
false, /* partial_inplace */
0x0000007f, /* src_mask */
0x0000007f, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_WORD_9_PCREL_RELA,/* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_WORD_9_PCREL_RELA",/* name */
false, /* partial_inplace */
0xff, /* src_mask */
0xff, /* dst_mask */
true), /* pcrel_offset */
HOWTO2 (R_NDS32_25_ABS_RELA, /* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
24, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_25_ABS_RELA", /* name */
false, /* partial_inplace */
0xffffff, /* src_mask */
0xffffff, /* dst_mask */
false), /* pcrel_offset */
/* A relative 17 bit relocation for ifc, right shifted by 1. */
HOWTO2 (R_NDS32_17IFC_PCREL_RELA,/* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_17IFC_PCREL_RELA",/* name */
false, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
true), /* pcrel_offset */
/* A relative unsigned 10 bit relocation for ifc, right shifted by 1. */
HOWTO2 (R_NDS32_10IFCU_PCREL_RELA,/* type */
1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
9, /* bitsize */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_unsigned,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_10IFCU_PCREL_RELA",/* name */
false, /* partial_inplace */
0x1ff, /* src_mask */
0x1ff, /* dst_mask */
true), /* pcrel_offset */
/* Like R_NDS32_HI20, but referring to the TLS LE entry for the symbol. */
HOWTO2 (R_NDS32_TLS_LE_HI20, /* type */
12, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_LE_HI20", /* name */
false, /* partial_inplace */
0x000fffff, /* src_mask */
0x000fffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_TLS_LE_LO12, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_LE_LO12", /* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
false), /* pcrel_offset */
/* Like R_NDS32_HI20, but referring to the TLS IE entry for the symbol. */
HOWTO2 (R_NDS32_TLS_IE_HI20, /* type */
12, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_IE_HI20", /* name */
false, /* partial_inplace */
0x000fffff, /* src_mask */
0x000fffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_TLS_IE_LO12S2,/* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
10, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_IE_LO12S2",/* name */
false, /* partial_inplace */
0x000003ff, /* src_mask */
0x000003ff, /* dst_mask */
false), /* pcrel_offset */
/* TLS LE TP offset relocation */
HOWTO2 (R_NDS32_TLS_TPOFF, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_TPOFF", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* A 20 bit address. */
HOWTO2 (R_NDS32_TLS_LE_20, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_LE_20", /* name */
false, /* partial_inplace */
0xfffff, /* src_mask */
0xfffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_TLS_LE_15S0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_LE_15S0", /* name */
false, /* partial_inplace */
0x7fff, /* src_mask */
0x7fff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_TLS_LE_15S1, /* type */
1, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_LE_15S1", /* name */
false, /* partial_inplace */
0x7fff, /* src_mask */
0x7fff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_TLS_LE_15S2, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_LE_15S2", /* name */
false, /* partial_inplace */
0x7fff, /* src_mask */
0x7fff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for unconditional call sequence */
HOWTO2 (R_NDS32_LONGCALL4, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LONGCALL4", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for conditional call sequence. */
HOWTO2 (R_NDS32_LONGCALL5, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LONGCALL5", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for conditional call sequence. */
HOWTO2 (R_NDS32_LONGCALL6, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LONGCALL6", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for unconditional branch sequence. */
HOWTO2 (R_NDS32_LONGJUMP4, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LONGJUMP4", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for conditional branch sequence. */
HOWTO2 (R_NDS32_LONGJUMP5, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LONGJUMP5", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for conditional branch sequence. */
HOWTO2 (R_NDS32_LONGJUMP6, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LONGJUMP6", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Relax hint for conditional branch sequence. */
HOWTO2 (R_NDS32_LONGJUMP7, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LONGJUMP7", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
EMPTY_HOWTO (114),
HOWTO2 (R_NDS32_TLS_IE_LO12, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_IE_LO12", /* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
false), /* pcrel_offset */
/* Like R_NDS32_HI20, but referring to the TLS IE (PIE)
entry for the symbol. */
HOWTO2 (R_NDS32_TLS_IEGP_HI20,/* type */
12, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_IEGP_HI20",/* name */
false, /* partial_inplace */
0x000fffff, /* src_mask */
0x000fffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_TLS_IEGP_LO12,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_IEGP_LO12",/* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
false), /* pcrel_offset */
HOWTO2 (R_NDS32_TLS_IEGP_LO12S2,/* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
10, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_IEGP_LO12S2",/* name */
false, /* partial_inplace */
0x000003ff, /* src_mask */
0x000003ff, /* dst_mask */
false), /* pcrel_offset */
/* TLS description relocation */
HOWTO2 (R_NDS32_TLS_DESC, /* type */
12, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_hi20_reloc, /* special_function */
"R_NDS32_TLS_DESC_HI20",/* name */
false, /* partial_inplace */
0x000fffff, /* src_mask */
0x000fffff, /* dst_mask */
false), /* pcrel_offset */
/* TLS GD/LD description offset high part. */
HOWTO2 (R_NDS32_TLS_DESC_HI20,/* type */
12, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_hi20_reloc, /* special_function */
"R_NDS32_TLS_DESC_HI20",/* name */
false, /* partial_inplace */
0x000fffff, /* src_mask */
0x000fffff, /* dst_mask */
false), /* pcrel_offset */
/* TLS GD/LD description offset low part. */
HOWTO2 (R_NDS32_TLS_DESC_LO12,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_lo12_reloc, /* special_function */
"R_NDS32_TLS_DESC_LO12",/* name */
false, /* partial_inplace */
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
false), /* pcrel_offset */
/* TLS GD/LD description offset set (movi). */
HOWTO2 (R_NDS32_TLS_DESC_20, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
20, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_DESC_20", /* name */
false, /* partial_inplace */
0x000fffff, /* src_mask */
0x000fffff, /* dst_mask */
false), /* pcrel_offset */
/* TLS GD/LD description offset set (lwi.gp). */
HOWTO2 (R_NDS32_TLS_DESC_SDA17S2,/* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
17, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_signed,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_NDS32_TLS_DESC_SDA17S2",/* name */
false, /* partial_inplace */
0x0001ffff, /* src_mask */
0x0001ffff, /* dst_mask */
false), /* pcrel_offset */
};
/* Relocations used for relaxation. */
#define HOWTO3(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
[C-R_NDS32_RELAX_ENTRY] = HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC)
static reloc_howto_type nds32_elf_relax_howto_table[] = {
HOWTO3 (R_NDS32_RELAX_ENTRY, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_RELAX_ENTRY", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_GOT_SUFF, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_GOT_SUFF", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_GOTOFF_SUFF, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_GOTOFF_SUFF", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_PLT_GOT_SUFF, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_PLT_GOT_SUFF",/* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_MULCALL_SUFF, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_MULCALL_SUFF",/* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_PTR, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_PTR", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_PTR_COUNT, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_PTR_COUNT", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_PTR_RESOLVED, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_PTR_RESOLVED",/* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_PLTBLOCK, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_PLTBLOCK", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_RELAX_REGION_BEGIN,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_RELAX_REGION_BEGIN",/* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_RELAX_REGION_END,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_RELAX_REGION_END",/* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_MINUEND, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_MINUEND", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_SUBTRAHEND, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_SUBTRAHEND", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_DIFF8, /* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_DIFF8", /* name */
false, /* partial_inplace */
0x000000ff, /* src_mask */
0x000000ff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_DIFF16, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_DIFF16", /* name */
false, /* partial_inplace */
0x0000ffff, /* src_mask */
0x0000ffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_DIFF32, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_DIFF32", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_DIFF_ULEB128, /* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
0, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_DIFF_ULEB128",/* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_DATA, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_DATA", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_TRAN, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_TRAN", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_TLS_LE_ADD, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_TLS_LE_ADD", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_TLS_LE_LS, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_TLS_LE_LS", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_EMPTY, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_EMPTY", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* TLS GD/LD description address base addition. */
HOWTO3 (R_NDS32_TLS_DESC_ADD, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_TLS_DESC_ADD",/* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* TLS GD/LD description function load. */
HOWTO3 (R_NDS32_TLS_DESC_FUNC,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_TLS_DESC_FUNC",/* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* TLS DESC resolve function call. */
HOWTO3 (R_NDS32_TLS_DESC_CALL,/* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_TLS_DESC_CALL",/* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* TLS DESC variable access. */
HOWTO3 (R_NDS32_TLS_DESC_MEM, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_TLS_DESC_MEM",/* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* TLS GD/LD description mark (@tlsdec). */
HOWTO3 (R_NDS32_RELAX_REMOVE, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_REMOVE", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* TLS GD/LD description mark (@tlsdec). */
HOWTO3 (R_NDS32_RELAX_GROUP, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_GROUP", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
HOWTO3 (R_NDS32_TLS_IEGP_LW, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_TLS_IEGP_LW", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* LA and FLSI relaxation. */
HOWTO3 (R_NDS32_LSI, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
nds32_elf_ignore_reloc,/* special_function */
"R_NDS32_LSI", /* name */
false, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
false),
};
static unsigned long dl_tlsdesc_lazy_trampoline[] =
{
0x46200000, /* sethi $r2,#0x0 */
0x58210000, /* ori $r2,$r2,#0x0 */
0x40217400, /* add $r2,$r2,$gp */
0x04210000, /* lwi $r2,[$r2+#0x0] */
0x46300000, /* sethi $r3,#0x0 */
0x58318000, /* ori $r3,$r3,#0x0 */
0x4031f400, /* add $r3,$r3,$gp */
0x4a000800, /* jr $r2 */
};
static void
nds32_put_trampoline (void *contents, const unsigned long *template,
unsigned count)
{
unsigned ix;
for (ix = 0; ix != count; ix++)
{
unsigned long insn = template[ix];
bfd_putb32 (insn, (char *) contents + ix * 4);
}
}
/* nds32_insertion_sort sorts an array with nmemb elements of size size.
This prototype is the same as qsort (). */
void
nds32_insertion_sort (void *base, size_t nmemb, size_t size,
int (*compar) (const void *lhs, const void *rhs))
{
char *ptr = (char *) base;
int i, j;
char tmp[sizeof (Elf_Internal_Rela)];
BFD_ASSERT (size <= sizeof (tmp));
/* If i is less than j, i is inserted before j.
|---- j ----- i --------------|
\ / \ /
sorted unsorted
*/
for (i = 1; i < (int) nmemb; i++)
{
for (j = (i - 1); j >= 0; j--)
if (compar (ptr + i * size, ptr + j * size) >= 0)
break;
j++;
if (i == j)
continue; /* i is in order. */
memcpy (tmp, ptr + i * size, size);
memmove (ptr + (j + 1) * size, ptr + j * size, (i - j) * size);
memcpy (ptr + j * size, tmp, size);
}
}
/* Sort relocation by r_offset.
We didn't use qsort () in stdlib, because quick-sort is not a stable sorting
algorithm. Relocations at the same r_offset must keep their order.
For example, RELAX_ENTRY must be the very first relocation entry.
Currently, this function implements insertion-sort.
FIXME: If we already sort them in assembler, why bother sort them
here again? */
static int
compar_reloc (const void *lhs, const void *rhs)
{
const Elf_Internal_Rela *l = (const Elf_Internal_Rela *) lhs;
const Elf_Internal_Rela *r = (const Elf_Internal_Rela *) rhs;
if (l->r_offset > r->r_offset)
return 1;
else if (l->r_offset == r->r_offset)
return 0;
else
return -1;
}
/* Functions listed below are only used for old relocs.
nds32_elf_9_pcrel_reloc
nds32_elf_do_9_pcrel_reloc
nds32_elf_hi20_reloc
nds32_elf_relocate_hi20
nds32_elf_lo12_reloc
nds32_elf_sda15_reloc
nds32_elf_generic_reloc. */
/* Handle the R_NDS32_9_PCREL & R_NDS32_9_PCREL_RELA reloc. */
static bfd_reloc_status_type
nds32_elf_9_pcrel_reloc (bfd * abfd,
arelent * reloc_entry,
asymbol * symbol,
void * data,
asection * input_section,
bfd * output_bfd,
char ** error_message ATTRIBUTE_UNUSED)
{
/* This part is from bfd_elf_generic_reloc. */
if (output_bfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0
&& (!reloc_entry->howto->partial_inplace || reloc_entry->addend == 0))
{
reloc_entry->address += input_section->output_offset;
return bfd_reloc_ok;
}
if (output_bfd != NULL)
{
/* FIXME: See bfd_perform_relocation. Is this right? */
return bfd_reloc_continue;
}
return nds32_elf_do_9_pcrel_reloc (abfd, reloc_entry->howto,
input_section,
data, reloc_entry->address,
symbol->section,
(symbol->value
+ symbol->section->output_section->vma
+ symbol->section->output_offset),
reloc_entry->addend);
}
/* Utility to actually perform an R_NDS32_9_PCREL reloc. */
#define N_ONES(n) (((((bfd_vma) 1 << ((n) - 1)) - 1) << 1) | 1)
static bfd_reloc_status_type
nds32_elf_do_9_pcrel_reloc (bfd * abfd,
reloc_howto_type * howto,
asection * input_section,
bfd_byte * data,
bfd_vma offset,
asection * symbol_section ATTRIBUTE_UNUSED,
bfd_vma symbol_value,
bfd_vma addend)
{
bfd_signed_vma relocation;
unsigned short x;
bfd_reloc_status_type status;
/* Sanity check the address (offset in section). */
if (offset > bfd_get_section_limit (abfd, input_section))
return bfd_reloc_outofrange;
relocation = symbol_value + addend;
/* Make it pc relative. */
relocation -= (input_section->output_section->vma
+ input_section->output_offset);
/* These jumps mask off the lower two bits of the current address
before doing pcrel calculations. */
relocation -= (offset & -(bfd_vma) 2);
if (relocation < -ACCURATE_8BIT_S1 || relocation >= ACCURATE_8BIT_S1)
status = bfd_reloc_overflow;
else
status = bfd_reloc_ok;
x = bfd_getb16 (data + offset);
relocation >>= howto->rightshift;
relocation <<= howto->bitpos;
x = (x & ~howto->dst_mask)
| (((x & howto->src_mask) + relocation) & howto->dst_mask);
bfd_putb16 ((bfd_vma) x, data + offset);
return status;
}
/* Handle the R_NDS32_HI20_[SU]LO relocs.
HI20_SLO is for the add3 and load/store with displacement instructions.
HI20 is for the or3 instruction.
For R_NDS32_HI20_SLO, the lower 16 bits are sign extended when added to
the high 16 bytes so if the lower 16 bits are negative (bit 15 == 1) then
we must add one to the high 16 bytes (which will get subtracted off when
the low 16 bits are added).
These relocs have to be done in combination with an R_NDS32_LO12 reloc
because there is a carry from the LO12 to the HI20. Here we just save
the information we need; we do the actual relocation when we see the LO12.
This code is copied from the elf32-mips.c. We also support an arbitrary
number of HI20 relocs to be associated with a single LO12 reloc. The
assembler sorts the relocs to ensure each HI20 immediately precedes its
LO12. However if there are multiple copies, the assembler may not find
the real LO12 so it picks the first one it finds. */
struct nds32_hi20
{
struct nds32_hi20 *next;
bfd_byte *addr;
bfd_vma addend;
};
static struct nds32_hi20 *nds32_hi20_list;
static bfd_reloc_status_type
nds32_elf_hi20_reloc (bfd *abfd ATTRIBUTE_UNUSED,
arelent *reloc_entry,
asymbol *symbol,
void *data,
asection *input_section,
bfd *output_bfd,
char **error_message ATTRIBUTE_UNUSED)
{
bfd_reloc_status_type ret;
bfd_vma relocation;
struct nds32_hi20 *n;
/* This part is from bfd_elf_generic_reloc.
If we're relocating, and this an external symbol, we don't want
to change anything. */
if (output_bfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0 && reloc_entry->addend == 0)
{
reloc_entry->address += input_section->output_offset;
return bfd_reloc_ok;
}
/* Sanity check the address (offset in section). */
if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
return bfd_reloc_outofrange;
ret = bfd_reloc_ok;
if (bfd_is_und_section (symbol->section) && output_bfd == (bfd *) NULL)
ret = bfd_reloc_undefined;
if (bfd_is_com_section (symbol->section))
relocation = 0;
else
relocation = symbol->value;
relocation += symbol->section->output_section->vma;
relocation += symbol->section->output_offset;
relocation += reloc_entry->addend;
/* Save the information, and let LO12 do the actual relocation. */
n = (struct nds32_hi20 *) bfd_malloc ((bfd_size_type) sizeof *n);
if (n == NULL)
return bfd_reloc_outofrange;
n->addr = (bfd_byte *) data + reloc_entry->address;
n->addend = relocation;
n->next = nds32_hi20_list;
nds32_hi20_list = n;
if (output_bfd != (bfd *) NULL)
reloc_entry->address += input_section->output_offset;
return ret;
}
/* Handle an NDS32 ELF HI20 reloc. */
static void
nds32_elf_relocate_hi20 (bfd *input_bfd ATTRIBUTE_UNUSED,
int type ATTRIBUTE_UNUSED,
Elf_Internal_Rela *relhi,
Elf_Internal_Rela *rello,
bfd_byte *contents,
bfd_vma addend)
{
unsigned long insn;
bfd_vma addlo;
insn = bfd_getb32 (contents + relhi->r_offset);
addlo = bfd_getb32 (contents + rello->r_offset);
addlo &= 0xfff;
addend += ((insn & 0xfffff) << 20) + addlo;
insn = (insn & 0xfff00000) | ((addend >> 12) & 0xfffff);
bfd_putb32 (insn, contents + relhi->r_offset);
}
/* Do an R_NDS32_LO12 relocation. This is a straightforward 12 bit
inplace relocation; this function exists in order to do the
R_NDS32_HI20_[SU]LO relocation described above. */
static bfd_reloc_status_type
nds32_elf_lo12_reloc (bfd *input_bfd, arelent *reloc_entry, asymbol *symbol,
void *data, asection *input_section, bfd *output_bfd,
char **error_message)
{
/* This part is from bfd_elf_generic_reloc.
If we're relocating, and this an external symbol, we don't want
to change anything. */
if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0
&& reloc_entry->addend == 0)
{
reloc_entry->address += input_section->output_offset;
return bfd_reloc_ok;
}
if (nds32_hi20_list != NULL)
{
struct nds32_hi20 *l;
l = nds32_hi20_list;
while (l != NULL)
{
unsigned long insn;
unsigned long val;
unsigned long vallo;
struct nds32_hi20 *next;
/* Do the HI20 relocation. Note that we actually don't need
to know anything about the LO12 itself, except where to
find the low 12 bits of the addend needed by the LO12. */
insn = bfd_getb32 (l->addr);
vallo = bfd_getb32 ((bfd_byte *) data + reloc_entry->address);
vallo &= 0xfff;
switch (reloc_entry->howto->type)
{
case R_NDS32_LO12S3:
vallo <<= 3;
break;
case R_NDS32_LO12S2:
vallo <<= 2;
break;
case R_NDS32_LO12S1:
vallo <<= 1;
break;
case R_NDS32_LO12S0:
vallo <<= 0;
break;
}
val = ((insn & 0xfffff) << 12) + vallo;
val += l->addend;
insn = (insn & ~(bfd_vma) 0xfffff) | ((val >> 12) & 0xfffff);
bfd_putb32 ((bfd_vma) insn, l->addr);
next = l->next;
free (l);
l = next;
}
nds32_hi20_list = NULL;
}
/* Now do the LO12 reloc in the usual way.
??? It would be nice to call bfd_elf_generic_reloc here,
but we have partial_inplace set. bfd_elf_generic_reloc will
pass the handling back to bfd_install_relocation which will install
a section relative addend which is wrong. */
return nds32_elf_generic_reloc (input_bfd, reloc_entry, symbol, data,
input_section, output_bfd, error_message);
}
/* Do generic partial_inplace relocation.
This is a local replacement for bfd_elf_generic_reloc. */
static bfd_reloc_status_type
nds32_elf_generic_reloc (bfd *input_bfd, arelent *reloc_entry,
asymbol *symbol, void *data, asection *input_section,
bfd *output_bfd, char **error_message ATTRIBUTE_UNUSED)
{
bfd_reloc_status_type ret;
bfd_vma relocation;
bfd_byte *inplace_address;
/* This part is from bfd_elf_generic_reloc.
If we're relocating, and this an external symbol, we don't want
to change anything. */
if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0
&& reloc_entry->addend == 0)
{
reloc_entry->address += input_section->output_offset;
return bfd_reloc_ok;
}
/* Now do the reloc in the usual way.
??? It would be nice to call bfd_elf_generic_reloc here,
but we have partial_inplace set. bfd_elf_generic_reloc will
pass the handling back to bfd_install_relocation which will install
a section relative addend which is wrong. */
/* Sanity check the address (offset in section). */
if (reloc_entry->address > bfd_get_section_limit (input_bfd, input_section))
return bfd_reloc_outofrange;
ret = bfd_reloc_ok;
if (bfd_is_und_section (symbol->section) && output_bfd == (bfd *) NULL)
ret = bfd_reloc_undefined;
if (bfd_is_com_section (symbol->section) || output_bfd != (bfd *) NULL)
relocation = 0;
else
relocation = symbol->value;
/* Only do this for a final link. */
if (output_bfd == (bfd *) NULL)
{
relocation += symbol->section->output_section->vma;
relocation += symbol->section->output_offset;
}
relocation += reloc_entry->addend;
switch (reloc_entry->howto->type)
{
case R_NDS32_LO12S3:
relocation >>= 3;
break;
case R_NDS32_LO12S2:
relocation >>= 2;
break;
case R_NDS32_LO12S1:
relocation >>= 1;
break;
case R_NDS32_LO12S0:
default:
relocation >>= 0;
break;
}
inplace_address = (bfd_byte *) data + reloc_entry->address;
#define DOIT(x) \
x = ((x & ~reloc_entry->howto->dst_mask) | \
(((x & reloc_entry->howto->src_mask) + relocation) & \
reloc_entry->howto->dst_mask))
switch (reloc_entry->howto->size)
{
case 1:
{
short x = bfd_getb16 (inplace_address);
DOIT (x);
bfd_putb16 ((bfd_vma) x, inplace_address);
}
break;
case 2:
{
unsigned long x = bfd_getb32 (inplace_address);
DOIT (x);
bfd_putb32 ((bfd_vma) x, inplace_address);
}
break;
default:
BFD_ASSERT (0);
}
if (output_bfd != (bfd *) NULL)
reloc_entry->address += input_section->output_offset;
return ret;
}
/* Handle the R_NDS32_SDA15 reloc.
This reloc is used to compute the address of objects in the small data area
and to perform loads and stores from that area.
The lower 15 bits are sign extended and added to the register specified
in the instruction, which is assumed to point to _SDA_BASE_.
Since the lower 15 bits offset is left-shifted 0, 1 or 2 bits depending on
the access size, this must be taken care of. */
static bfd_reloc_status_type
nds32_elf_sda15_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry,
asymbol *symbol, void *data ATTRIBUTE_UNUSED,
asection *input_section, bfd *output_bfd,
char **error_message ATTRIBUTE_UNUSED)
{
/* This part is from bfd_elf_generic_reloc. */
if (output_bfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0
&& (!reloc_entry->howto->partial_inplace || reloc_entry->addend == 0))
{
reloc_entry->address += input_section->output_offset;
return bfd_reloc_ok;
}
if (output_bfd != NULL)
{
/* FIXME: See bfd_perform_relocation. Is this right? */
return bfd_reloc_continue;
}
/* FIXME: not sure what to do here yet. But then again, the linker
may never call us. */
abort ();
}
/* nds32_elf_ignore_reloc is the special function for
relocation types which don't need to be relocated
like relaxation relocation types.
This function simply return bfd_reloc_ok when it is
invoked. */
static bfd_reloc_status_type
nds32_elf_ignore_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc_entry,
asymbol *symbol ATTRIBUTE_UNUSED,
void *data ATTRIBUTE_UNUSED, asection *input_section,
bfd *output_bfd, char **error_message ATTRIBUTE_UNUSED)
{
if (output_bfd != NULL)
reloc_entry->address += input_section->output_offset;
return bfd_reloc_ok;
}
/* Map BFD reloc types to NDS32 ELF reloc types. */
struct nds32_reloc_map_entry
{
bfd_reloc_code_real_type bfd_reloc_val;
unsigned char elf_reloc_val;
};
static const struct nds32_reloc_map_entry nds32_reloc_map[] =
{
{BFD_RELOC_NONE, R_NDS32_NONE},
{BFD_RELOC_16, R_NDS32_16_RELA},
{BFD_RELOC_32, R_NDS32_32_RELA},
{BFD_RELOC_VTABLE_INHERIT, R_NDS32_RELA_GNU_VTINHERIT},
{BFD_RELOC_VTABLE_ENTRY, R_NDS32_RELA_GNU_VTENTRY},
{BFD_RELOC_NDS32_20, R_NDS32_20_RELA},
{BFD_RELOC_NDS32_9_PCREL, R_NDS32_9_PCREL_RELA},
{BFD_RELOC_NDS32_WORD_9_PCREL, R_NDS32_WORD_9_PCREL_RELA},
{BFD_RELOC_NDS32_15_PCREL, R_NDS32_15_PCREL_RELA},
{BFD_RELOC_NDS32_17_PCREL, R_NDS32_17_PCREL_RELA},
{BFD_RELOC_NDS32_25_PCREL, R_NDS32_25_PCREL_RELA},
{BFD_RELOC_NDS32_HI20, R_NDS32_HI20_RELA},
{BFD_RELOC_NDS32_LO12S3, R_NDS32_LO12S3_RELA},
{BFD_RELOC_NDS32_LO12S2, R_NDS32_LO12S2_RELA},
{BFD_RELOC_NDS32_LO12S1, R_NDS32_LO12S1_RELA},
{BFD_RELOC_NDS32_LO12S0, R_NDS32_LO12S0_RELA},
{BFD_RELOC_NDS32_LO12S0_ORI, R_NDS32_LO12S0_ORI_RELA},
{BFD_RELOC_NDS32_SDA15S3, R_NDS32_SDA15S3_RELA},
{BFD_RELOC_NDS32_SDA15S2, R_NDS32_SDA15S2_RELA},
{BFD_RELOC_NDS32_SDA15S1, R_NDS32_SDA15S1_RELA},
{BFD_RELOC_NDS32_SDA15S0, R_NDS32_SDA15S0_RELA},
{BFD_RELOC_NDS32_SDA16S3, R_NDS32_SDA16S3_RELA},
{BFD_RELOC_NDS32_SDA17S2, R_NDS32_SDA17S2_RELA},
{BFD_RELOC_NDS32_SDA18S1, R_NDS32_SDA18S1_RELA},
{BFD_RELOC_NDS32_SDA19S0, R_NDS32_SDA19S0_RELA},
{BFD_RELOC_NDS32_GOT20, R_NDS32_GOT20},
{BFD_RELOC_NDS32_9_PLTREL, R_NDS32_9_PLTREL},
{BFD_RELOC_NDS32_25_PLTREL, R_NDS32_25_PLTREL},
{BFD_RELOC_NDS32_COPY, R_NDS32_COPY},
{BFD_RELOC_NDS32_GLOB_DAT, R_NDS32_GLOB_DAT},
{BFD_RELOC_NDS32_JMP_SLOT, R_NDS32_JMP_SLOT},
{BFD_RELOC_NDS32_RELATIVE, R_NDS32_RELATIVE},
{BFD_RELOC_NDS32_GOTOFF, R_NDS32_GOTOFF},
{BFD_RELOC_NDS32_GOTOFF_HI20, R_NDS32_GOTOFF_HI20},
{BFD_RELOC_NDS32_GOTOFF_LO12, R_NDS32_GOTOFF_LO12},
{BFD_RELOC_NDS32_GOTPC20, R_NDS32_GOTPC20},
{BFD_RELOC_NDS32_GOT_HI20, R_NDS32_GOT_HI20},
{BFD_RELOC_NDS32_GOT_LO12, R_NDS32_GOT_LO12},
{BFD_RELOC_NDS32_GOTPC_HI20, R_NDS32_GOTPC_HI20},
{BFD_RELOC_NDS32_GOTPC_LO12, R_NDS32_GOTPC_LO12},
{BFD_RELOC_NDS32_INSN16, R_NDS32_INSN16},
{BFD_RELOC_NDS32_LABEL, R_NDS32_LABEL},
{BFD_RELOC_NDS32_LONGCALL1, R_NDS32_LONGCALL1},
{BFD_RELOC_NDS32_LONGCALL2, R_NDS32_LONGCALL2},
{BFD_RELOC_NDS32_LONGCALL3, R_NDS32_LONGCALL3},
{BFD_RELOC_NDS32_LONGJUMP1, R_NDS32_LONGJUMP1},
{BFD_RELOC_NDS32_LONGJUMP2, R_NDS32_LONGJUMP2},
{BFD_RELOC_NDS32_LONGJUMP3, R_NDS32_LONGJUMP3},
{BFD_RELOC_NDS32_LOADSTORE, R_NDS32_LOADSTORE},
{BFD_RELOC_NDS32_9_FIXED, R_NDS32_9_FIXED_RELA},
{BFD_RELOC_NDS32_15_FIXED, R_NDS32_15_FIXED_RELA},
{BFD_RELOC_NDS32_17_FIXED, R_NDS32_17_FIXED_RELA},
{BFD_RELOC_NDS32_25_FIXED, R_NDS32_25_FIXED_RELA},
{BFD_RELOC_NDS32_LONGCALL4, R_NDS32_LONGCALL4},
{BFD_RELOC_NDS32_LONGCALL5, R_NDS32_LONGCALL5},
{BFD_RELOC_NDS32_LONGCALL6, R_NDS32_LONGCALL6},
{BFD_RELOC_NDS32_LONGJUMP4, R_NDS32_LONGJUMP4},
{BFD_RELOC_NDS32_LONGJUMP5, R_NDS32_LONGJUMP5},
{BFD_RELOC_NDS32_LONGJUMP6, R_NDS32_LONGJUMP6},
{BFD_RELOC_NDS32_LONGJUMP7, R_NDS32_LONGJUMP7},
{BFD_RELOC_NDS32_PLTREL_HI20, R_NDS32_PLTREL_HI20},
{BFD_RELOC_NDS32_PLTREL_LO12, R_NDS32_PLTREL_LO12},
{BFD_RELOC_NDS32_PLT_GOTREL_HI20, R_NDS32_PLT_GOTREL_HI20},
{BFD_RELOC_NDS32_PLT_GOTREL_LO12, R_NDS32_PLT_GOTREL_LO12},
{BFD_RELOC_NDS32_SDA12S2_DP, R_NDS32_SDA12S2_DP_RELA},
{BFD_RELOC_NDS32_SDA12S2_SP, R_NDS32_SDA12S2_SP_RELA},
{BFD_RELOC_NDS32_LO12S2_DP, R_NDS32_LO12S2_DP_RELA},
{BFD_RELOC_NDS32_LO12S2_SP, R_NDS32_LO12S2_SP_RELA},
{BFD_RELOC_NDS32_DWARF2_OP1, R_NDS32_DWARF2_OP1_RELA},
{BFD_RELOC_NDS32_DWARF2_OP2, R_NDS32_DWARF2_OP2_RELA},
{BFD_RELOC_NDS32_DWARF2_LEB, R_NDS32_DWARF2_LEB_RELA},
{BFD_RELOC_NDS32_UPDATE_TA, R_NDS32_UPDATE_TA_RELA},
{BFD_RELOC_NDS32_PLT_GOTREL_LO20, R_NDS32_PLT_GOTREL_LO20},
{BFD_RELOC_NDS32_PLT_GOTREL_LO15, R_NDS32_PLT_GOTREL_LO15},
{BFD_RELOC_NDS32_PLT_GOTREL_LO19, R_NDS32_PLT_GOTREL_LO19},
{BFD_RELOC_NDS32_GOT_LO15, R_NDS32_GOT_LO15},
{BFD_RELOC_NDS32_GOT_LO19, R_NDS32_GOT_LO19},
{BFD_RELOC_NDS32_GOTOFF_LO15, R_NDS32_GOTOFF_LO15},
{BFD_RELOC_NDS32_GOTOFF_LO19, R_NDS32_GOTOFF_LO19},
{BFD_RELOC_NDS32_GOT15S2, R_NDS32_GOT15S2_RELA},
{BFD_RELOC_NDS32_GOT17S2, R_NDS32_GOT17S2_RELA},
{BFD_RELOC_NDS32_5, R_NDS32_5_RELA},
{BFD_RELOC_NDS32_10_UPCREL, R_NDS32_10_UPCREL_RELA},
{BFD_RELOC_NDS32_SDA_FP7U2_RELA, R_NDS32_SDA_FP7U2_RELA},
{BFD_RELOC_NDS32_RELAX_ENTRY, R_NDS32_RELAX_ENTRY},
{BFD_RELOC_NDS32_GOT_SUFF, R_NDS32_GOT_SUFF},
{BFD_RELOC_NDS32_GOTOFF_SUFF, R_NDS32_GOTOFF_SUFF},
{BFD_RELOC_NDS32_PLT_GOT_SUFF, R_NDS32_PLT_GOT_SUFF},
{BFD_RELOC_NDS32_MULCALL_SUFF, R_NDS32_MULCALL_SUFF},
{BFD_RELOC_NDS32_PTR, R_NDS32_PTR},
{BFD_RELOC_NDS32_PTR_COUNT, R_NDS32_PTR_COUNT},
{BFD_RELOC_NDS32_PTR_RESOLVED, R_NDS32_PTR_RESOLVED},
{BFD_RELOC_NDS32_PLTBLOCK, R_NDS32_PLTBLOCK},
{BFD_RELOC_NDS32_RELAX_REGION_BEGIN, R_NDS32_RELAX_REGION_BEGIN},
{BFD_RELOC_NDS32_RELAX_REGION_END, R_NDS32_RELAX_REGION_END},
{BFD_RELOC_NDS32_MINUEND, R_NDS32_MINUEND},
{BFD_RELOC_NDS32_SUBTRAHEND, R_NDS32_SUBTRAHEND},
{BFD_RELOC_NDS32_DIFF8, R_NDS32_DIFF8},
{BFD_RELOC_NDS32_DIFF16, R_NDS32_DIFF16},
{BFD_RELOC_NDS32_DIFF32, R_NDS32_DIFF32},
{BFD_RELOC_NDS32_DIFF_ULEB128, R_NDS32_DIFF_ULEB128},
{BFD_RELOC_NDS32_EMPTY, R_NDS32_EMPTY},
{BFD_RELOC_NDS32_25_ABS, R_NDS32_25_ABS_RELA},
{BFD_RELOC_NDS32_DATA, R_NDS32_DATA},
{BFD_RELOC_NDS32_TRAN, R_NDS32_TRAN},
{BFD_RELOC_NDS32_17IFC_PCREL, R_NDS32_17IFC_PCREL_RELA},
{BFD_RELOC_NDS32_10IFCU_PCREL, R_NDS32_10IFCU_PCREL_RELA},
/* Not sure. */
{BFD_RELOC_NDS32_TPOFF, R_NDS32_TLS_TPOFF},
/* Missing: BFD_RELOC_NDS32_GOTTPOFF. */
{BFD_RELOC_NDS32_TLS_LE_HI20, R_NDS32_TLS_LE_HI20},
{BFD_RELOC_NDS32_TLS_LE_LO12, R_NDS32_TLS_LE_LO12},
{BFD_RELOC_NDS32_TLS_LE_20, R_NDS32_TLS_LE_20},
{BFD_RELOC_NDS32_TLS_LE_15S0, R_NDS32_TLS_LE_15S0},
{BFD_RELOC_NDS32_TLS_LE_15S1, R_NDS32_TLS_LE_15S1},
{BFD_RELOC_NDS32_TLS_LE_15S2, R_NDS32_TLS_LE_15S2},
{BFD_RELOC_NDS32_TLS_LE_ADD, R_NDS32_TLS_LE_ADD},
{BFD_RELOC_NDS32_TLS_LE_LS, R_NDS32_TLS_LE_LS},
{BFD_RELOC_NDS32_TLS_IE_HI20, R_NDS32_TLS_IE_HI20<