Home | History | Annotate | Line # | Download | only in elf
s390.h revision 1.1.1.8
      1      1.1  christos /* 390 ELF support for BFD.
      2  1.1.1.8  christos    Copyright (C) 2000-2019 Free Software Foundation, Inc.
      3      1.1  christos    Contributed by Carl B. Pedersen and Martin Schwidefsky.
      4      1.1  christos 
      5      1.1  christos    This file is part of BFD, the Binary File Descriptor library.
      6      1.1  christos 
      7      1.1  christos    This program is free software; you can redistribute it and/or modify
      8      1.1  christos    it under the terms of the GNU General Public License as published by
      9      1.1  christos    the Free Software Foundation; either version 3 of the License, or
     10      1.1  christos    (at your option) any later version.
     11      1.1  christos 
     12      1.1  christos    This program is distributed in the hope that it will be useful,
     13      1.1  christos    but WITHOUT ANY WARRANTY; without even the implied warranty of
     14      1.1  christos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15      1.1  christos    GNU General Public License for more details.
     16      1.1  christos 
     17      1.1  christos    You should have received a copy of the GNU General Public License
     18      1.1  christos    along with this program; if not, write to the Free Software
     19      1.1  christos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
     20      1.1  christos    02110-1301, USA.  */
     21      1.1  christos 
     22      1.1  christos #ifndef _ELF_390_H
     23      1.1  christos #define _ELF_390_H
     24      1.1  christos 
     25      1.1  christos /* Processor specific flags for the ELF header e_flags field.  */
     26      1.1  christos 
     27      1.1  christos /* Symbol types.  */
     28      1.1  christos 
     29      1.1  christos #define STACK_REG		15		/* Global Stack reg */
     30      1.1  christos #define BACKL_REG		14		/* Global Backlink reg */
     31      1.1  christos #define BASE_REG		13		/* Global Base reg */
     32      1.1  christos #define GOT_REG 		12		/* Holds addr of GOT */
     33      1.1  christos 
     34      1.1  christos #include "elf/reloc-macros.h"
     35      1.1  christos 
     36      1.1  christos /* Processor specific flags for the ELF header e_flags field.  */
     37      1.1  christos 
     38      1.1  christos #define EF_S390_HIGH_GPRS        0x00000001
     39      1.1  christos 
     40  1.1.1.8  christos /* Request 4k page table size.  */
     41  1.1.1.8  christos #define PT_S390_PGSTE (PT_LOPROC + 0)
     42  1.1.1.8  christos 
     43      1.1  christos /* Relocation types.  */
     44      1.1  christos 
     45      1.1  christos START_RELOC_NUMBERS (elf_s390_reloc_type)
     46      1.1  christos     RELOC_NUMBER (R_390_NONE, 0)	/* No reloc.  */
     47      1.1  christos     RELOC_NUMBER (R_390_8, 1)		/* Direct 8 bit.  */
     48      1.1  christos     RELOC_NUMBER (R_390_12, 2)		/* Direct 12 bit.  */
     49      1.1  christos     RELOC_NUMBER (R_390_16, 3)		/* Direct 16 bit.  */
     50      1.1  christos     RELOC_NUMBER (R_390_32, 4)		/* Direct 32 bit.  */
     51      1.1  christos     RELOC_NUMBER (R_390_PC32, 5)	/* PC relative 32 bit.  */
     52      1.1  christos     RELOC_NUMBER (R_390_GOT12, 6)	/* 12 bit GOT offset.  */
     53      1.1  christos     RELOC_NUMBER (R_390_GOT32, 7)	/* 32 bit GOT offset.  */
     54      1.1  christos     RELOC_NUMBER (R_390_PLT32, 8)	/* 32 bit PC relative PLT address.  */
     55      1.1  christos     RELOC_NUMBER (R_390_COPY, 9)	/* Copy symbol at runtime.  */
     56      1.1  christos     RELOC_NUMBER (R_390_GLOB_DAT, 10)	/* Create GOT entry.  */
     57      1.1  christos     RELOC_NUMBER (R_390_JMP_SLOT, 11)	/* Create PLT entry.  */
     58      1.1  christos     RELOC_NUMBER (R_390_RELATIVE, 12)	/* Adjust by program base.  */
     59      1.1  christos     RELOC_NUMBER (R_390_GOTOFF32, 13)	/* 32 bit offset to GOT.  */
     60      1.1  christos     RELOC_NUMBER (R_390_GOTPC, 14)	/* 32 bit PC relative offset to GOT.  */
     61      1.1  christos     RELOC_NUMBER (R_390_GOT16, 15)	/* 16 bit GOT offset.  */
     62      1.1  christos     RELOC_NUMBER (R_390_PC16, 16)	/* PC relative 16 bit.  */
     63  1.1.1.3  christos     RELOC_NUMBER (R_390_PC12DBL, 62)	/* PC relative 12 bit shifted by 1.  */
     64  1.1.1.3  christos     RELOC_NUMBER (R_390_PLT12DBL, 63)	/* 12 bit PC rel. PLT shifted by 1.  */
     65      1.1  christos     RELOC_NUMBER (R_390_PC16DBL, 17)	/* PC relative 16 bit shifted by 1.  */
     66      1.1  christos     RELOC_NUMBER (R_390_PLT16DBL, 18)	/* 16 bit PC rel. PLT shifted by 1.  */
     67  1.1.1.3  christos     RELOC_NUMBER (R_390_PC24DBL, 64)	/* PC relative 24 bit shifted by 1.  */
     68  1.1.1.3  christos     RELOC_NUMBER (R_390_PLT24DBL, 65)	/* 24 bit PC rel. PLT shifted by 1.  */
     69      1.1  christos     RELOC_NUMBER (R_390_PC32DBL, 19)	/* PC relative 32 bit shifted by 1.  */
     70      1.1  christos     RELOC_NUMBER (R_390_PLT32DBL, 20)	/* 32 bit PC rel. PLT shifted by 1.  */
     71      1.1  christos     RELOC_NUMBER (R_390_GOTPCDBL, 21)	/* 32 bit PC rel. GOT shifted by 1.  */
     72      1.1  christos     RELOC_NUMBER (R_390_64, 22)		/* Direct 64 bit.  */
     73      1.1  christos     RELOC_NUMBER (R_390_PC64, 23)	/* PC relative 64 bit.  */
     74      1.1  christos     RELOC_NUMBER (R_390_GOT64, 24)	/* 64 bit GOT offset.  */
     75      1.1  christos     RELOC_NUMBER (R_390_PLT64, 25)	/* 64 bit PC relative PLT address.  */
     76      1.1  christos     RELOC_NUMBER (R_390_GOTENT, 26)	/* 32 bit PC rel. to GOT entry >> 1. */
     77      1.1  christos     RELOC_NUMBER (R_390_GOTOFF16, 27)   /* 16 bit offset to GOT. */
     78      1.1  christos     RELOC_NUMBER (R_390_GOTOFF64, 28)   /* 64 bit offset to GOT. */
     79      1.1  christos     RELOC_NUMBER (R_390_GOTPLT12, 29)   /* 12 bit offset to jump slot.  */
     80      1.1  christos     RELOC_NUMBER (R_390_GOTPLT16, 30)   /* 16 bit offset to jump slot.  */
     81      1.1  christos     RELOC_NUMBER (R_390_GOTPLT32, 31)   /* 32 bit offset to jump slot.  */
     82      1.1  christos     RELOC_NUMBER (R_390_GOTPLT64, 32)   /* 64 bit offset to jump slot.  */
     83      1.1  christos     RELOC_NUMBER (R_390_GOTPLTENT, 33)  /* 32 bit rel. offset to jump slot.  */
     84      1.1  christos     RELOC_NUMBER (R_390_PLTOFF16, 34)   /* 16 bit offset from GOT to PLT. */
     85      1.1  christos     RELOC_NUMBER (R_390_PLTOFF32, 35)   /* 32 bit offset from GOT to PLT. */
     86      1.1  christos     RELOC_NUMBER (R_390_PLTOFF64, 36)   /* 16 bit offset from GOT to PLT. */
     87      1.1  christos     RELOC_NUMBER (R_390_TLS_LOAD, 37)	/* Tag for load insn in TLS code. */
     88      1.1  christos     RELOC_NUMBER (R_390_TLS_GDCALL, 38)	/* Tag for function call in general
     89      1.1  christos 					   dynamic TLS code.  */
     90      1.1  christos     RELOC_NUMBER (R_390_TLS_LDCALL, 39)	/* Tag for function call in local
     91      1.1  christos 					   dynamic TLS code.  */
     92      1.1  christos     RELOC_NUMBER (R_390_TLS_GD32, 40)	/* Direct 32 bit for general dynamic
     93      1.1  christos 					   thread local data.  */
     94      1.1  christos     RELOC_NUMBER (R_390_TLS_GD64, 41)	/* Direct 64 bit for general dynamic
     95      1.1  christos 					   thread local data.  */
     96      1.1  christos     RELOC_NUMBER (R_390_TLS_GOTIE12, 42)/* 12 bit GOT offset for static TLS
     97      1.1  christos 					   block offset.  */
     98      1.1  christos     RELOC_NUMBER (R_390_TLS_GOTIE32, 43)/* 32 bit GOT offset for static TLS
     99      1.1  christos 					   block offset.  */
    100      1.1  christos     RELOC_NUMBER (R_390_TLS_GOTIE64, 44)/* 64 bit GOT offset for static TLS
    101      1.1  christos 					   block offset.  */
    102      1.1  christos     RELOC_NUMBER (R_390_TLS_LDM32, 45)	/* Direct 32 bit for local dynamic
    103      1.1  christos 					   thread local data in LD code.  */
    104      1.1  christos     RELOC_NUMBER (R_390_TLS_LDM64, 46)	/* Direct 64 bit for local dynamic
    105      1.1  christos 					   thread local data in LD code.  */
    106      1.1  christos     RELOC_NUMBER (R_390_TLS_IE32, 47)	/* 32 bit address of GOT entry for
    107      1.1  christos 					   negated static TLS block offset.  */
    108      1.1  christos     RELOC_NUMBER (R_390_TLS_IE64, 48)	/* 64 bit address of GOT entry for
    109      1.1  christos 					   negated static TLS block offset.  */
    110      1.1  christos     RELOC_NUMBER (R_390_TLS_IEENT, 49)	/* 32 bit rel. offset to GOT entry for
    111      1.1  christos 					   negated static TLS block offset.  */
    112      1.1  christos     RELOC_NUMBER (R_390_TLS_LE32, 50)	/* 32 bit negated offset relative to
    113      1.1  christos 					   static TLS block.  */
    114      1.1  christos     RELOC_NUMBER (R_390_TLS_LE64, 51)	/* 64 bit negated offset relative to
    115      1.1  christos 					   static TLS block.  */
    116      1.1  christos     RELOC_NUMBER (R_390_TLS_LDO32, 52)	/* 32 bit offset relative to TLS
    117      1.1  christos 					   block.  */
    118      1.1  christos     RELOC_NUMBER (R_390_TLS_LDO64, 53)	/* 64 bit offset relative to TLS
    119      1.1  christos 					   block.  */
    120      1.1  christos     RELOC_NUMBER (R_390_TLS_DTPMOD, 54)	/* ID of module containing symbol.  */
    121      1.1  christos     RELOC_NUMBER (R_390_TLS_DTPOFF, 55)	/* Offset in TLS block.  */
    122      1.1  christos     RELOC_NUMBER (R_390_TLS_TPOFF, 56)	/* Negate offset in static TLS
    123      1.1  christos 					   block.  */
    124      1.1  christos     RELOC_NUMBER (R_390_20, 57)		/* Direct 20 bit.  */
    125      1.1  christos     RELOC_NUMBER (R_390_GOT20, 58)	/* 20 bit GOT offset.  */
    126      1.1  christos     RELOC_NUMBER (R_390_GOTPLT20, 59)	/* 20 bit offset to jump slot.  */
    127      1.1  christos     RELOC_NUMBER (R_390_TLS_GOTIE20, 60)/* 20 bit GOT offset for statis TLS
    128      1.1  christos 					   block offset.  */
    129  1.1.1.2  christos     RELOC_NUMBER (R_390_IRELATIVE, 61)  /* IFUNC relocation.  */
    130      1.1  christos     /* These are GNU extensions to enable C++ vtable garbage collection.  */
    131      1.1  christos     RELOC_NUMBER (R_390_GNU_VTINHERIT, 250)
    132      1.1  christos     RELOC_NUMBER (R_390_GNU_VTENTRY, 251)
    133      1.1  christos END_RELOC_NUMBERS (R_390_max)
    134      1.1  christos 
    135  1.1.1.5  christos /* Object attribute tags.  */
    136  1.1.1.5  christos enum
    137  1.1.1.5  christos {
    138  1.1.1.5  christos   /* 0-3 are generic. */
    139  1.1.1.5  christos   /* 4 is reserved for the FP ABI. */
    140      1.1  christos 
    141  1.1.1.5  christos   /* Vector ABI:
    142  1.1.1.5  christos      0 = not affected by the vector ABI, or not tagged.
    143  1.1.1.5  christos      1 = software vector ABI being used
    144  1.1.1.5  christos      2 = hardware vector ABI being used.  */
    145  1.1.1.5  christos   Tag_GNU_S390_ABI_Vector = 8,
    146  1.1.1.5  christos };
    147      1.1  christos 
    148  1.1.1.5  christos #endif /* _ELF_390_H */
    149