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 Merge in OR1K support from top o...



details:   https://anonhg.NetBSD.org/src/rev/a601adee5efb
branches:  trunk
changeset: 802116:a601adee5efb
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Sep 03 19:01:15 2014 +0000

description:
Merge in OR1K support from top of binutils-gdb GIT repository.  This replaces
the existing support and most imporantly adds support for shared libraries.

diffstat:

 external/gpl3/binutils/dist/bfd/Makefile.in                  |    18 +-
 external/gpl3/binutils/dist/bfd/archures.c                   |     6 +-
 external/gpl3/binutils/dist/bfd/bfd-in2.h                    |    32 +-
 external/gpl3/binutils/dist/bfd/coff-or32.c                  |   629 --
 external/gpl3/binutils/dist/bfd/coffcode.h                   |    15 -
 external/gpl3/binutils/dist/bfd/config.bfd                   |    15 +-
 external/gpl3/binutils/dist/bfd/configure                    |     4 +-
 external/gpl3/binutils/dist/bfd/configure.in                 |     3 +-
 external/gpl3/binutils/dist/bfd/cpu-or1k.c                   |    61 +
 external/gpl3/binutils/dist/bfd/cpu-or32.c                   |    42 -
 external/gpl3/binutils/dist/bfd/elf-bfd.h                    |     1 +
 external/gpl3/binutils/dist/bfd/elf32-openrisc.c             |   566 -
 external/gpl3/binutils/dist/bfd/elf32-or1k.c                 |  2852 ++++++++++
 external/gpl3/binutils/dist/bfd/elf32-or32.c                 |   514 -
 external/gpl3/binutils/dist/bfd/libbfd.h                     |    26 +-
 external/gpl3/binutils/dist/bfd/targets.c                    |     8 +-
 external/gpl3/binutils/dist/binutils/readelf.c               |    18 +-
 external/gpl3/binutils/dist/config.sub                       |    16 +-
 external/gpl3/binutils/dist/cpu/openrisc.cpu                 |   774 --
 external/gpl3/binutils/dist/cpu/openrisc.opc                 |   164 -
 external/gpl3/binutils/dist/cpu/or1k.cpu                     |   131 +
 external/gpl3/binutils/dist/cpu/or1k.opc                     |   421 +
 external/gpl3/binutils/dist/cpu/or1kcommon.cpu               |   360 +
 external/gpl3/binutils/dist/cpu/or1korbis.cpu                |  1145 ++++
 external/gpl3/binutils/dist/cpu/or1korfpx.cpu                |   222 +
 external/gpl3/binutils/dist/gas/Makefile.am                  |     6 +-
 external/gpl3/binutils/dist/gas/Makefile.in                  |    43 +-
 external/gpl3/binutils/dist/gas/config/tc-openrisc.c         |   363 -
 external/gpl3/binutils/dist/gas/config/tc-openrisc.h         |    61 -
 external/gpl3/binutils/dist/gas/config/tc-or1k.c             |   362 +
 external/gpl3/binutils/dist/gas/config/tc-or1k.h             |    79 +
 external/gpl3/binutils/dist/gas/config/tc-or32.c             |   967 ---
 external/gpl3/binutils/dist/gas/config/tc-or32.h             |    56 -
 external/gpl3/binutils/dist/gas/configure                    |     4 +-
 external/gpl3/binutils/dist/gas/configure.in                 |     4 +-
 external/gpl3/binutils/dist/gas/configure.tgt                |    11 +-
 external/gpl3/binutils/dist/include/dis-asm.h                |     4 +-
 external/gpl3/binutils/dist/include/elf/common.h             |     5 +-
 external/gpl3/binutils/dist/include/elf/openrisc.h           |    39 -
 external/gpl3/binutils/dist/include/elf/or1k.h               |    65 +
 external/gpl3/binutils/dist/include/elf/or32.h               |    56 -
 external/gpl3/binutils/dist/ld/Makefile.am                   |    18 +-
 external/gpl3/binutils/dist/ld/Makefile.in                   |    30 +-
 external/gpl3/binutils/dist/ld/configure.tgt                 |    10 +-
 external/gpl3/binutils/dist/ld/emulparams/elf32openrisc.sh   |    11 -
 external/gpl3/binutils/dist/ld/emulparams/elf32or1k.sh       |    14 +
 external/gpl3/binutils/dist/ld/emulparams/elf32or1k_linux.sh |     6 +
 external/gpl3/binutils/dist/ld/emulparams/elf32or1k_nbsd.sh  |     6 +
 external/gpl3/binutils/dist/ld/emulparams/or32.sh            |     5 -
 external/gpl3/binutils/dist/ld/emulparams/or32elf.sh         |     9 -
 external/gpl3/binutils/dist/opcodes/Makefile.am              |    30 +-
 external/gpl3/binutils/dist/opcodes/Makefile.in              |    41 +-
 external/gpl3/binutils/dist/opcodes/configure                |     3 +-
 external/gpl3/binutils/dist/opcodes/configure.in             |     3 +-
 external/gpl3/binutils/dist/opcodes/disassemble.c            |    17 +-
 external/gpl3/binutils/dist/opcodes/openrisc-asm.c           |   649 --
 external/gpl3/binutils/dist/opcodes/openrisc-desc.c          |  1018 ---
 external/gpl3/binutils/dist/opcodes/openrisc-desc.h          |   288 -
 external/gpl3/binutils/dist/opcodes/openrisc-dis.c           |   556 -
 external/gpl3/binutils/dist/opcodes/openrisc-ibld.c          |  1009 ---
 external/gpl3/binutils/dist/opcodes/openrisc-opc.c           |   682 --
 external/gpl3/binutils/dist/opcodes/openrisc-opc.h           |   113 -
 external/gpl3/binutils/dist/opcodes/or1k-asm.c               |   910 +++
 external/gpl3/binutils/dist/opcodes/or1k-desc.c              |  2110 +++++++
 external/gpl3/binutils/dist/opcodes/or1k-desc.h              |   682 ++
 external/gpl3/binutils/dist/opcodes/or1k-dis.c               |   561 +
 external/gpl3/binutils/dist/opcodes/or1k-ibld.c              |  1050 +++
 external/gpl3/binutils/dist/opcodes/or1k-opc.c               |  1081 +++
 external/gpl3/binutils/dist/opcodes/or1k-opc.h               |   135 +
 external/gpl3/binutils/dist/opcodes/or1k-opinst.c            |   590 ++
 external/gpl3/binutils/dist/opcodes/or32-dis.c               |   325 -
 external/gpl3/binutils/dist/opcodes/or32-opc.c               |  1031 ---
 72 files changed, 13040 insertions(+), 10121 deletions(-)

diffs (truncated from 24000 to 300 lines):

diff -r 97cf9526c41b -r a601adee5efb external/gpl3/binutils/dist/bfd/Makefile.in
--- a/external/gpl3/binutils/dist/bfd/Makefile.in       Wed Sep 03 16:23:24 2014 +0000
+++ b/external/gpl3/binutils/dist/bfd/Makefile.in       Wed Sep 03 19:01:15 2014 +0000
@@ -419,7 +419,7 @@
        cpu-mt.lo \
        cpu-ns32k.lo \
        cpu-openrisc.lo \
-       cpu-or32.lo \
+       cpu-or1k.lo \
        cpu-pdp11.lo \
        cpu-pj.lo \
        cpu-plugin.lo \
@@ -500,7 +500,7 @@
        cpu-mt.c \
        cpu-ns32k.c \
        cpu-openrisc.c \
-       cpu-or32.c \
+       cpu-or1k.c \
        cpu-pdp11.c \
        cpu-pj.c \
        cpu-plugin.c \
@@ -559,7 +559,7 @@
        coff-m68k.lo \
        coff-m88k.lo \
        coff-mips.lo \
-       coff-or32.lo \
+       coff-or1k.lo \
        coff-rs6000.lo \
        coff-sh.lo \
        coff-sparc.lo \
@@ -627,7 +627,7 @@
        elf32-msp430.lo \
        elf32-mt.lo \
        elf32-openrisc.lo \
-       elf32-or32.lo \
+       elf32-or1k.lo \
        elf32-pj.lo \
        elf32-ppc.lo \
        elf32-rl78.lo \
@@ -747,7 +747,7 @@
        coff-m68k.c \
        coff-m88k.c \
        coff-mips.c \
-       coff-or32.c \
+       coff-or1k.c \
        coff-rs6000.c \
        coff-sh.c \
        coff-sparc.c \
@@ -815,7 +815,7 @@
        elf32-msp430.c \
        elf32-mt.c \
        elf32-openrisc.c \
-       elf32-or32.c \
+       elf32-or1k.c \
        elf32-pj.c \
        elf32-ppc.c \
        elf32-rl78.c \
@@ -1253,7 +1253,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-m68k.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-m88k.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-mips.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-or32.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-or1k.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-rs6000.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-sh.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-sparc.Plo@am__quote@
@@ -1323,7 +1323,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-mt.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-ns32k.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-openrisc.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-or32.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-or1k.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-pdp11.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-pj.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-plugin.Plo@am__quote@
@@ -1408,7 +1408,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-msp430.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-mt.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-openrisc.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-or32.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-or1k.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-pj.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-ppc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-rl78.Plo@am__quote@
diff -r 97cf9526c41b -r a601adee5efb external/gpl3/binutils/dist/bfd/archures.c
--- a/external/gpl3/binutils/dist/bfd/archures.c        Wed Sep 03 16:23:24 2014 +0000
+++ b/external/gpl3/binutils/dist/bfd/archures.c        Wed Sep 03 19:01:15 2014 +0000
@@ -123,7 +123,7 @@
 .#define bfd_mach_i960_jx       7
 .#define bfd_mach_i960_hx        8
 .
-.  bfd_arch_or32,      {* OpenRISC 32 *}
+.  bfd_arch_or1k,      {* OpenRISC 32 *}
 .
 .  bfd_arch_sparc,     {* SPARC *}
 .#define bfd_mach_sparc                        1
@@ -556,7 +556,7 @@
 extern const bfd_arch_info_type bfd_mt_arch;
 extern const bfd_arch_info_type bfd_ns32k_arch;
 extern const bfd_arch_info_type bfd_openrisc_arch;
-extern const bfd_arch_info_type bfd_or32_arch;
+extern const bfd_arch_info_type bfd_or1k_arch;
 extern const bfd_arch_info_type bfd_pdp11_arch;
 extern const bfd_arch_info_type bfd_pj_arch;
 extern const bfd_arch_info_type bfd_plugin_arch;
@@ -642,7 +642,7 @@
     &bfd_mt_arch,
     &bfd_ns32k_arch,
     &bfd_openrisc_arch,
-    &bfd_or32_arch,
+    &bfd_or1k_arch,
     &bfd_pdp11_arch,
     &bfd_powerpc_arch,
     &bfd_rs6000_arch,
diff -r 97cf9526c41b -r a601adee5efb external/gpl3/binutils/dist/bfd/bfd-in2.h
--- a/external/gpl3/binutils/dist/bfd/bfd-in2.h Wed Sep 03 16:23:24 2014 +0000
+++ b/external/gpl3/binutils/dist/bfd/bfd-in2.h Wed Sep 03 19:01:15 2014 +0000
@@ -1852,7 +1852,9 @@
 #define bfd_mach_i960_jx        7
 #define bfd_mach_i960_hx        8
 
-  bfd_arch_or32,      /* OpenRISC 32 */
+  bfd_arch_or1k,      /* OpenRISC 1000 */
+#define bfd_mach_or1k          1
+#define bfd_mach_or1knd                2
 
   bfd_arch_sparc,     /* SPARC */
 #define bfd_mach_sparc                 1
@@ -4803,9 +4805,31 @@
   BFD_RELOC_860_HIGOT,
   BFD_RELOC_860_HIGOTOFF,
 
-/* OpenRISC Relocations.  */
-  BFD_RELOC_OPENRISC_ABS_26,
-  BFD_RELOC_OPENRISC_REL_26,
+/* OpenRISC 1000 Relocations.  */
+  BFD_RELOC_OR1K_REL_26,
+  BFD_RELOC_OR1K_GOTPC_HI16,
+  BFD_RELOC_OR1K_GOTPC_LO16,
+  BFD_RELOC_OR1K_GOT16,
+  BFD_RELOC_OR1K_PLT26,
+  BFD_RELOC_OR1K_GOTOFF_HI16,
+  BFD_RELOC_OR1K_GOTOFF_LO16,
+  BFD_RELOC_OR1K_COPY,
+  BFD_RELOC_OR1K_GLOB_DAT,
+  BFD_RELOC_OR1K_JMP_SLOT,
+  BFD_RELOC_OR1K_RELATIVE,
+  BFD_RELOC_OR1K_TLS_GD_HI16,
+  BFD_RELOC_OR1K_TLS_GD_LO16,
+  BFD_RELOC_OR1K_TLS_LDM_HI16,
+  BFD_RELOC_OR1K_TLS_LDM_LO16,
+  BFD_RELOC_OR1K_TLS_LDO_HI16,
+  BFD_RELOC_OR1K_TLS_LDO_LO16,
+  BFD_RELOC_OR1K_TLS_IE_HI16,
+  BFD_RELOC_OR1K_TLS_IE_LO16,
+  BFD_RELOC_OR1K_TLS_LE_HI16,
+  BFD_RELOC_OR1K_TLS_LE_LO16,
+  BFD_RELOC_OR1K_TLS_TPOFF,
+  BFD_RELOC_OR1K_TLS_DTPOFF,
+  BFD_RELOC_OR1K_TLS_DTPMOD,
 
 /* H8 elf Relocations.  */
   BFD_RELOC_H8_DIR16A8,
diff -r 97cf9526c41b -r a601adee5efb external/gpl3/binutils/dist/bfd/coff-or32.c
--- a/external/gpl3/binutils/dist/bfd/coff-or32.c       Wed Sep 03 16:23:24 2014 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,629 +0,0 @@
-/* BFD back-end for OpenRISC 1000 COFF binaries.
-   Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012
-   Free Software Foundation, Inc.
-   Contributed by Ivan Guzvinec  <ivang%opencores.org@localhost>
-
-   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.  */
-
-#define OR32 1
-
-#include "sysdep.h"
-#include "bfd.h"
-#include "libbfd.h"
-#include "coff/or32.h"
-#include "coff/internal.h"
-#include "libcoff.h"
-
-static bfd_reloc_status_type or32_reloc
-  (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
-
-#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
-
-#define INSERT_HWORD(WORD,HWORD)              \
-    (((WORD) & 0xffff0000) | ((HWORD)& 0x0000ffff))
-#define EXTRACT_HWORD(WORD)                   \
-    ((WORD) & 0x0000ffff)
-#define SIGN_EXTEND_HWORD(HWORD)              \
-    ((HWORD) & 0x8000 ? (HWORD)|(~0xffffL) : (HWORD))
-
-#define INSERT_JUMPTARG(WORD,JT)              \
-    (((WORD) & 0xfc000000) | ((JT)& 0x03ffffff))
-#define EXTRACT_JUMPTARG(WORD)                   \
-    ((WORD) & 0x03ffffff)
-#define SIGN_EXTEND_JUMPTARG(JT)              \
-    ((JT) & 0x04000000 ? (JT)|(~0x03ffffffL) : (JT))
-
-/* Provided the symbol, returns the value reffed.  */
-
-static long
-get_symbol_value (asymbol *symbol)
-{
-  long relocation = 0;
-
-  if (bfd_is_com_section (symbol->section))
-    relocation = 0;
-  else
-    relocation = symbol->value +
-      symbol->section->output_section->vma +
-      symbol->section->output_offset;
-
-  return relocation;
-}
-
-/* This function is in charge of performing all the or32 relocations.  */
-
-static bfd_reloc_status_type
-or32_reloc (bfd *abfd,
-           arelent *reloc_entry,
-           asymbol *symbol_in,
-           void * data,
-           asection *input_section,
-           bfd *output_bfd,
-           char **error_message)
-{
-  /* The consth relocation comes in two parts, we have to remember
-     the state between calls, in these variables.  */
-  static bfd_boolean part1_consth_active = FALSE;
-  static unsigned long part1_consth_value;
-
-  unsigned long insn;
-  unsigned long sym_value;
-  unsigned long unsigned_value;
-  unsigned short r_type;
-  long signed_value;
-
-  unsigned long addr = reloc_entry->address ;   /*+ input_section->vma*/
-  bfd_byte *hit_data =addr + (bfd_byte *)(data);
-
-  r_type = reloc_entry->howto->type;
-
-  if (output_bfd)
-    {
-      /* Partial linking - do nothing.  */
-      reloc_entry->address += input_section->output_offset;
-      return bfd_reloc_ok;
-    }
-
-  if (symbol_in != NULL
-      && bfd_is_und_section (symbol_in->section))
-    {
-      /* Keep the state machine happy in case we're called again.  */
-      if (r_type == R_IHIHALF)
-        {
-          part1_consth_active = TRUE;
-          part1_consth_value  = 0;
-        }
-
-      return bfd_reloc_undefined;
-    }
-
-  if ((part1_consth_active) && (r_type != R_IHCONST))
-    {
-      part1_consth_active = FALSE;
-      *error_message = (char *) "Missing IHCONST";
-
-      return bfd_reloc_dangerous;
-    }
-
-  sym_value = get_symbol_value (symbol_in);
-
-  switch (r_type)
-    {
-    case R_IREL:
-      insn = bfd_get_32(abfd, hit_data);
-
-      /* Take the value in the field and sign extend it.  */
-      signed_value = EXTRACT_JUMPTARG (insn);
-      signed_value = SIGN_EXTEND_JUMPTARG (signed_value);
-      signed_value <<= 2;



Home | Main Index | Thread Index | Old Index