From 36591ba149edf6c6608d931a6d53bb99849fdc99 Mon Sep 17 00:00:00 2001 From: Sandra Loosemore Date: Wed, 6 Feb 2013 23:22:26 +0000 Subject: 2013-02-06 Sandra Loosemore Andrew Jenner Based on patches from Altera Corporation. bfd/ * Makefile.am (ALL_MACHINES): Add cpu-nios2.lo. (ALL_MACHINES_CFILES): Add cpu-nios2.c. (BFD_BACKENDS): Add elf32-nios2.lo. (BFD32_BACKENDS_CFILES): Add elf32-nios2.c. * Makefile.in: Regenerated. * configure.in: Add entries for bfd_elf32_bignios2_vec and bfd_elf32_littlenios2_vec. * configure: Regenerated. * config.bfd: Add cases for nios2. * archures.c (enum bfd_architecture): Add bfd_arch_nios2. (bfd_mach_nios2): Define. (bfd_nios2_arch): Declare. (bfd_archures_list): Add bfd_nios2_arch. * targets.c (bfd_elf32_bignios2_vec): Declare. (bfd_elf32_littlenios2_vec): Declare. (_bfd_target_vector): Add entries for bfd_elf32_bignios2_vec and bfd_elf32_littlenios2_vec. * elf-bfd.h (enum elf_target_id): Add NIOS2_ELF_DATA. * reloc.c (enum bfd_reloc_code_real): Add Nios II relocations. * bfd-in2.h: Regenerated. * libbfd.h: Regenerated. * cpu-nios2.c: New file. * elf32-nios2.c: New file. opcodes/ * Makefile.am (TARGET_LIBOPCODES_CFILES): Add nios2-dis.c and nios2-opc.c. * Makefile.in: Regenerated. * configure.in: Add case for bfd_nios2_arch. * configure: Regenerated. * disassemble.c (ARCH_nios2): Define. (disassembler): Add case for bfd_arch_nios2. * nios2-dis.c: New file. * nios2-opc.c: New file. include/ * dis-asm.h (print_insn_big_nios2): Declare. (print_insn_little_nios2): Declare. include/elf * nios2.h: New file. include/opcode/ * nios2.h: New file. gas/ * Makefile.am (TARGET_CPU_CFILES): Add config/tc-nios2.c. (TARGET_CPU_HFILES): Add config/tc-nios2.h. * Makefile.in: Regenerated. * configure.tgt: Add case for nios2*-linux*. * config/obj-elf.c: Conditionally include elf/nios2.h. * config/tc-nios2.c: New file. * config/tc-nios2.h: New file. * doc/Makefile.am (CPU_DOCS): Add c-nios2.texi. * doc/Makefile.in: Regenerated. * doc/all.texi: Set NIOSII. * doc/as.texinfo (Overview): Add Nios II options. (Machine Dependencies): Include c-nios2.texi. * doc/c-nios2.texi: New file. * NEWS: Note Altera Nios II support. gas/testsuite/ * gas/nios2/add.d: New. * gas/nios2/add.s: New. * gas/nios2/align_fill.d: New. * gas/nios2/align_fill.s: New. * gas/nios2/align_text.d: New. * gas/nios2/align_text.s: New. * gas/nios2/and.d: New. * gas/nios2/and.s: New. * gas/nios2/branch.d: New. * gas/nios2/branch.s: New. * gas/nios2/break.d: New. * gas/nios2/break.s: New. * gas/nios2/bret.d: New. * gas/nios2/bret.s: New. * gas/nios2/cache.d: New. * gas/nios2/cache.s: New. * gas/nios2/call26.d: New. * gas/nios2/call26.s: New. * gas/nios2/call.d: New. * gas/nios2/call.s: New. * gas/nios2/cmp.d: New. * gas/nios2/cmp.s: New. * gas/nios2/comments.d: New. * gas/nios2/comments.s: New. * gas/nios2/complex.d: New. * gas/nios2/complex.s: New. * gas/nios2/ctl.d: New. * gas/nios2/ctl.s: New. * gas/nios2/custom.d: New. * gas/nios2/custom.s: New. * gas/nios2/etbt.d: New. * gas/nios2/etbt.s: New. * gas/nios2/flushda.d: New. * gas/nios2/flushda.s: New. * gas/nios2/illegal.l: New. * gas/nios2/illegal.s: New. * gas/nios2/jmp.d: New. * gas/nios2/jmp.s: New. * gas/nios2/ldb.d: New. * gas/nios2/ldb.s: New. * gas/nios2/ldh.d: New. * gas/nios2/ldh.s: New. * gas/nios2/ldw.d: New. * gas/nios2/ldw.s: New. * gas/nios2/lineseparator.d: New. * gas/nios2/lineseparator.s: New. * gas/nios2/mov.d: New. * gas/nios2/movia.d: New. * gas/nios2/movia.s: New. * gas/nios2/movi.d: New. * gas/nios2/movi.s: New. * gas/nios2/mov.s: New. * gas/nios2/mul.d: New. * gas/nios2/mul.s: New. * gas/nios2/nios2.exp: New. * gas/nios2/nor.d: New. * gas/nios2/nor.s: New. * gas/nios2/or.d: New. * gas/nios2/or.s: New. * gas/nios2/ret.d: New. * gas/nios2/ret.s: New. * gas/nios2/rol.d: New. * gas/nios2/rol.s: New. * gas/nios2/rotate.d: New. * gas/nios2/rotate.s: New. * gas/nios2/stb.d: New. * gas/nios2/stb.s: New. * gas/nios2/sth.d: New. * gas/nios2/sth.s: New. * gas/nios2/stw.d: New. * gas/nios2/stw.s: New. * gas/nios2/sub.d: New. * gas/nios2/sub.s: New. * gas/nios2/sync.d: New. * gas/nios2/sync.s: New. * gas/nios2/trap.d: New. * gas/nios2/trap.s: New. * gas/nios2/tret.d: New. * gas/nios2/tret.s: New. * gas/nios2/warn_noat.l: New. * gas/nios2/warn_noat.s: New. * gas/nios2/warn_nobreak.l: New. * gas/nios2/warn_nobreak.s: New. * gas/nios2/xor.d: New. * gas/nios2/xor.s: New. ld/ * Makefile.am (enios2elf.c): New rule. * Makefile.in: Regenerated. * configure.tgt: Add case for nios2*-*-*. * emulparams/nios2elf.sh: New file. * NEWS: Note Altera Nios II support. ld/testsuite/ * ld-nios2/emit-relocs-1a.s: New. * ld-nios2/emit-relocs-1b.s: New. * ld-nios2/emit-relocs-1.d: New. * ld-nios2/emit-relocs-1.ld: New. * ld-nios2/gprel.d: New. * ld-nios2/gprel.s: New. * ld-nios2/hilo16.d: New. * ld-nios2/hilo16.s: New. * ld-nios2/hilo16_symbol.s: New. * ld-nios2/imm5.d: New. * ld-nios2/imm5.s: New. * ld-nios2/imm5_symbol.s: New. * ld-nios2/nios2.exp: New. * ld-nios2/pcrel16.d: New. * ld-nios2/pcrel16_label.s: New. * ld-nios2/pcrel16.s: New. * ld-nios2/relax_callr.d: New. * ld-nios2/relax_callr.ld: New. * ld-nios2/relax_callr.s: New. * ld-nios2/relax_cjmp.d: New. * ld-nios2/relax_cjmp.s: New. * ld-nios2/relax_jmp.ld: New. * ld-nios2/relax_section.d: New. * ld-nios2/relax_section.s: New. * ld-nios2/relax_ujmp.d: New. * ld-nios2/relax_ujmp.s: New. * ld-nios2/reloc.d: New. * ld-nios2/reloc.s: New. * ld-nios2/reloc_symbol.s: New. * ld-nios2/s16.d: New. * ld-nios2/s16.s: New. * ld-nios2/s16_symbol.s: New. * ld-nios2/u16.d: New. * ld-nios2/u16.s: New. * ld-nios2/u16_symbol.s: New. * ld-elf/indirect.exp: Skip on targets that don't support -shared -fPIC. * ld-elfcomm/elfcomm.exp: Build with -G0 for nios2. * ld-plugin/lto.exp: Skip shared library tests on targets that don't support them. Skip execution tests on non-native targets. binutils/ * readelf.c: Include elf/nios2.h. (dump_relocations): Add case for EM_ALTERA_NIOS2. (get_nios2_dynamic_type): New. (get_dynamic_type): Add case for EM_ALTERA_NIOS2. (is_32bit_abs_reloc): Fix EM_ALTERA_NIOS2 case. (is_16bit_abs_reloc): Likewise. (is_none_reloc): Add EM_ALTERA_NIOS2 and EM_NIOS32 cases. * NEWS: Note Altera Nios II support. * MAINTAINERS: Add Nios II maintainers. --- include/elf/ChangeLog | 7 ++++ include/elf/nios2.h | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 include/elf/nios2.h (limited to 'include/elf') diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index 82e884e..7807767 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,3 +1,10 @@ +2013-02-06 Sandra Loosemore + Andrew Jenner + + Based on patches from Altera Corporation. + + * nios2.h: New file. + 2013-01-24 Nick Clifton * v850.h: Add support for e3v5 architecture. diff --git a/include/elf/nios2.h b/include/elf/nios2.h new file mode 100644 index 0000000..ff5947b --- /dev/null +++ b/include/elf/nios2.h @@ -0,0 +1,91 @@ +/* Altera Nios II ELF support for BFD. + Copyright (C) 2012, 2013 Free Software Foundation, Inc. + Contributed by Nigel Gray (ngray@altera.com). + Contributed by Mentor Graphics, Inc. + + 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. */ + + +/* This file holds definitions specific to the Altera Nios II ELF ABI. Note + that most of this is not actually implemented by BFD. */ + +#ifndef _ELF_NIOS2_H +#define _ELF_NIOS2_H + +#include "elf/reloc-macros.h" + +/* The order of these numbers must match the order in + the elf_nios2_howto_table_rel table for the lookup + function to work properly. */ + +START_RELOC_NUMBERS (elf_nios2_reloc_type) + RELOC_NUMBER (R_NIOS2_NONE, 0) + RELOC_NUMBER (R_NIOS2_S16, 1) + RELOC_NUMBER (R_NIOS2_U16, 2) + RELOC_NUMBER (R_NIOS2_PCREL16, 3) + RELOC_NUMBER (R_NIOS2_CALL26, 4) + RELOC_NUMBER (R_NIOS2_IMM5, 5) + RELOC_NUMBER (R_NIOS2_CACHE_OPX, 6) + RELOC_NUMBER (R_NIOS2_IMM6, 7) + RELOC_NUMBER (R_NIOS2_IMM8, 8) + RELOC_NUMBER (R_NIOS2_HI16, 9) + RELOC_NUMBER (R_NIOS2_LO16, 10) + RELOC_NUMBER (R_NIOS2_HIADJ16, 11) + RELOC_NUMBER (R_NIOS2_BFD_RELOC_32, 12) + RELOC_NUMBER (R_NIOS2_BFD_RELOC_16, 13) + RELOC_NUMBER (R_NIOS2_BFD_RELOC_8, 14) + RELOC_NUMBER (R_NIOS2_GPREL, 15) + RELOC_NUMBER (R_NIOS2_GNU_VTINHERIT, 16) + RELOC_NUMBER (R_NIOS2_GNU_VTENTRY, 17) + RELOC_NUMBER (R_NIOS2_UJMP, 18) + RELOC_NUMBER (R_NIOS2_CJMP, 19) + RELOC_NUMBER (R_NIOS2_CALLR, 20) + RELOC_NUMBER (R_NIOS2_ALIGN, 21) + RELOC_NUMBER (R_NIOS2_GOT16, 22) + RELOC_NUMBER (R_NIOS2_CALL16, 23) + RELOC_NUMBER (R_NIOS2_GOTOFF_LO, 24) + RELOC_NUMBER (R_NIOS2_GOTOFF_HA, 25) + RELOC_NUMBER (R_NIOS2_PCREL_LO, 26) + RELOC_NUMBER (R_NIOS2_PCREL_HA, 27) + RELOC_NUMBER (R_NIOS2_TLS_GD16, 28) + RELOC_NUMBER (R_NIOS2_TLS_LDM16, 29) + RELOC_NUMBER (R_NIOS2_TLS_LDO16, 30) + RELOC_NUMBER (R_NIOS2_TLS_IE16, 31) + RELOC_NUMBER (R_NIOS2_TLS_LE16, 32) + RELOC_NUMBER (R_NIOS2_TLS_DTPMOD, 33) + RELOC_NUMBER (R_NIOS2_TLS_DTPREL, 34) + RELOC_NUMBER (R_NIOS2_TLS_TPREL, 35) + RELOC_NUMBER (R_NIOS2_COPY, 36) + RELOC_NUMBER (R_NIOS2_GLOB_DAT, 37) + RELOC_NUMBER (R_NIOS2_JUMP_SLOT, 38) + RELOC_NUMBER (R_NIOS2_RELATIVE, 39) + RELOC_NUMBER (R_NIOS2_GOTOFF, 40) + RELOC_NUMBER (R_NIOS2_ILLEGAL, 41) +END_RELOC_NUMBERS (R_NIOS2_maxext) + +/* Processor-specific section flags. */ + +/* This is used to mark gp-relative sections. */ +#define SHF_NIOS2_GPREL 0x10000000 + +/* Processor-specific dynamic array tags. */ + +/* Address of _gp. */ +#define DT_NIOS2_GP 0x70000002 + +#endif /* _ELF_NIOS2_H */ -- cgit v1.1