From 684d5a10b1332e2a1b03a1d6e7a899ef87b3ea16 Mon Sep 17 00:00:00 2001 From: John Eric Martin Date: Wed, 19 Jul 2017 09:56:55 +0200 Subject: [ARC] Add JLI support. The following relocation types were added to GCC/binutils: ARC_JLI_SECTOFF is a relocation type in Metaware that is now used by GCC as well to adjust the index of function calls to functions with attribute jli_call_always. bfd/ 2017-07-19 Claudiu Zissulescu John Eric Martin * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elf32-arc.c (JLI): Define. * reloc.c: Add JLI relocations. gas/ 2017-07-19 Claudiu Zissulescu * testsuite/gas/arc/jli-1.d: New file. * testsuite/gas/arc/jli-1.s: Likewise. * testsuite/gas/arc/taux.d: Update for jli_base. include/ 2017-07-19 Claudiu Zissulescu John Eric Martin * elf/arc-reloc.def: Add JLI relocs howto. * opcode/arc-func.h (replace_jli): New function. ld/ 2017-07-19 Claudiu Zissulescu John Eric Martin * emulparams/arcelf.sh (JLI_START_TABLE): Define. * scripttempl/elfarc.sc: Handle jlitab section. * scripttempl/elfarcv2.sc: Likewise. * testsuite/ld-arc/arc.exp: Add JLI test. * testsuite/ld-arc/jli-script.ld: New file. * testsuite/ld-arc/jli-simple.dd: Likewise. * testsuite/ld-arc/jli-simple.rd: Likewise. * testsuite/ld-arc/jli-simple.s: Likewise. * testsuite/ld/testsuite/ld-arc/jli-overflow.s: Likewise. * testsuite/ld/testsuite/ld-arc/jli-overflow.d: Likewise. * testsuite/ld/testsuite/ld-arc/jli-overflow.err: Likewise. opcode/ 2017-07-19 Claudiu Zissulescu John Eric Martin * arc-opc.c (UIMM10_6_S_JLIOFF): Define. (UIMM3_23): Adjust accordingly. * arc-regs.h: Add/correct jli_base register. * arc-tbl.h (jli_s): Likewise. --- include/ChangeLog | 6 ++++++ include/elf/arc-reloc.def | 7 +++++++ include/opcode/arc-func.h | 15 ++++++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/ChangeLog b/include/ChangeLog index cecaa88..a31f62e 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,9 @@ +2017-07-19 Claudiu Zissulescu + John Eric Martin + + * elf/arc-reloc.def: Add JLI relocs howto. + * opcode/arc-func.h (replace_jli): New function. + 2017-07-18 Nick Clifton PR 21775 diff --git a/include/elf/arc-reloc.def b/include/elf/arc-reloc.def index aa2309c..c58ca96 100644 --- a/include/elf/arc-reloc.def +++ b/include/elf/arc-reloc.def @@ -414,6 +414,13 @@ ARC_RELOC_HOWTO(ARC_S25H_PCREL_PLT, 61, \ signed, \ ( ME ( ( ( ( L + A ) - P ) >> 1 ) ) )) +ARC_RELOC_HOWTO(ARC_JLI_SECTOFF, 63, \ + 1, \ + 10, \ + replace_jli, \ + bitfield, \ + ( ( S - JLI ) >> 2)) + ARC_RELOC_HOWTO(ARC_TLS_DTPMOD, 66, \ 2, \ 32, \ diff --git a/include/opcode/arc-func.h b/include/opcode/arc-func.h index c794593..fb45b07 100644 --- a/include/opcode/arc-func.h +++ b/include/opcode/arc-func.h @@ -274,8 +274,21 @@ replace_disp12s (unsigned insn, int value ATTRIBUTE_UNUSED) insn = insn & ~0xfff; insn |= ((value >> 0) & 0x003f) << 6; insn |= ((value >> 6) & 0x003f) << 0; - return insn; } #endif /* REPLACE_disp12s */ + +/* mask = 0000001111111111. */ +#ifndef REPLACE_jli +#define REPLACE_jli +ATTRIBUTE_UNUSED static unsigned +replace_jli (unsigned insn, int value) +{ + insn = insn & ~0x3ff; + insn |= ((value >> 0) & 0x03ff) << 0; + + return insn; +} + +#endif /* REPLACE_jli */ -- cgit v1.1