diff options
author | Dimitar Dimitrov <dimitar@dinux.eu> | 2016-12-30 12:39:47 +0200 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2016-12-31 12:03:22 +1030 |
commit | 2b100bb5cf206f9254453a00e4b48e32d3584625 (patch) | |
tree | 287f659d12bf178ae4073ff245fde16271bee4d9 /binutils/readelf.c | |
parent | 111468496477e97c9414d2d54f97bfdaa380f794 (diff) | |
download | gdb-2b100bb5cf206f9254453a00e4b48e32d3584625.zip gdb-2b100bb5cf206f9254453a00e4b48e32d3584625.tar.gz gdb-2b100bb5cf206f9254453a00e4b48e32d3584625.tar.bz2 |
PRU Binutils port
* readelf.c (guess_is_rela): Add EM_TI_PRU.
(dump_relocations): Invoke elf_pru_reloc_type.
(get_machine_name): Handle EM_TI_PRU.
(is_32bit_abs_reloc): Handle R_PRU_BFD_RELOC_32.
(is_16bit_abs_reloc): Handle R_PRU_BFD_RELOC_16.
(is_none_reloc): Handle PRU_NONE and PRU_DIFF variants.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r-- | binutils/readelf.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c index 873a471..0a49e8a 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -137,6 +137,7 @@ #include "elf/pj.h" #include "elf/ppc.h" #include "elf/ppc64.h" +#include "elf/pru.h" #include "elf/rl78.h" #include "elf/rx.h" #include "elf/s390.h" @@ -776,6 +777,7 @@ guess_is_rela (unsigned int e_machine) case EM_OR1K: case EM_PPC64: case EM_PPC: + case EM_TI_PRU: case EM_RISCV: case EM_RL78: case EM_RX: @@ -1483,6 +1485,10 @@ dump_relocations (FILE * file, case EM_ALTERA_NIOS2: rtype = elf_nios2_reloc_type (type); break; + + case EM_TI_PRU: + rtype = elf_pru_reloc_type (type); + break; } if (rtype == NULL) @@ -2370,6 +2376,7 @@ get_machine_name (unsigned e_machine) case EM_CSR_KALIMBA: return "CSR Kalimba architecture family"; case EM_Z80: return "Zilog Z80"; case EM_AMDGPU: return "AMD GPU architecture"; + case EM_TI_PRU: return "TI PRU I/O processor"; default: snprintf (buff, sizeof (buff), _("<unknown>: 0x%x"), e_machine); return buff; @@ -11852,6 +11859,8 @@ is_32bit_abs_reloc (unsigned int reloc_type) return reloc_type == 1; /* R_PPC64_ADDR32. */ case EM_PPC: return reloc_type == 1; /* R_PPC_ADDR32. */ + case EM_TI_PRU: + return reloc_type == 11; /* R_PRU_BFD_RELOC_32. */ case EM_RISCV: return reloc_type == 1; /* R_RISCV_32. */ case EM_RL78: @@ -12134,6 +12143,8 @@ is_16bit_abs_reloc (unsigned int reloc_type) return reloc_type == 9; /* R_NIOS_16. */ case EM_OR1K: return reloc_type == 2; /* R_OR1K_16. */ + case EM_TI_PRU: + return reloc_type == 8; /* R_PRU_BFD_RELOC_16. */ case EM_TI_C6000: return reloc_type == 2; /* R_C6000_ABS16. */ case EM_VISIUM: @@ -12210,6 +12221,11 @@ is_none_reloc (unsigned int reloc_type) || reloc_type == 205 /* R_NDS32_DIFF16. */ || reloc_type == 206 /* R_NDS32_DIFF32. */ || reloc_type == 207 /* R_NDS32_ULEB128. */); + case EM_TI_PRU: + return (reloc_type == 0 /* R_PRU_NONE. */ + || reloc_type == 65 /* R_PRU_DIFF8. */ + || reloc_type == 66 /* R_PRU_DIFF16. */ + || reloc_type == 67 /* R_PRU_DIFF32. */); case EM_XTENSA_OLD: case EM_XTENSA: return (reloc_type == 0 /* R_XTENSA_NONE. */ |