Home | History | Annotate | Line # | Download | only in bfd
      1 /* Arc V2 Related PLT entries.
      2    Copyright (C) 2016-2025 Free Software Foundation, Inc.
      3    Contributed by Cupertino Miranda (cmiranda (at) synopsys.com).
      4 
      5    This file is part of BFD, the Binary File Descriptor library.
      6 
      7    This program is free software; you can redistribute it and/or modify
      8    it under the terms of the GNU General Public License as published by
      9    the Free Software Foundation; either version 3 of the License, or
     10    (at your option) any later version.
     11 
     12    This program is distributed in the hope that it will be useful,
     13    but WITHOUT ANY WARRANTY; without even the implied warranty of
     14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15    GNU General Public License for more details.
     16 
     17    You should have received a copy of the GNU General Public License
     18    along with this program; if not, write to the Free Software
     19    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
     20    MA 02110-1301, USA.  */
     21 
     22 PLT_TYPE_START (ELF_ARCV2_PIC)
     23   PLT_ENTRY (0x2730, 0x7f8b, 0x0000, 0x0000) /* ld %r11, [pcl,0] : 0 to be replaced by _DYNAMIC@GOTPC+4 */
     24   PLT_ENTRY (0x2730, 0x7f8a, 0x0000, 0x0000) /* ld %r10, [pcl,0] : 0 to be replaced by _DYNAMIC@GOTPC+8 */
     25   PLT_ENTRY (0x2020, 0x0280)		    /* j [%r10] */
     26   PLT_ENTRY (0x0,0x0,0x0,0x0,0x0,0x0)	    /* padding */
     27 
     28   PLT_ELEM (0x2730, 0x7f8c, 0x0000, 0x0000) /* ld %r12, [%pc,func@got] */
     29   PLT_ELEM (0x2021, 0x0300)		   /* j.d [%r12] */
     30   PLT_ELEM (0x240a, 0x1fc0)		   /* mov %r12, %pcl */
     31 
     32   ENTRY_RELOC (4, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 4)
     33   ENTRY_RELOC (12, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 8)
     34   ENTRY_RELOC (20, 32, 0xFFFFFFFF, SGOT, 0)
     35 
     36   ELEM_RELOC (4, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 0)
     37 
     38 PLT_TYPE_END (ELF_ARCV2_PIC)
     39 
     40 PLT_TYPE_START (ELF_ARCV2_ABS)
     41   PLT_ENTRY (0x1600,0x700b,0x0000,0x0000)  /* ld %r11, [0] */
     42   PLT_ENTRY (0x1600,0x700a,0x0000,0x0000)  /* ld %r10, [0] */
     43   PLT_ENTRY (0x2020,0x0280)		  /* j [%r10] */
     44   PLT_ENTRY (0x0,0x0,0x0,0x0,0x0,0x0)	  /* padding */
     45 
     46   PLT_ELEM (0x2730, 0x7f8c, 0x0000, 0x0000) /* ld %r12, [%pcl,func@gotpc] */
     47   PLT_ELEM (0x2021,0x0300)		   /* j.d [%r12] */
     48   PLT_ELEM (0x240a,0x1fc0)		   /* mov %r12, %pcl */
     49 
     50   ENTRY_RELOC (4, 32, 0xFFFFFFFF, SGOT | MIDDLE_ENDIAN, 4)
     51   ENTRY_RELOC (12, 32, 0xFFFFFFFF, SGOT | MIDDLE_ENDIAN, 8)
     52   ENTRY_RELOC (20, 32, 0xFFFFFFFF, SGOT, 0)
     53 
     54   ELEM_RELOC (4, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 0)
     55 
     56 PLT_TYPE_END (ELF_ARCV2_ABS)
     57 
     58 
     59 /* Non Arc V2 Related PLT entries.  */
     60 
     61 PLT_TYPE_START (ELF_ARC_PIC)
     62   PLT_ENTRY (0x2730,0x7f8b,0x0000,0x0000) /* ld %r11, [pcl,0] : 0 to be replaced by _DYNAMIC@GOTPC+4 */
     63   PLT_ENTRY (0x2730,0x7f8a,0x0000,0x0000) /* ld %r10, [pcl,0] : 0 to be replaced by -DYNAMIC@GOTPC+8  */
     64   PLT_ENTRY (0x2020,0x0280)		 /* j [%r10] */
     65   PLT_ENTRY (0x0,0x0)			 /* padding */
     66 
     67   PLT_ELEM (0x2730,0x7f8c,0x0000,0x0000)  /* ld %r12, [%pc,func@got]   */
     68   PLT_ELEM (0x7c20)			 /* j_s.d [%r12]	      */
     69   PLT_ELEM (0x74ef)			 /* mov_s %r12, %pcl          */
     70 
     71   ENTRY_RELOC (4, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 4)
     72   ENTRY_RELOC (12, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 8)
     73   ENTRY_RELOC (20, 32, 0xFFFFFFFF, SGOT, 0)
     74 
     75   ELEM_RELOC (4, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 0)
     76 
     77 PLT_TYPE_END (ELF_ARC_PIC)
     78 
     79 PLT_TYPE_START (ELF_ARC_ABS)
     80   PLT_ENTRY (0x1600,0x700b,0x0000,0x0000) /* ld %r11, [0] */
     81   PLT_ENTRY (0x1600,0x700a,0x0000,0x0000) /* ld %r10, [0] */
     82   PLT_ENTRY (0x2020,0x0280)		 /* j [%r10] */
     83   PLT_ENTRY (0x0,0x0)			 /* padding */
     84 
     85   PLT_ELEM (0x2730,0x7f8c,0x0000,0x0000) /* ld %r12, [%pc,func@gotpc] */
     86   PLT_ELEM (0x7c20,0x74ef)		/* mov_s %r12, %pcl          */
     87 
     88   ENTRY_RELOC (4, 32, 0xFFFFFFFF, SGOT | MIDDLE_ENDIAN, 4)
     89   ENTRY_RELOC (12, 32, 0xFFFFFFFF, SGOT | MIDDLE_ENDIAN, 8)
     90   ENTRY_RELOC (20, 32, 0xFFFFFFFF, SGOT, 0)
     91 
     92   ELEM_RELOC (4, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 0)
     93 
     94 PLT_TYPE_END (ELF_ARC_ABS)
     95