aboutsummaryrefslogtreecommitdiff
path: root/bfd/arc-plt.def
blob: e221dd11b4663b781f66ad25b8f413aac909d2d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/* Arc V2 Related PLT entries.
   Copyright (C) 2016-2021 Free Software Foundation, Inc.
   Contributed by Cupertino Miranda (cmiranda@synopsys.com).

   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.  */

PLT_TYPE_START (ELF_ARCV2_PIC)
  PLT_ENTRY (0x2730, 0x7f8b, 0x0000, 0x0000) /* ld %r11, [pcl,0] : 0 to be replaced by _DYNAMIC@GOTPC+4 */
  PLT_ENTRY (0x2730, 0x7f8a, 0x0000, 0x0000) /* ld %r10, [pcl,0] : 0 to be replaced by _DYNAMIC@GOTPC+8 */
  PLT_ENTRY (0x2020, 0x0280)		    /* j [%r10] */
  PLT_ENTRY (0x0,0x0,0x0,0x0,0x0,0x0)	    /* padding */

  PLT_ELEM (0x2730, 0x7f8c, 0x0000, 0x0000) /* ld %r12, [%pc,func@got] */
  PLT_ELEM (0x2021, 0x0300)		   /* j.d [%r12] */
  PLT_ELEM (0x240a, 0x1fc0)		   /* mov %r12, %pcl */

  ENTRY_RELOC (4, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 4)
  ENTRY_RELOC (12, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 8)
  ENTRY_RELOC (20, 32, 0xFFFFFFFF, SGOT, 0)

  ELEM_RELOC (4, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 0)

PLT_TYPE_END (ELF_ARCV2_PIC)

PLT_TYPE_START (ELF_ARCV2_ABS)
  PLT_ENTRY (0x1600,0x700b,0x0000,0x0000)  /* ld %r11, [0] */
  PLT_ENTRY (0x1600,0x700a,0x0000,0x0000)  /* ld %r10, [0] */
  PLT_ENTRY (0x2020,0x0280)		  /* j [%r10] */
  PLT_ENTRY (0x0,0x0,0x0,0x0,0x0,0x0)	  /* padding */

  PLT_ELEM (0x2730, 0x7f8c, 0x0000, 0x0000) /* ld %r12, [%pcl,func@gotpc] */
  PLT_ELEM (0x2021,0x0300)		   /* j.d [%r12] */
  PLT_ELEM (0x240a,0x1fc0)		   /* mov %r12, %pcl */

  ENTRY_RELOC (4, 32, 0xFFFFFFFF, SGOT | MIDDLE_ENDIAN, 4)
  ENTRY_RELOC (12, 32, 0xFFFFFFFF, SGOT | MIDDLE_ENDIAN, 8)
  ENTRY_RELOC (20, 32, 0xFFFFFFFF, SGOT, 0)

  ELEM_RELOC (4, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 0)

PLT_TYPE_END (ELF_ARCV2_ABS)


/* Non Arc V2 Related PLT entries.  */

PLT_TYPE_START (ELF_ARC_PIC)
  PLT_ENTRY (0x2730,0x7f8b,0x0000,0x0000) /* ld %r11, [pcl,0] : 0 to be replaced by _DYNAMIC@GOTPC+4 */
  PLT_ENTRY (0x2730,0x7f8a,0x0000,0x0000) /* ld %r10, [pcl,0] : 0 to be replaced by -DYNAMIC@GOTPC+8  */
  PLT_ENTRY (0x2020,0x0280)		 /* j [%r10] */
  PLT_ENTRY (0x0,0x0)			 /* padding */

  PLT_ELEM (0x2730,0x7f8c,0x0000,0x0000)  /* ld %r12, [%pc,func@got]   */
  PLT_ELEM (0x7c20)			 /* j_s.d [%r12]	      */
  PLT_ELEM (0x74ef)			 /* mov_s %r12, %pcl          */

  ENTRY_RELOC (4, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 4)
  ENTRY_RELOC (12, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 8)
  ENTRY_RELOC (20, 32, 0xFFFFFFFF, SGOT, 0)

  ELEM_RELOC (4, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 0)

PLT_TYPE_END (ELF_ARC_PIC)

PLT_TYPE_START (ELF_ARC_ABS)
  PLT_ENTRY (0x1600,0x700b,0x0000,0x0000) /* ld %r11, [0] */
  PLT_ENTRY (0x1600,0x700a,0x0000,0x0000) /* ld %r10, [0] */
  PLT_ENTRY (0x2020,0x0280)		 /* j [%r10] */
  PLT_ENTRY (0x0,0x0)			 /* padding */

  PLT_ELEM (0x2730,0x7f8c,0x0000,0x0000) /* ld %r12, [%pc,func@gotpc] */
  PLT_ELEM (0x7c20,0x74ef)		/* mov_s %r12, %pcl          */

  ENTRY_RELOC (4, 32, 0xFFFFFFFF, SGOT | MIDDLE_ENDIAN, 4)
  ENTRY_RELOC (12, 32, 0xFFFFFFFF, SGOT | MIDDLE_ENDIAN, 8)
  ENTRY_RELOC (20, 32, 0xFFFFFFFF, SGOT, 0)

  ELEM_RELOC (4, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 0)

PLT_TYPE_END (ELF_ARC_ABS)