Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl3/binutils/dist Update our in-tree binutils for ...
details: https://anonhg.NetBSD.org/src/rev/125939643e05
branches: trunk
changeset: 336913:125939643e05
user: matt <matt%NetBSD.org@localhost>
date: Fri Mar 27 06:34:31 2015 +0000
description:
Update our in-tree binutils for RISCV to the latest.
diffstat:
external/gpl3/binutils/dist/bfd/Makefile.am | 12 +
external/gpl3/binutils/dist/bfd/Makefile.in | 12 +
external/gpl3/binutils/dist/bfd/bfd-in2.h | 44 +-
external/gpl3/binutils/dist/bfd/elf-bfd.h | 2 +-
external/gpl3/binutils/dist/bfd/elf32-riscv.c | 193 -
external/gpl3/binutils/dist/bfd/elf64-riscv.c | 218 -
external/gpl3/binutils/dist/bfd/elfnn-riscv.c | 2956 +++++
external/gpl3/binutils/dist/bfd/elfxx-riscv.c | 5462 +---------
external/gpl3/binutils/dist/bfd/elfxx-riscv.h | 89 +-
external/gpl3/binutils/dist/bfd/targets.c | 3 -
external/gpl3/binutils/dist/binutils/readelf.c | 16 +-
external/gpl3/binutils/dist/gas/config/tc-riscv.c | 2569 +---
external/gpl3/binutils/dist/gas/config/tc-riscv.h | 39 +-
external/gpl3/binutils/dist/include/elf/riscv.h | 122 +-
external/gpl3/binutils/dist/include/opcode/riscv-opc.h | 166 +-
external/gpl3/binutils/dist/include/opcode/riscv.h | 41 +-
external/gpl3/binutils/dist/ld/emulparams/elf32lriscv-defs.sh | 26 +-
external/gpl3/binutils/dist/ld/emulparams/elf32lriscv.sh | 7 -
external/gpl3/binutils/dist/ld/emulparams/elf64lriscv-defs.sh | 1 -
external/gpl3/binutils/dist/ld/emulparams/elf64lriscv.sh | 6 -
external/gpl3/binutils/dist/ld/emultempl/riscvelf.em | 55 +-
external/gpl3/binutils/dist/opcodes/riscv-dis.c | 363 +-
external/gpl3/binutils/dist/opcodes/riscv-opc.c | 69 +-
23 files changed, 4477 insertions(+), 7994 deletions(-)
diffs (truncated from 13838 to 300 lines):
diff -r 50734aaba7a8 -r 125939643e05 external/gpl3/binutils/dist/bfd/Makefile.am
--- a/external/gpl3/binutils/dist/bfd/Makefile.am Fri Mar 27 06:10:25 2015 +0000
+++ b/external/gpl3/binutils/dist/bfd/Makefile.am Fri Mar 27 06:34:31 2015 +0000
@@ -897,6 +897,18 @@
sed -e s/NN/64/g < $(srcdir)/elfnn-ia64.c > elf64-ia64.new
mv -f elf64-ia64.new elf64-ia64.c
+elf32-riscv.c : elfnn-riscv.c
+ rm -f elf32-riscv.c
+ echo "#line 1 \"$(srcdir)/elfnn-riscv.c\"" > elf32-riscv.new
+ sed -e s/NN/32/g < $(srcdir)/elfnn-riscv.c >> elf32-riscv.new
+ mv -f elf32-riscv.new elf32-riscv.c
+
+elf64-riscv.c : elfnn-riscv.c
+ rm -f elf64-riscv.c
+ echo "#line 1 \"$(srcdir)/elfnn-riscv.c\"" > elf64-riscv.new
+ sed -e s/NN/64/g < $(srcdir)/elfnn-riscv.c >> elf64-riscv.new
+ mv -f elf64-riscv.new elf64-riscv.c
+
peigen.c : peXXigen.c
rm -f peigen.c
sed -e s/XX/pe/g < $(srcdir)/peXXigen.c > peigen.new
diff -r 50734aaba7a8 -r 125939643e05 external/gpl3/binutils/dist/bfd/Makefile.in
--- a/external/gpl3/binutils/dist/bfd/Makefile.in Fri Mar 27 06:10:25 2015 +0000
+++ b/external/gpl3/binutils/dist/bfd/Makefile.in Fri Mar 27 06:34:31 2015 +0000
@@ -1967,6 +1967,18 @@
sed -e s/NN/64/g < $(srcdir)/elfnn-ia64.c > elf64-ia64.new
mv -f elf64-ia64.new elf64-ia64.c
+elf32-riscv.c : elfnn-riscv.c
+ rm -f elf32-riscv.c
+ echo "#line 1 \"$(srcdir)/elfnn-riscv.c\"" > elf32-riscv.new
+ sed -e s/NN/32/g < $(srcdir)/elfnn-riscv.c >> elf32-riscv.new
+ mv -f elf32-riscv.new elf32-riscv.c
+
+elf64-riscv.c : elfnn-riscv.c
+ rm -f elf64-riscv.c
+ echo "#line 1 \"$(srcdir)/elfnn-riscv.c\"" > elf64-riscv.new
+ sed -e s/NN/64/g < $(srcdir)/elfnn-riscv.c >> elf64-riscv.new
+ mv -f elf64-riscv.new elf64-riscv.c
+
peigen.c : peXXigen.c
rm -f peigen.c
sed -e s/XX/pe/g < $(srcdir)/peXXigen.c > peigen.new
diff -r 50734aaba7a8 -r 125939643e05 external/gpl3/binutils/dist/bfd/bfd-in2.h
--- a/external/gpl3/binutils/dist/bfd/bfd-in2.h Fri Mar 27 06:10:25 2015 +0000
+++ b/external/gpl3/binutils/dist/bfd/bfd-in2.h Fri Mar 27 06:34:31 2015 +0000
@@ -4835,41 +4835,39 @@
BFD_RELOC_OR1K_TLS_DTPMOD,
/* RISC-V relocations. */
- BFD_RELOC_RISCV_ADD32,
- BFD_RELOC_RISCV_ADD64,
- BFD_RELOC_RISCV_SUB32,
- BFD_RELOC_RISCV_SUB64,
BFD_RELOC_RISCV_HI20,
+ BFD_RELOC_RISCV_PCREL_HI20,
+ BFD_RELOC_RISCV_PCREL_LO12_I,
+ BFD_RELOC_RISCV_PCREL_LO12_S,
BFD_RELOC_RISCV_LO12_I,
BFD_RELOC_RISCV_LO12_S,
- BFD_RELOC_RISCV_PCREL_LO12_I,
- BFD_RELOC_RISCV_PCREL_LO12_S,
+ BFD_RELOC_RISCV_GPREL12_I,
+ BFD_RELOC_RISCV_GPREL12_S,
+ BFD_RELOC_RISCV_TPREL_HI20,
+ BFD_RELOC_RISCV_TPREL_LO12_I,
+ BFD_RELOC_RISCV_TPREL_LO12_S,
+ BFD_RELOC_RISCV_TPREL_ADD,
BFD_RELOC_RISCV_CALL,
BFD_RELOC_RISCV_CALL_PLT,
- BFD_RELOC_RISCV_PCREL_HI20,
+ BFD_RELOC_RISCV_ADD8,
+ BFD_RELOC_RISCV_ADD16,
+ BFD_RELOC_RISCV_ADD32,
+ BFD_RELOC_RISCV_ADD64,
+ BFD_RELOC_RISCV_SUB8,
+ BFD_RELOC_RISCV_SUB16,
+ BFD_RELOC_RISCV_SUB32,
+ BFD_RELOC_RISCV_SUB64,
+ BFD_RELOC_RISCV_GOT_HI20,
+ BFD_RELOC_RISCV_TLS_GOT_HI20,
+ BFD_RELOC_RISCV_TLS_GD_HI20,
BFD_RELOC_RISCV_JMP,
- BFD_RELOC_RISCV_GOT_HI20,
- BFD_RELOC_RISCV_GOT_LO12,
BFD_RELOC_RISCV_TLS_DTPMOD32,
BFD_RELOC_RISCV_TLS_DTPREL32,
BFD_RELOC_RISCV_TLS_DTPMOD64,
BFD_RELOC_RISCV_TLS_DTPREL64,
BFD_RELOC_RISCV_TLS_TPREL32,
BFD_RELOC_RISCV_TLS_TPREL64,
- BFD_RELOC_RISCV_TPREL_HI20,
- BFD_RELOC_RISCV_TPREL_ADD,
- BFD_RELOC_RISCV_TPREL_LO12_S,
- BFD_RELOC_RISCV_TPREL_LO12_I,
- BFD_RELOC_RISCV_TLS_IE_HI20,
- BFD_RELOC_RISCV_TLS_IE_LO12,
- BFD_RELOC_RISCV_TLS_IE_ADD,
- BFD_RELOC_RISCV_TLS_IE_LO12_S,
- BFD_RELOC_RISCV_TLS_IE_LO12_I,
- BFD_RELOC_RISCV_TLS_GOT_HI20,
- BFD_RELOC_RISCV_TLS_GOT_LO12,
- BFD_RELOC_RISCV_TLS_GD_HI20,
- BFD_RELOC_RISCV_TLS_GD_LO12,
- BFD_RELOC_RISCV_TLS_PCREL_LO12,
+ BFD_RELOC_RISCV_ALIGN,
/* H8 elf Relocations. */
BFD_RELOC_H8_DIR16A8,
diff -r 50734aaba7a8 -r 125939643e05 external/gpl3/binutils/dist/bfd/elf-bfd.h
--- a/external/gpl3/binutils/dist/bfd/elf-bfd.h Fri Mar 27 06:10:25 2015 +0000
+++ b/external/gpl3/binutils/dist/bfd/elf-bfd.h Fri Mar 27 06:34:31 2015 +0000
@@ -423,7 +423,6 @@
OR1K_ELF_DATA,
PPC32_ELF_DATA,
PPC64_ELF_DATA,
- RISCV_ELF_DATA,
S390_ELF_DATA,
SH_ELF_DATA,
SPARC_ELF_DATA,
@@ -434,6 +433,7 @@
XGATE_ELF_DATA,
TILEGX_ELF_DATA,
TILEPRO_ELF_DATA,
+ RISCV_ELF_DATA,
GENERIC_ELF_DATA
};
diff -r 50734aaba7a8 -r 125939643e05 external/gpl3/binutils/dist/bfd/elf32-riscv.c
--- a/external/gpl3/binutils/dist/bfd/elf32-riscv.c Fri Mar 27 06:10:25 2015 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,193 +0,0 @@
-/* RISC-V-specific support for 32-bit ELF
- Copyright 2011-2014 Free Software Foundation, Inc.
-
- Contributed by Andrew Waterman (waterman%cs.berkeley.edu@localhost) at UC Berkeley.
- Based on MIPS target.
-
- 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 handles RISC-V ELF targets. */
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "libbfd.h"
-#include "bfdlink.h"
-#include "genlink.h"
-#include "elf-bfd.h"
-#include "elfxx-riscv.h"
-#include "elf/riscv.h"
-#include "opcode/riscv.h"
-
-#include "opcode/riscv.h"
-
-static bfd_boolean riscv_elf32_object_p
- (bfd *);
-static bfd_boolean elf32_riscv_grok_prstatus
- (bfd *, Elf_Internal_Note *);
-static bfd_boolean elf32_riscv_grok_psinfo
- (bfd *, Elf_Internal_Note *);
-
-/* The number of local .got entries we reserve. */
-#define RISCV_RESERVED_GOTNO (2)
-
-/* Set the right machine number for a RISC-V ELF file. */
-
-static bfd_boolean
-riscv_elf32_object_p (bfd *abfd)
-{
- bfd_default_set_arch_mach (abfd, bfd_arch_riscv, bfd_mach_riscv32);
- return TRUE;
-}
-
-/* Support for core dump NOTE sections. */
-static bfd_boolean
-elf32_riscv_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
-{
- int offset;
- unsigned int size;
-
- switch (note->descsz)
- {
- default:
- return FALSE;
-
- case 440: /* Linux/RISC-V */
- /* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
-
- /* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
-
- /* pr_reg */
- offset = 72;
- size = 360;
-
- break;
- }
-
- /* Make a ".reg/999" section. */
- return _bfd_elfcore_make_pseudosection (abfd, ".reg", size,
- note->descpos + offset);
-}
-
-static bfd_boolean
-elf32_riscv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
-{
- switch (note->descsz)
- {
- default:
- return FALSE;
-
- case 128: /* Linux/RISC-V elf_prpsinfo */
- elf_tdata (abfd)->core_program
- = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
- elf_tdata (abfd)->core_command
- = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80);
- }
-
- /* Note that for some reason, a spurious space is tacked
- onto the end of the args in some (at least one anyway)
- implementations, so strip it off if it exists. */
-
- {
- char *command = elf_tdata (abfd)->core_command;
- int n = strlen (command);
-
- if (0 < n && command[n - 1] == ' ')
- command[n - 1] = '\0';
- }
-
- return TRUE;
-}
-
-#define ELF_ARCH bfd_arch_riscv
-#define ELF_TARGET_ID RISCV_ELF_DATA
-#define ELF_MACHINE_CODE EM_RISCV
-
-#define elf_backend_collect TRUE
-#define elf_backend_type_change_ok TRUE
-#define elf_backend_can_gc_sections TRUE
-#define elf_info_to_howto riscv_elf_info_to_howto_rela
-#define elf_backend_object_p riscv_elf32_object_p
-#define elf_backend_symbol_processing _bfd_riscv_elf_symbol_processing
-#define elf_backend_create_dynamic_sections \
- _bfd_riscv_elf_create_dynamic_sections
-#define elf_backend_check_relocs _bfd_riscv_elf_check_relocs
-#define elf_backend_merge_symbol_attribute \
- _bfd_riscv_elf_merge_symbol_attribute
-#define elf_backend_get_target_dtag _bfd_riscv_elf_get_target_dtag
-#define elf_backend_adjust_dynamic_symbol \
- _bfd_riscv_elf_adjust_dynamic_symbol
-#define elf_backend_always_size_sections \
- _bfd_riscv_elf_always_size_sections
-#define elf_backend_size_dynamic_sections \
- _bfd_riscv_elf_size_dynamic_sections
-#define elf_backend_init_index_section _bfd_elf_init_1_index_section
-#define elf_backend_relocate_section _bfd_riscv_elf_relocate_section
-#define elf_backend_finish_dynamic_symbol \
- _bfd_riscv_elf_finish_dynamic_symbol
-#define elf_backend_finish_dynamic_sections \
- _bfd_riscv_elf_finish_dynamic_sections
-#define elf_backend_additional_program_headers \
- _bfd_riscv_elf_additional_program_headers
-#define elf_backend_modify_segment_map _bfd_riscv_elf_modify_segment_map
-#define elf_backend_copy_indirect_symbol \
- _bfd_riscv_elf_copy_indirect_symbol
-#define elf_backend_grok_prstatus elf32_riscv_grok_prstatus
-#define elf_backend_grok_psinfo elf32_riscv_grok_psinfo
-
-#define elf_backend_got_header_size (4 * RISCV_RESERVED_GOTNO)
-
-/* RISC-V ELF can use a mixture of REL and RELA, but some Relocations
- work better/work only in RELA, so we default to this. */
-#define elf_backend_may_use_rel_p 1
-#define elf_backend_may_use_rela_p 1
-#define elf_backend_default_use_rela_p 1
-#define elf_backend_rela_plts_and_copies_p 0
-#define elf_backend_sign_extend_vma TRUE
-#define elf_backend_plt_readonly 1
-#define elf_backend_plt_sym_val _bfd_riscv_elf_plt_sym_val
-
-#define elf_backend_discard_info _bfd_riscv_elf_discard_info
Home |
Main Index |
Thread Index |
Old Index