This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 00/19] Binutils/gas/ld port for PRU


Hi,

I'd like to submit a Binutils port for the Texas Instruments PRU I/O core [1]. This port targets version 3 of the PRU core, which is found in the popular Beaglebone line of boards. The older core revisions are not supported.

I have the GCC testsuite passing using the simulator and a not-yet-mainlined GCC port [2]. I've also validated a few real-world example programs [3].

The PRU ELF format is not officially documented. There is a proprietary TI toolchain, but this GNU PRU port is not 100% compatible with it. Namely, I could not find a way to output 0 for both Instruction and Data RAM loading addresses. So I took the AVR approach and marked instruction memory with a special address offset, which differentiates it from data memory addresses.

In practice, GNU PRU ELF executables can be fed to existing PRU program loaders after a trivial host modification: https://github.com/dinuxbg/pru-gcc-examples/blob/master/blinking-led/host-remoteproc/0001-Fix-remoteproc-to-work-with-the-PRU-GNU-Binutils-por.patch

Apart from the last two patches, changes for the PRU port are self-contained and should not affect other targets.

Regards,
Dimitar

[1] http://processors.wiki.ti.com/index.php/PRU-ICSS
[2] http://github.com/dinuxbg/gnupru
[3] http://github.com/dinuxbg/pru-gcc-examples


Dimitar Dimitrov (19):
  Sync config.sub with upstream
  PRU BFD support
  PRU Binutils port
  PRU GAS Port
  PRU LD Port
  PRU Opcode Port
  Add PRU ELF ID to elfcpp
  ld: testsuite: Mark PRU as elf target that does not support shared
    libraries
  ld: testsuite: Mark sec64k case as too big for PRU
  ld: testsuite: Fix srec test setup for PRU
  gas: testsuite: Mark lns-common-1-alt variant for PRU
  ld: testsuite: Disable test that is broken by the _ prefix added to
    symbols by PRU-GCC
  ld: testsuite: PRU assembler does not support diff expressions mixing
    data and text labels.
  ld: testsuite: PRU LD does not support arbitrary .text base addresses.
  ld: testsuite: Relocatable output for PRU actually merges all .text.*
    sections
  ld: testsuite: Disable endsym test case
  ld: testsuite: Disable pr19161 test case for PRU
  ld: testsuite: Sanitize output from ld
  ld: testsuite: Fix test for targets with elf_symbol_leading_char

 bfd/Makefile.am                            |    4 +
 bfd/Makefile.in                            |    6 +
 bfd/archures.c                             |    4 +
 bfd/bfd-in2.h                              |   40 +
 bfd/config.bfd                             |    6 +
 bfd/configure.ac                           |    1 +
 bfd/cpu-pru.c                              |   43 +
 bfd/elf-bfd.h                              |    1 +
 bfd/elf32-pru.c                            | 1549 +++++++++++++++++++++++
 bfd/libbfd.h                               |   15 +
 bfd/reloc.c                                |   54 +
 bfd/targets.c                              |    3 +
 binutils/readelf.c                         |   24 +
 binutils/testsuite/lib/binutils-common.exp |    1 +
 config.sub                                 |    6 +-
 elfcpp/elfcpp.h                            |    1 +
 gas/Makefile.am                            |    2 +
 gas/Makefile.in                            |   17 +
 gas/NEWS                                   |    2 +
 gas/config/obj-elf.c                       |    4 +
 gas/config/tc-pru.c                        | 1846 ++++++++++++++++++++++++++++
 gas/config/tc-pru.h                        |  157 +++
 gas/configure.tgt                          |    2 +
 gas/doc/Makefile.am                        |    1 +
 gas/doc/Makefile.in                        |    1 +
 gas/doc/all.texi                           |    1 +
 gas/doc/as.texinfo                         |   30 +
 gas/doc/c-pru.texi                         |  147 +++
 gas/testsuite/gas/lns/lns.exp              |    1 +
 gas/testsuite/gas/pru/alu.d                |   32 +
 gas/testsuite/gas/pru/alu.s                |   30 +
 gas/testsuite/gas/pru/branch.d             |   63 +
 gas/testsuite/gas/pru/branch.s             |   42 +
 gas/testsuite/gas/pru/illegal.l            |    5 +
 gas/testsuite/gas/pru/illegal.s            |   11 +
 gas/testsuite/gas/pru/ldi.d                |   19 +
 gas/testsuite/gas/pru/ldi.s                |   12 +
 gas/testsuite/gas/pru/ldst.d               |   33 +
 gas/testsuite/gas/pru/ldst.s               |   37 +
 gas/testsuite/gas/pru/loop.d               |   15 +
 gas/testsuite/gas/pru/loop.s               |   10 +
 gas/testsuite/gas/pru/misc.d               |   12 +
 gas/testsuite/gas/pru/misc.s               |    6 +
 gas/testsuite/gas/pru/pru.exp              |   26 +
 gas/testsuite/gas/pru/pseudo.d             |   15 +
 gas/testsuite/gas/pru/pseudo.s             |   10 +
 gas/testsuite/gas/pru/warn_reglabel.l      |    3 +
 gas/testsuite/gas/pru/warn_reglabel.s      |    6 +
 gas/testsuite/gas/pru/xfr.d                |   44 +
 gas/testsuite/gas/pru/xfr.s                |   52 +
 include/dis-asm.h                          |    1 +
 include/elf/common.h                       |    2 +-
 include/elf/pru.h                          |   62 +
 include/opcode/pru.h                       |  403 ++++++
 ld/Makefile.am                             |    6 +
 ld/Makefile.in                             |    6 +
 ld/NEWS                                    |    2 +
 ld/configure.tgt                           |    1 +
 ld/emulparams/pruelf.sh                    |   19 +
 ld/emultempl/pruelf.em                     |   50 +
 ld/scripttempl/pru.sc                      |  213 ++++
 ld/testsuite/ld-elf/eh-frame-hdr.d         |    2 +-
 ld/testsuite/ld-elf/endsym.d               |    1 +
 ld/testsuite/ld-elf/merge.d                |    2 +-
 ld/testsuite/ld-elf/pr14926.d              |    2 +-
 ld/testsuite/ld-elf/pr20528a.d             |    2 +-
 ld/testsuite/ld-elf/pr20528b.d             |    2 +-
 ld/testsuite/ld-elf/sec-to-seg.exp         |    1 +
 ld/testsuite/ld-elf/sec64k.exp             |    3 +-
 ld/testsuite/ld-gc/pr13683.d               |    2 +-
 ld/testsuite/ld-gc/pr19161.d               |    1 +
 ld/testsuite/ld-plugin/plugin-12.d         |    8 +-
 ld/testsuite/ld-pru/emit-relocs-1.d        |   37 +
 ld/testsuite/ld-pru/emit-relocs-1.ld       |   20 +
 ld/testsuite/ld-pru/emit-relocs-1a.s       |   24 +
 ld/testsuite/ld-pru/emit-relocs-1b.s       |   18 +
 ld/testsuite/ld-pru/hilo16.d               |   13 +
 ld/testsuite/ld-pru/hilo16.s               |    8 +
 ld/testsuite/ld-pru/hilo16_symbol.s        |    3 +
 ld/testsuite/ld-pru/norelax_hi_rlz-data.d  |   18 +
 ld/testsuite/ld-pru/norelax_hi_rlz-dis.d   |   22 +
 ld/testsuite/ld-pru/pcrel_s10.d            |   18 +
 ld/testsuite/ld-pru/pcrel_s10.s            |    8 +
 ld/testsuite/ld-pru/pcrel_s10_label.s      |    9 +
 ld/testsuite/ld-pru/pcrel_u8-illegal.d     |    7 +
 ld/testsuite/ld-pru/pcrel_u8-illegal.s     |   10 +
 ld/testsuite/ld-pru/pcrel_u8-illegal2.d    |    7 +
 ld/testsuite/ld-pru/pcrel_u8-illegal2.s    |    7 +
 ld/testsuite/ld-pru/pcrel_u8-illegal3.d    |    7 +
 ld/testsuite/ld-pru/pcrel_u8-illegal3.s    |    7 +
 ld/testsuite/ld-pru/pcrel_u8.d             |   15 +
 ld/testsuite/ld-pru/pcrel_u8.s             |   10 +
 ld/testsuite/ld-pru/pcrel_u8_label.s       |    4 +
 ld/testsuite/ld-pru/pmem.d                 |   15 +
 ld/testsuite/ld-pru/pmem.s                 |   15 +
 ld/testsuite/ld-pru/pmem_symbol.s          |   15 +
 ld/testsuite/ld-pru/pru.exp                |    9 +
 ld/testsuite/ld-pru/relax_hi_rlz-data.d    |   18 +
 ld/testsuite/ld-pru/relax_hi_rlz-dis.d     |   20 +
 ld/testsuite/ld-pru/relax_hi_rlz.s         |   30 +
 ld/testsuite/ld-pru/relax_hi_rlz_symbol.s  |    6 +
 ld/testsuite/ld-pru/reloc.d                |   14 +
 ld/testsuite/ld-pru/reloc.s                |    9 +
 ld/testsuite/ld-pru/reloc_symbol.s         |   25 +
 ld/testsuite/ld-pru/u16_u8.d               |   12 +
 ld/testsuite/ld-pru/u16_u8.s               |    5 +
 ld/testsuite/ld-pru/u16_u8_symbol.s        |    6 +
 ld/testsuite/ld-srec/srec.exp              |    5 +
 ld/testsuite/lib/ld-lib.exp                |    2 +
 opcodes/Makefile.am                        |    2 +
 opcodes/Makefile.in                        |    4 +
 opcodes/configure.ac                       |    1 +
 opcodes/disassemble.c                      |    7 +-
 opcodes/pru-dis.c                          |  284 +++++
 opcodes/pru-opc.c                          |  232 ++++
 115 files changed, 6236 insertions(+), 15 deletions(-)
 create mode 100644 bfd/cpu-pru.c
 create mode 100644 bfd/elf32-pru.c
 create mode 100644 gas/config/tc-pru.c
 create mode 100644 gas/config/tc-pru.h
 create mode 100644 gas/doc/c-pru.texi
 create mode 100644 gas/testsuite/gas/pru/alu.d
 create mode 100644 gas/testsuite/gas/pru/alu.s
 create mode 100644 gas/testsuite/gas/pru/branch.d
 create mode 100644 gas/testsuite/gas/pru/branch.s
 create mode 100644 gas/testsuite/gas/pru/illegal.l
 create mode 100644 gas/testsuite/gas/pru/illegal.s
 create mode 100644 gas/testsuite/gas/pru/ldi.d
 create mode 100644 gas/testsuite/gas/pru/ldi.s
 create mode 100644 gas/testsuite/gas/pru/ldst.d
 create mode 100644 gas/testsuite/gas/pru/ldst.s
 create mode 100644 gas/testsuite/gas/pru/loop.d
 create mode 100644 gas/testsuite/gas/pru/loop.s
 create mode 100644 gas/testsuite/gas/pru/misc.d
 create mode 100644 gas/testsuite/gas/pru/misc.s
 create mode 100644 gas/testsuite/gas/pru/pru.exp
 create mode 100644 gas/testsuite/gas/pru/pseudo.d
 create mode 100644 gas/testsuite/gas/pru/pseudo.s
 create mode 100644 gas/testsuite/gas/pru/warn_reglabel.l
 create mode 100644 gas/testsuite/gas/pru/warn_reglabel.s
 create mode 100644 gas/testsuite/gas/pru/xfr.d
 create mode 100644 gas/testsuite/gas/pru/xfr.s
 create mode 100644 include/elf/pru.h
 create mode 100644 include/opcode/pru.h
 create mode 100644 ld/emulparams/pruelf.sh
 create mode 100644 ld/emultempl/pruelf.em
 create mode 100644 ld/scripttempl/pru.sc
 create mode 100644 ld/testsuite/ld-pru/emit-relocs-1.d
 create mode 100644 ld/testsuite/ld-pru/emit-relocs-1.ld
 create mode 100644 ld/testsuite/ld-pru/emit-relocs-1a.s
 create mode 100644 ld/testsuite/ld-pru/emit-relocs-1b.s
 create mode 100644 ld/testsuite/ld-pru/hilo16.d
 create mode 100644 ld/testsuite/ld-pru/hilo16.s
 create mode 100644 ld/testsuite/ld-pru/hilo16_symbol.s
 create mode 100644 ld/testsuite/ld-pru/norelax_hi_rlz-data.d
 create mode 100644 ld/testsuite/ld-pru/norelax_hi_rlz-dis.d
 create mode 100644 ld/testsuite/ld-pru/pcrel_s10.d
 create mode 100644 ld/testsuite/ld-pru/pcrel_s10.s
 create mode 100644 ld/testsuite/ld-pru/pcrel_s10_label.s
 create mode 100644 ld/testsuite/ld-pru/pcrel_u8-illegal.d
 create mode 100644 ld/testsuite/ld-pru/pcrel_u8-illegal.s
 create mode 100644 ld/testsuite/ld-pru/pcrel_u8-illegal2.d
 create mode 100644 ld/testsuite/ld-pru/pcrel_u8-illegal2.s
 create mode 100644 ld/testsuite/ld-pru/pcrel_u8-illegal3.d
 create mode 100644 ld/testsuite/ld-pru/pcrel_u8-illegal3.s
 create mode 100644 ld/testsuite/ld-pru/pcrel_u8.d
 create mode 100644 ld/testsuite/ld-pru/pcrel_u8.s
 create mode 100644 ld/testsuite/ld-pru/pcrel_u8_label.s
 create mode 100644 ld/testsuite/ld-pru/pmem.d
 create mode 100644 ld/testsuite/ld-pru/pmem.s
 create mode 100644 ld/testsuite/ld-pru/pmem_symbol.s
 create mode 100644 ld/testsuite/ld-pru/pru.exp
 create mode 100644 ld/testsuite/ld-pru/relax_hi_rlz-data.d
 create mode 100644 ld/testsuite/ld-pru/relax_hi_rlz-dis.d
 create mode 100644 ld/testsuite/ld-pru/relax_hi_rlz.s
 create mode 100644 ld/testsuite/ld-pru/relax_hi_rlz_symbol.s
 create mode 100644 ld/testsuite/ld-pru/reloc.d
 create mode 100644 ld/testsuite/ld-pru/reloc.s
 create mode 100644 ld/testsuite/ld-pru/reloc_symbol.s
 create mode 100644 ld/testsuite/ld-pru/u16_u8.d
 create mode 100644 ld/testsuite/ld-pru/u16_u8.s
 create mode 100644 ld/testsuite/ld-pru/u16_u8_symbol.s
 create mode 100644 opcodes/pru-dis.c
 create mode 100644 opcodes/pru-opc.c

-- 
2.10.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]