2001-02-10 08:58:38 +08:00
|
|
|
/* 390 ELF support for BFD.
|
2015-01-01 22:15:26 +08:00
|
|
|
Copyright (C) 2000-2015 Free Software Foundation, Inc.
|
2001-02-10 08:58:38 +08:00
|
|
|
Contributed by Carl B. Pedersen and Martin Schwidefsky.
|
|
|
|
|
|
|
|
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
|
2010-04-15 18:26:09 +08:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2001-02-10 08:58:38 +08:00
|
|
|
(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
|
2005-05-10 18:21:13 +08:00
|
|
|
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
|
|
|
|
02110-1301, USA. */
|
2001-02-10 08:58:38 +08:00
|
|
|
|
|
|
|
#ifndef _ELF_390_H
|
|
|
|
#define _ELF_390_H
|
|
|
|
|
|
|
|
/* Processor specific flags for the ELF header e_flags field. */
|
|
|
|
|
|
|
|
/* Symbol types. */
|
|
|
|
|
|
|
|
#define STACK_REG 15 /* Global Stack reg */
|
|
|
|
#define BACKL_REG 14 /* Global Backlink reg */
|
|
|
|
#define BASE_REG 13 /* Global Base reg */
|
|
|
|
#define GOT_REG 12 /* Holds addr of GOT */
|
|
|
|
|
|
|
|
#include "elf/reloc-macros.h"
|
|
|
|
|
2010-01-21 19:40:28 +08:00
|
|
|
/* Processor specific flags for the ELF header e_flags field. */
|
|
|
|
|
|
|
|
#define EF_S390_HIGH_GPRS 0x00000001
|
|
|
|
|
2001-02-10 08:58:38 +08:00
|
|
|
/* Relocation types. */
|
|
|
|
|
|
|
|
START_RELOC_NUMBERS (elf_s390_reloc_type)
|
|
|
|
RELOC_NUMBER (R_390_NONE, 0) /* No reloc. */
|
|
|
|
RELOC_NUMBER (R_390_8, 1) /* Direct 8 bit. */
|
|
|
|
RELOC_NUMBER (R_390_12, 2) /* Direct 12 bit. */
|
|
|
|
RELOC_NUMBER (R_390_16, 3) /* Direct 16 bit. */
|
|
|
|
RELOC_NUMBER (R_390_32, 4) /* Direct 32 bit. */
|
|
|
|
RELOC_NUMBER (R_390_PC32, 5) /* PC relative 32 bit. */
|
|
|
|
RELOC_NUMBER (R_390_GOT12, 6) /* 12 bit GOT offset. */
|
|
|
|
RELOC_NUMBER (R_390_GOT32, 7) /* 32 bit GOT offset. */
|
|
|
|
RELOC_NUMBER (R_390_PLT32, 8) /* 32 bit PC relative PLT address. */
|
|
|
|
RELOC_NUMBER (R_390_COPY, 9) /* Copy symbol at runtime. */
|
|
|
|
RELOC_NUMBER (R_390_GLOB_DAT, 10) /* Create GOT entry. */
|
|
|
|
RELOC_NUMBER (R_390_JMP_SLOT, 11) /* Create PLT entry. */
|
|
|
|
RELOC_NUMBER (R_390_RELATIVE, 12) /* Adjust by program base. */
|
2003-01-20 19:51:38 +08:00
|
|
|
RELOC_NUMBER (R_390_GOTOFF32, 13) /* 32 bit offset to GOT. */
|
2001-02-10 08:58:38 +08:00
|
|
|
RELOC_NUMBER (R_390_GOTPC, 14) /* 32 bit PC relative offset to GOT. */
|
|
|
|
RELOC_NUMBER (R_390_GOT16, 15) /* 16 bit GOT offset. */
|
|
|
|
RELOC_NUMBER (R_390_PC16, 16) /* PC relative 16 bit. */
|
2013-07-05 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
opcodes/
* s390-opc.c (J12_12, J24_24): New macros.
(INSTR_MII_UPI): Rename to INSTR_MII_UPP.
(MASK_MII_UPI): Rename to MASK_MII_UPP.
* s390-opc.txt: Rename MII_UPI to MII_UPP for bprp instruction.
include/elf/
* s390.h: Add new relocs R_390_PC12DBL, R_390_PLT12DBL,
R_390_PC24DBL, and R_390_PLT24DBL.
gas/testsuite/
* gas/s390/zarch-zEC12.s: Change bprp second operand and add
variants requiring relocations.
* gas/s390/zarch-zEC12.d: Likewise.
gas/
* config/tc-s390.c (md_gather_operands, md_apply_fix): Support new
relocs.
bfd/
* elf32-s390.c: Add new relocation definitions R_390_PC12DBL,
R_390_PLT12DBL, R_390_PC24DBL, and R_390_PLT24DBL.
(elf_s390_reloc_type_lookup, elf_s390_check_relocs)
(elf_s390_gc_sweep_hook, elf_s390_relocate_section): Support new
relocations.
* elf64-s390.c: See elf32-s390.c
* bfd-in2.h: Add new relocs to enum bfd_reloc_code_real.
* libbfd.h: Add new reloc strings.
2013-07-05 17:45:44 +08:00
|
|
|
RELOC_NUMBER (R_390_PC12DBL, 62) /* PC relative 12 bit shifted by 1. */
|
|
|
|
RELOC_NUMBER (R_390_PLT12DBL, 63) /* 12 bit PC rel. PLT shifted by 1. */
|
2001-02-10 08:58:38 +08:00
|
|
|
RELOC_NUMBER (R_390_PC16DBL, 17) /* PC relative 16 bit shifted by 1. */
|
|
|
|
RELOC_NUMBER (R_390_PLT16DBL, 18) /* 16 bit PC rel. PLT shifted by 1. */
|
2013-07-05 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
opcodes/
* s390-opc.c (J12_12, J24_24): New macros.
(INSTR_MII_UPI): Rename to INSTR_MII_UPP.
(MASK_MII_UPI): Rename to MASK_MII_UPP.
* s390-opc.txt: Rename MII_UPI to MII_UPP for bprp instruction.
include/elf/
* s390.h: Add new relocs R_390_PC12DBL, R_390_PLT12DBL,
R_390_PC24DBL, and R_390_PLT24DBL.
gas/testsuite/
* gas/s390/zarch-zEC12.s: Change bprp second operand and add
variants requiring relocations.
* gas/s390/zarch-zEC12.d: Likewise.
gas/
* config/tc-s390.c (md_gather_operands, md_apply_fix): Support new
relocs.
bfd/
* elf32-s390.c: Add new relocation definitions R_390_PC12DBL,
R_390_PLT12DBL, R_390_PC24DBL, and R_390_PLT24DBL.
(elf_s390_reloc_type_lookup, elf_s390_check_relocs)
(elf_s390_gc_sweep_hook, elf_s390_relocate_section): Support new
relocations.
* elf64-s390.c: See elf32-s390.c
* bfd-in2.h: Add new relocs to enum bfd_reloc_code_real.
* libbfd.h: Add new reloc strings.
2013-07-05 17:45:44 +08:00
|
|
|
RELOC_NUMBER (R_390_PC24DBL, 64) /* PC relative 24 bit shifted by 1. */
|
|
|
|
RELOC_NUMBER (R_390_PLT24DBL, 65) /* 24 bit PC rel. PLT shifted by 1. */
|
2001-02-10 08:58:38 +08:00
|
|
|
RELOC_NUMBER (R_390_PC32DBL, 19) /* PC relative 32 bit shifted by 1. */
|
|
|
|
RELOC_NUMBER (R_390_PLT32DBL, 20) /* 32 bit PC rel. PLT shifted by 1. */
|
|
|
|
RELOC_NUMBER (R_390_GOTPCDBL, 21) /* 32 bit PC rel. GOT shifted by 1. */
|
|
|
|
RELOC_NUMBER (R_390_64, 22) /* Direct 64 bit. */
|
|
|
|
RELOC_NUMBER (R_390_PC64, 23) /* PC relative 64 bit. */
|
|
|
|
RELOC_NUMBER (R_390_GOT64, 24) /* 64 bit GOT offset. */
|
|
|
|
RELOC_NUMBER (R_390_PLT64, 25) /* 64 bit PC relative PLT address. */
|
|
|
|
RELOC_NUMBER (R_390_GOTENT, 26) /* 32 bit PC rel. to GOT entry >> 1. */
|
2003-01-20 19:51:38 +08:00
|
|
|
RELOC_NUMBER (R_390_GOTOFF16, 27) /* 16 bit offset to GOT. */
|
|
|
|
RELOC_NUMBER (R_390_GOTOFF64, 28) /* 64 bit offset to GOT. */
|
|
|
|
RELOC_NUMBER (R_390_GOTPLT12, 29) /* 12 bit offset to jump slot. */
|
|
|
|
RELOC_NUMBER (R_390_GOTPLT16, 30) /* 16 bit offset to jump slot. */
|
|
|
|
RELOC_NUMBER (R_390_GOTPLT32, 31) /* 32 bit offset to jump slot. */
|
|
|
|
RELOC_NUMBER (R_390_GOTPLT64, 32) /* 64 bit offset to jump slot. */
|
|
|
|
RELOC_NUMBER (R_390_GOTPLTENT, 33) /* 32 bit rel. offset to jump slot. */
|
|
|
|
RELOC_NUMBER (R_390_PLTOFF16, 34) /* 16 bit offset from GOT to PLT. */
|
|
|
|
RELOC_NUMBER (R_390_PLTOFF32, 35) /* 32 bit offset from GOT to PLT. */
|
|
|
|
RELOC_NUMBER (R_390_PLTOFF64, 36) /* 16 bit offset from GOT to PLT. */
|
2003-01-25 01:15:29 +08:00
|
|
|
RELOC_NUMBER (R_390_TLS_LOAD, 37) /* Tag for load insn in TLS code. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_GDCALL, 38) /* Tag for function call in general
|
|
|
|
dynamic TLS code. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_LDCALL, 39) /* Tag for function call in local
|
|
|
|
dynamic TLS code. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_GD32, 40) /* Direct 32 bit for general dynamic
|
|
|
|
thread local data. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_GD64, 41) /* Direct 64 bit for general dynamic
|
|
|
|
thread local data. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_GOTIE12, 42)/* 12 bit GOT offset for static TLS
|
|
|
|
block offset. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_GOTIE32, 43)/* 32 bit GOT offset for static TLS
|
|
|
|
block offset. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_GOTIE64, 44)/* 64 bit GOT offset for static TLS
|
|
|
|
block offset. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_LDM32, 45) /* Direct 32 bit for local dynamic
|
|
|
|
thread local data in LD code. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_LDM64, 46) /* Direct 64 bit for local dynamic
|
|
|
|
thread local data in LD code. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_IE32, 47) /* 32 bit address of GOT entry for
|
|
|
|
negated static TLS block offset. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_IE64, 48) /* 64 bit address of GOT entry for
|
|
|
|
negated static TLS block offset. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_IEENT, 49) /* 32 bit rel. offset to GOT entry for
|
|
|
|
negated static TLS block offset. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_LE32, 50) /* 32 bit negated offset relative to
|
|
|
|
static TLS block. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_LE64, 51) /* 64 bit negated offset relative to
|
|
|
|
static TLS block. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_LDO32, 52) /* 32 bit offset relative to TLS
|
|
|
|
block. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_LDO64, 53) /* 64 bit offset relative to TLS
|
|
|
|
block. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_DTPMOD, 54) /* ID of module containing symbol. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_DTPOFF, 55) /* Offset in TLS block. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_TPOFF, 56) /* Negate offset in static TLS
|
|
|
|
block. */
|
2003-07-01 22:46:26 +08:00
|
|
|
RELOC_NUMBER (R_390_20, 57) /* Direct 20 bit. */
|
|
|
|
RELOC_NUMBER (R_390_GOT20, 58) /* 20 bit GOT offset. */
|
|
|
|
RELOC_NUMBER (R_390_GOTPLT20, 59) /* 20 bit offset to jump slot. */
|
|
|
|
RELOC_NUMBER (R_390_TLS_GOTIE20, 60)/* 20 bit GOT offset for statis TLS
|
|
|
|
block offset. */
|
2012-07-13 23:47:27 +08:00
|
|
|
RELOC_NUMBER (R_390_IRELATIVE, 61) /* IFUNC relocation. */
|
2001-02-10 08:58:38 +08:00
|
|
|
/* These are GNU extensions to enable C++ vtable garbage collection. */
|
|
|
|
RELOC_NUMBER (R_390_GNU_VTINHERIT, 250)
|
|
|
|
RELOC_NUMBER (R_390_GNU_VTENTRY, 251)
|
|
|
|
END_RELOC_NUMBERS (R_390_max)
|
|
|
|
|
2015-04-27 16:32:23 +08:00
|
|
|
/* Object attribute tags. */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
/* 0-3 are generic. */
|
|
|
|
/* 4 is reserved for the FP ABI. */
|
|
|
|
|
|
|
|
/* Vector ABI:
|
|
|
|
0 = not affected by the vector ABI, or not tagged.
|
|
|
|
1 = software vector ABI being used
|
|
|
|
2 = hardware vector ABI being used. */
|
|
|
|
Tag_GNU_S390_ABI_Vector = 8,
|
|
|
|
};
|
2001-02-10 08:58:38 +08:00
|
|
|
|
2015-04-27 16:32:23 +08:00
|
|
|
#endif /* _ELF_390_H */
|