| 1 |
/* |
| 2 |
* ELF constants and data structures |
| 3 |
* |
| 4 |
* Derived from: |
| 5 |
* $FreeBSD: src/sys/sys/elf32.h,v 1.8.14.1 2005/12/30 22:13:58 marcel Exp $ |
| 6 |
* $FreeBSD: src/sys/sys/elf64.h,v 1.10.14.1 2005/12/30 22:13:58 marcel Exp $ |
| 7 |
* $FreeBSD: src/sys/sys/elf_common.h,v 1.15.8.1 2005/12/30 22:13:58 marcel Exp $ |
| 8 |
* $FreeBSD: src/sys/alpha/include/elf.h,v 1.14 2003/09/25 01:10:22 peter Exp $ |
| 9 |
* $FreeBSD: src/sys/amd64/include/elf.h,v 1.18 2004/08/03 08:21:48 dfr Exp $ |
| 10 |
* $FreeBSD: src/sys/arm/include/elf.h,v 1.5.2.1 2006/06/30 21:42:52 cognet Exp $ |
| 11 |
* $FreeBSD: src/sys/i386/include/elf.h,v 1.16 2004/08/02 19:12:17 dfr Exp $ |
| 12 |
* $FreeBSD: src/sys/powerpc/include/elf.h,v 1.7 2004/11/02 09:47:01 ssouhlal Exp $ |
| 13 |
* $FreeBSD: src/sys/sparc64/include/elf.h,v 1.12 2003/09/25 01:10:26 peter Exp $ |
| 14 |
* "System V ABI" (http://www.sco.com/developers/gabi/latest/ch4.eheader.html) |
| 15 |
* "ELF for the ARM® 64-bit Architecture (AArch64)" (ARM IHI 0056B) |
| 16 |
* "RISC-V ELF psABI specification" (https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc) |
| 17 |
* llvm/BinaryFormat/ELF.h - ELF constants and structures |
| 18 |
* |
| 19 |
* Copyright (c) 1996-1998 John D. Polstra. All rights reserved. |
| 20 |
* Copyright (c) 2001 David E. O'Brien |
| 21 |
* Portions Copyright 2009 The Go Authors. All rights reserved. |
| 22 |
* |
| 23 |
* Redistribution and use in source and binary forms, with or without |
| 24 |
* modification, are permitted provided that the following conditions |
| 25 |
* are met: |
| 26 |
* 1. Redistributions of source code must retain the above copyright |
| 27 |
* notice, this list of conditions and the following disclaimer. |
| 28 |
* 2. Redistributions in binary form must reproduce the above copyright |
| 29 |
* notice, this list of conditions and the following disclaimer in the |
| 30 |
* documentation and/or other materials provided with the distribution. |
| 31 |
* |
| 32 |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
| 33 |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 34 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 35 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
| 36 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 37 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 38 |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 39 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 40 |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 41 |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 42 |
* SUCH DAMAGE. |
| 43 |
*/ |
| 44 |
|
| 45 |
package elf |
| 46 |
|
| 47 |
import "strconv" |
| 48 |
|
| 49 |
/* |
| 50 |
* Constants |
| 51 |
*/ |
| 52 |
|
| 53 |
// Indexes into the Header.Ident array. |
| 54 |
const ( |
| 55 |
EI_CLASS = 4 /* Class of machine. */ |
| 56 |
EI_DATA = 5 /* Data format. */ |
| 57 |
EI_VERSION = 6 /* ELF format version. */ |
| 58 |
EI_OSABI = 7 /* Operating system / ABI identification */ |
| 59 |
EI_ABIVERSION = 8 /* ABI version */ |
| 60 |
EI_PAD = 9 /* Start of padding (per SVR4 ABI). */ |
| 61 |
EI_NIDENT = 16 /* Size of e_ident array. */ |
| 62 |
) |
| 63 |
|
| 64 |
// Initial magic number for ELF files. |
| 65 |
const ELFMAG = "\177ELF" |
| 66 |
|
| 67 |
// Version is found in Header.Ident[EI_VERSION] and Header.Version. |
| 68 |
type Version byte |
| 69 |
|
| 70 |
const ( |
| 71 |
EV_NONE Version = 0 |
| 72 |
EV_CURRENT Version = 1 |
| 73 |
) |
| 74 |
|
| 75 |
var versionStrings = []intName{ |
| 76 |
{0, "EV_NONE"}, |
| 77 |
{1, "EV_CURRENT"}, |
| 78 |
} |
| 79 |
|
| 80 |
func (i Version) String() string { return stringName(uint32(i), versionStrings, false) } |
| 81 |
func (i Version) GoString() string { return stringName(uint32(i), versionStrings, true) } |
| 82 |
|
| 83 |
// Class is found in Header.Ident[EI_CLASS] and Header.Class. |
| 84 |
type Class byte |
| 85 |
|
| 86 |
const ( |
| 87 |
ELFCLASSNONE Class = 0 /* Unknown class. */ |
| 88 |
ELFCLASS32 Class = 1 /* 32-bit architecture. */ |
| 89 |
ELFCLASS64 Class = 2 /* 64-bit architecture. */ |
| 90 |
) |
| 91 |
|
| 92 |
var classStrings = []intName{ |
| 93 |
{0, "ELFCLASSNONE"}, |
| 94 |
{1, "ELFCLASS32"}, |
| 95 |
{2, "ELFCLASS64"}, |
| 96 |
} |
| 97 |
|
| 98 |
func (i Class) String() string { return stringName(uint32(i), classStrings, false) } |
| 99 |
func (i Class) GoString() string { return stringName(uint32(i), classStrings, true) } |
| 100 |
|
| 101 |
// Data is found in Header.Ident[EI_DATA] and Header.Data. |
| 102 |
type Data byte |
| 103 |
|
| 104 |
const ( |
| 105 |
ELFDATANONE Data = 0 /* Unknown data format. */ |
| 106 |
ELFDATA2LSB Data = 1 /* 2's complement little-endian. */ |
| 107 |
ELFDATA2MSB Data = 2 /* 2's complement big-endian. */ |
| 108 |
) |
| 109 |
|
| 110 |
var dataStrings = []intName{ |
| 111 |
{0, "ELFDATANONE"}, |
| 112 |
{1, "ELFDATA2LSB"}, |
| 113 |
{2, "ELFDATA2MSB"}, |
| 114 |
} |
| 115 |
|
| 116 |
func (i Data) String() string { return stringName(uint32(i), dataStrings, false) } |
| 117 |
func (i Data) GoString() string { return stringName(uint32(i), dataStrings, true) } |
| 118 |
|
| 119 |
// OSABI is found in Header.Ident[EI_OSABI] and Header.OSABI. |
| 120 |
type OSABI byte |
| 121 |
|
| 122 |
const ( |
| 123 |
ELFOSABI_NONE OSABI = 0 /* UNIX System V ABI */ |
| 124 |
ELFOSABI_HPUX OSABI = 1 /* HP-UX operating system */ |
| 125 |
ELFOSABI_NETBSD OSABI = 2 /* NetBSD */ |
| 126 |
ELFOSABI_LINUX OSABI = 3 /* Linux */ |
| 127 |
ELFOSABI_HURD OSABI = 4 /* Hurd */ |
| 128 |
ELFOSABI_86OPEN OSABI = 5 /* 86Open common IA32 ABI */ |
| 129 |
ELFOSABI_SOLARIS OSABI = 6 /* Solaris */ |
| 130 |
ELFOSABI_AIX OSABI = 7 /* AIX */ |
| 131 |
ELFOSABI_IRIX OSABI = 8 /* IRIX */ |
| 132 |
ELFOSABI_FREEBSD OSABI = 9 /* FreeBSD */ |
| 133 |
ELFOSABI_TRU64 OSABI = 10 /* TRU64 UNIX */ |
| 134 |
ELFOSABI_MODESTO OSABI = 11 /* Novell Modesto */ |
| 135 |
ELFOSABI_OPENBSD OSABI = 12 /* OpenBSD */ |
| 136 |
ELFOSABI_OPENVMS OSABI = 13 /* Open VMS */ |
| 137 |
ELFOSABI_NSK OSABI = 14 /* HP Non-Stop Kernel */ |
| 138 |
ELFOSABI_AROS OSABI = 15 /* Amiga Research OS */ |
| 139 |
ELFOSABI_FENIXOS OSABI = 16 /* The FenixOS highly scalable multi-core OS */ |
| 140 |
ELFOSABI_CLOUDABI OSABI = 17 /* Nuxi CloudABI */ |
| 141 |
ELFOSABI_ARM OSABI = 97 /* ARM */ |
| 142 |
ELFOSABI_STANDALONE OSABI = 255 /* Standalone (embedded) application */ |
| 143 |
) |
| 144 |
|
| 145 |
var osabiStrings = []intName{ |
| 146 |
{0, "ELFOSABI_NONE"}, |
| 147 |
{1, "ELFOSABI_HPUX"}, |
| 148 |
{2, "ELFOSABI_NETBSD"}, |
| 149 |
{3, "ELFOSABI_LINUX"}, |
| 150 |
{4, "ELFOSABI_HURD"}, |
| 151 |
{5, "ELFOSABI_86OPEN"}, |
| 152 |
{6, "ELFOSABI_SOLARIS"}, |
| 153 |
{7, "ELFOSABI_AIX"}, |
| 154 |
{8, "ELFOSABI_IRIX"}, |
| 155 |
{9, "ELFOSABI_FREEBSD"}, |
| 156 |
{10, "ELFOSABI_TRU64"}, |
| 157 |
{11, "ELFOSABI_MODESTO"}, |
| 158 |
{12, "ELFOSABI_OPENBSD"}, |
| 159 |
{13, "ELFOSABI_OPENVMS"}, |
| 160 |
{14, "ELFOSABI_NSK"}, |
| 161 |
{15, "ELFOSABI_AROS"}, |
| 162 |
{16, "ELFOSABI_FENIXOS"}, |
| 163 |
{17, "ELFOSABI_CLOUDABI"}, |
| 164 |
{97, "ELFOSABI_ARM"}, |
| 165 |
{255, "ELFOSABI_STANDALONE"}, |
| 166 |
} |
| 167 |
|
| 168 |
func (i OSABI) String() string { return stringName(uint32(i), osabiStrings, false) } |
| 169 |
func (i OSABI) GoString() string { return stringName(uint32(i), osabiStrings, true) } |
| 170 |
|
| 171 |
// Type is found in Header.Type. |
| 172 |
type Type uint16 |
| 173 |
|
| 174 |
const ( |
| 175 |
ET_NONE Type = 0 /* Unknown type. */ |
| 176 |
ET_REL Type = 1 /* Relocatable. */ |
| 177 |
ET_EXEC Type = 2 /* Executable. */ |
| 178 |
ET_DYN Type = 3 /* Shared object. */ |
| 179 |
ET_CORE Type = 4 /* Core file. */ |
| 180 |
ET_LOOS Type = 0xfe00 /* First operating system specific. */ |
| 181 |
ET_HIOS Type = 0xfeff /* Last operating system-specific. */ |
| 182 |
ET_LOPROC Type = 0xff00 /* First processor-specific. */ |
| 183 |
ET_HIPROC Type = 0xffff /* Last processor-specific. */ |
| 184 |
) |
| 185 |
|
| 186 |
var typeStrings = []intName{ |
| 187 |
{0, "ET_NONE"}, |
| 188 |
{1, "ET_REL"}, |
| 189 |
{2, "ET_EXEC"}, |
| 190 |
{3, "ET_DYN"}, |
| 191 |
{4, "ET_CORE"}, |
| 192 |
{0xfe00, "ET_LOOS"}, |
| 193 |
{0xfeff, "ET_HIOS"}, |
| 194 |
{0xff00, "ET_LOPROC"}, |
| 195 |
{0xffff, "ET_HIPROC"}, |
| 196 |
} |
| 197 |
|
| 198 |
func (i Type) String() string { return stringName(uint32(i), typeStrings, false) } |
| 199 |
func (i Type) GoString() string { return stringName(uint32(i), typeStrings, true) } |
| 200 |
|
| 201 |
// Machine is found in Header.Machine. |
| 202 |
type Machine uint16 |
| 203 |
|
| 204 |
const ( |
| 205 |
EM_NONE Machine = 0 /* Unknown machine. */ |
| 206 |
EM_M32 Machine = 1 /* AT&T WE32100. */ |
| 207 |
EM_SPARC Machine = 2 /* Sun SPARC. */ |
| 208 |
EM_386 Machine = 3 /* Intel i386. */ |
| 209 |
EM_68K Machine = 4 /* Motorola 68000. */ |
| 210 |
EM_88K Machine = 5 /* Motorola 88000. */ |
| 211 |
EM_860 Machine = 7 /* Intel i860. */ |
| 212 |
EM_MIPS Machine = 8 /* MIPS R3000 Big-Endian only. */ |
| 213 |
EM_S370 Machine = 9 /* IBM System/370. */ |
| 214 |
EM_MIPS_RS3_LE Machine = 10 /* MIPS R3000 Little-Endian. */ |
| 215 |
EM_PARISC Machine = 15 /* HP PA-RISC. */ |
| 216 |
EM_VPP500 Machine = 17 /* Fujitsu VPP500. */ |
| 217 |
EM_SPARC32PLUS Machine = 18 /* SPARC v8plus. */ |
| 218 |
EM_960 Machine = 19 /* Intel 80960. */ |
| 219 |
EM_PPC Machine = 20 /* PowerPC 32-bit. */ |
| 220 |
EM_PPC64 Machine = 21 /* PowerPC 64-bit. */ |
| 221 |
EM_S390 Machine = 22 /* IBM System/390. */ |
| 222 |
EM_V800 Machine = 36 /* NEC V800. */ |
| 223 |
EM_FR20 Machine = 37 /* Fujitsu FR20. */ |
| 224 |
EM_RH32 Machine = 38 /* TRW RH-32. */ |
| 225 |
EM_RCE Machine = 39 /* Motorola RCE. */ |
| 226 |
EM_ARM Machine = 40 /* ARM. */ |
| 227 |
EM_SH Machine = 42 /* Hitachi SH. */ |
| 228 |
EM_SPARCV9 Machine = 43 /* SPARC v9 64-bit. */ |
| 229 |
EM_TRICORE Machine = 44 /* Siemens TriCore embedded processor. */ |
| 230 |
EM_ARC Machine = 45 /* Argonaut RISC Core. */ |
| 231 |
EM_H8_300 Machine = 46 /* Hitachi H8/300. */ |
| 232 |
EM_H8_300H Machine = 47 /* Hitachi H8/300H. */ |
| 233 |
EM_H8S Machine = 48 /* Hitachi H8S. */ |
| 234 |
EM_H8_500 Machine = 49 /* Hitachi H8/500. */ |
| 235 |
EM_IA_64 Machine = 50 /* Intel IA-64 Processor. */ |
| 236 |
EM_MIPS_X Machine = 51 /* Stanford MIPS-X. */ |
| 237 |
EM_COLDFIRE Machine = 52 /* Motorola ColdFire. */ |
| 238 |
EM_68HC12 Machine = 53 /* Motorola M68HC12. */ |
| 239 |
EM_MMA Machine = 54 /* Fujitsu MMA. */ |
| 240 |
EM_PCP Machine = 55 /* Siemens PCP. */ |
| 241 |
EM_NCPU Machine = 56 /* Sony nCPU. */ |
| 242 |
EM_NDR1 Machine = 57 /* Denso NDR1 microprocessor. */ |
| 243 |
EM_STARCORE Machine = 58 /* Motorola Star*Core processor. */ |
| 244 |
EM_ME16 Machine = 59 /* Toyota ME16 processor. */ |
| 245 |
EM_ST100 Machine = 60 /* STMicroelectronics ST100 processor. */ |
| 246 |
EM_TINYJ Machine = 61 /* Advanced Logic Corp. TinyJ processor. */ |
| 247 |
EM_X86_64 Machine = 62 /* Advanced Micro Devices x86-64 */ |
| 248 |
EM_PDSP Machine = 63 /* Sony DSP Processor */ |
| 249 |
EM_PDP10 Machine = 64 /* Digital Equipment Corp. PDP-10 */ |
| 250 |
EM_PDP11 Machine = 65 /* Digital Equipment Corp. PDP-11 */ |
| 251 |
EM_FX66 Machine = 66 /* Siemens FX66 microcontroller */ |
| 252 |
EM_ST9PLUS Machine = 67 /* STMicroelectronics ST9+ 8/16 bit microcontroller */ |
| 253 |
EM_ST7 Machine = 68 /* STMicroelectronics ST7 8-bit microcontroller */ |
| 254 |
EM_68HC16 Machine = 69 /* Motorola MC68HC16 Microcontroller */ |
| 255 |
EM_68HC11 Machine = 70 /* Motorola MC68HC11 Microcontroller */ |
| 256 |
EM_68HC08 Machine = 71 /* Motorola MC68HC08 Microcontroller */ |
| 257 |
EM_68HC05 Machine = 72 /* Motorola MC68HC05 Microcontroller */ |
| 258 |
EM_SVX Machine = 73 /* Silicon Graphics SVx */ |
| 259 |
EM_ST19 Machine = 74 /* STMicroelectronics ST19 8-bit microcontroller */ |
| 260 |
EM_VAX Machine = 75 /* Digital VAX */ |
| 261 |
EM_CRIS Machine = 76 /* Axis Communications 32-bit embedded processor */ |
| 262 |
EM_JAVELIN Machine = 77 /* Infineon Technologies 32-bit embedded processor */ |
| 263 |
EM_FIREPATH Machine = 78 /* Element 14 64-bit DSP Processor */ |
| 264 |
EM_ZSP Machine = 79 /* LSI Logic 16-bit DSP Processor */ |
| 265 |
EM_MMIX Machine = 80 /* Donald Knuth's educational 64-bit processor */ |
| 266 |
EM_HUANY Machine = 81 /* Harvard University machine-independent object files */ |
| 267 |
EM_PRISM Machine = 82 /* SiTera Prism */ |
| 268 |
EM_AVR Machine = 83 /* Atmel AVR 8-bit microcontroller */ |
| 269 |
EM_FR30 Machine = 84 /* Fujitsu FR30 */ |
| 270 |
EM_D10V Machine = 85 /* Mitsubishi D10V */ |
| 271 |
EM_D30V Machine = 86 /* Mitsubishi D30V */ |
| 272 |
EM_V850 Machine = 87 /* NEC v850 */ |
| 273 |
EM_M32R Machine = 88 /* Mitsubishi M32R */ |
| 274 |
EM_MN10300 Machine = 89 /* Matsushita MN10300 */ |
| 275 |
EM_MN10200 Machine = 90 /* Matsushita MN10200 */ |
| 276 |
EM_PJ Machine = 91 /* picoJava */ |
| 277 |
EM_OPENRISC Machine = 92 /* OpenRISC 32-bit embedded processor */ |
| 278 |
EM_ARC_COMPACT Machine = 93 /* ARC International ARCompact processor (old spelling/synonym: EM_ARC_A5) */ |
| 279 |
EM_XTENSA Machine = 94 /* Tensilica Xtensa Architecture */ |
| 280 |
EM_VIDEOCORE Machine = 95 /* Alphamosaic VideoCore processor */ |
| 281 |
EM_TMM_GPP Machine = 96 /* Thompson Multimedia General Purpose Processor */ |
| 282 |
EM_NS32K Machine = 97 /* National Semiconductor 32000 series */ |
| 283 |
EM_TPC Machine = 98 /* Tenor Network TPC processor */ |
| 284 |
EM_SNP1K Machine = 99 /* Trebia SNP 1000 processor */ |
| 285 |
EM_ST200 Machine = 100 /* STMicroelectronics (www.st.com) ST200 microcontroller */ |
| 286 |
EM_IP2K Machine = 101 /* Ubicom IP2xxx microcontroller family */ |
| 287 |
EM_MAX Machine = 102 /* MAX Processor */ |
| 288 |
EM_CR Machine = 103 /* National Semiconductor CompactRISC microprocessor */ |
| 289 |
EM_F2MC16 Machine = 104 /* Fujitsu F2MC16 */ |
| 290 |
EM_MSP430 Machine = 105 /* Texas Instruments embedded microcontroller msp430 */ |
| 291 |
EM_BLACKFIN Machine = 106 /* Analog Devices Blackfin (DSP) processor */ |
| 292 |
EM_SE_C33 Machine = 107 /* S1C33 Family of Seiko Epson processors */ |
| 293 |
EM_SEP Machine = 108 /* Sharp embedded microprocessor */ |
| 294 |
EM_ARCA Machine = 109 /* Arca RISC Microprocessor */ |
| 295 |
EM_UNICORE Machine = 110 /* Microprocessor series from PKU-Unity Ltd. and MPRC of Peking University */ |
| 296 |
EM_EXCESS Machine = 111 /* eXcess: 16/32/64-bit configurable embedded CPU */ |
| 297 |
EM_DXP Machine = 112 /* Icera Semiconductor Inc. Deep Execution Processor */ |
| 298 |
EM_ALTERA_NIOS2 Machine = 113 /* Altera Nios II soft-core processor */ |
| 299 |
EM_CRX Machine = 114 /* National Semiconductor CompactRISC CRX microprocessor */ |
| 300 |
EM_XGATE Machine = 115 /* Motorola XGATE embedded processor */ |
| 301 |
EM_C166 Machine = 116 /* Infineon C16x/XC16x processor */ |
| 302 |
EM_M16C Machine = 117 /* Renesas M16C series microprocessors */ |
| 303 |
EM_DSPIC30F Machine = 118 /* Microchip Technology dsPIC30F Digital Signal Controller */ |
| 304 |
EM_CE Machine = 119 /* Freescale Communication Engine RISC core */ |
| 305 |
EM_M32C Machine = 120 /* Renesas M32C series microprocessors */ |
| 306 |
EM_TSK3000 Machine = 131 /* Altium TSK3000 core */ |
| 307 |
EM_RS08 Machine = 132 /* Freescale RS08 embedded processor */ |
| 308 |
EM_SHARC Machine = 133 /* Analog Devices SHARC family of 32-bit DSP processors */ |
| 309 |
EM_ECOG2 Machine = 134 /* Cyan Technology eCOG2 microprocessor */ |
| 310 |
EM_SCORE7 Machine = 135 /* Sunplus S+core7 RISC processor */ |
| 311 |
EM_DSP24 Machine = 136 /* New Japan Radio (NJR) 24-bit DSP Processor */ |
| 312 |
EM_VIDEOCORE3 Machine = 137 /* Broadcom VideoCore III processor */ |
| 313 |
EM_LATTICEMICO32 Machine = 138 /* RISC processor for Lattice FPGA architecture */ |
| 314 |
EM_SE_C17 Machine = 139 /* Seiko Epson C17 family */ |
| 315 |
EM_TI_C6000 Machine = 140 /* The Texas Instruments TMS320C6000 DSP family */ |
| 316 |
EM_TI_C2000 Machine = 141 /* The Texas Instruments TMS320C2000 DSP family */ |
| 317 |
EM_TI_C5500 Machine = 142 /* The Texas Instruments TMS320C55x DSP family */ |
| 318 |
EM_TI_ARP32 Machine = 143 /* Texas Instruments Application Specific RISC Processor, 32bit fetch */ |
| 319 |
EM_TI_PRU Machine = 144 /* Texas Instruments Programmable Realtime Unit */ |
| 320 |
EM_MMDSP_PLUS Machine = 160 /* STMicroelectronics 64bit VLIW Data Signal Processor */ |
| 321 |
EM_CYPRESS_M8C Machine = 161 /* Cypress M8C microprocessor */ |
| 322 |
EM_R32C Machine = 162 /* Renesas R32C series microprocessors */ |
| 323 |
EM_TRIMEDIA Machine = 163 /* NXP Semiconductors TriMedia architecture family */ |
| 324 |
EM_QDSP6 Machine = 164 /* QUALCOMM DSP6 Processor */ |
| 325 |
EM_8051 Machine = 165 /* Intel 8051 and variants */ |
| 326 |
EM_STXP7X Machine = 166 /* STMicroelectronics STxP7x family of configurable and extensible RISC processors */ |
| 327 |
EM_NDS32 Machine = 167 /* Andes Technology compact code size embedded RISC processor family */ |
| 328 |
EM_ECOG1 Machine = 168 /* Cyan Technology eCOG1X family */ |
| 329 |
EM_ECOG1X Machine = 168 /* Cyan Technology eCOG1X family */ |
| 330 |
EM_MAXQ30 Machine = 169 /* Dallas Semiconductor MAXQ30 Core Micro-controllers */ |
| 331 |
EM_XIMO16 Machine = 170 /* New Japan Radio (NJR) 16-bit DSP Processor */ |
| 332 |
EM_MANIK Machine = 171 /* M2000 Reconfigurable RISC Microprocessor */ |
| 333 |
EM_CRAYNV2 Machine = 172 /* Cray Inc. NV2 vector architecture */ |
| 334 |
EM_RX Machine = 173 /* Renesas RX family */ |
| 335 |
EM_METAG Machine = 174 /* Imagination Technologies META processor architecture */ |
| 336 |
EM_MCST_ELBRUS Machine = 175 /* MCST Elbrus general purpose hardware architecture */ |
| 337 |
EM_ECOG16 Machine = 176 /* Cyan Technology eCOG16 family */ |
| 338 |
EM_CR16 Machine = 177 /* National Semiconductor CompactRISC CR16 16-bit microprocessor */ |
| 339 |
EM_ETPU Machine = 178 /* Freescale Extended Time Processing Unit */ |
| 340 |
EM_SLE9X Machine = 179 /* Infineon Technologies SLE9X core */ |
| 341 |
EM_L10M Machine = 180 /* Intel L10M */ |
| 342 |
EM_K10M Machine = 181 /* Intel K10M */ |
| 343 |
EM_AARCH64 Machine = 183 /* ARM 64-bit Architecture (AArch64) */ |
| 344 |
EM_AVR32 Machine = 185 /* Atmel Corporation 32-bit microprocessor family */ |
| 345 |
EM_STM8 Machine = 186 /* STMicroeletronics STM8 8-bit microcontroller */ |
| 346 |
EM_TILE64 Machine = 187 /* Tilera TILE64 multicore architecture family */ |
| 347 |
EM_TILEPRO Machine = 188 /* Tilera TILEPro multicore architecture family */ |
| 348 |
EM_MICROBLAZE Machine = 189 /* Xilinx MicroBlaze 32-bit RISC soft processor core */ |
| 349 |
EM_CUDA Machine = 190 /* NVIDIA CUDA architecture */ |
| 350 |
EM_TILEGX Machine = 191 /* Tilera TILE-Gx multicore architecture family */ |
| 351 |
EM_CLOUDSHIELD Machine = 192 /* CloudShield architecture family */ |
| 352 |
EM_COREA_1ST Machine = 193 /* KIPO-KAIST Core-A 1st generation processor family */ |
| 353 |
EM_COREA_2ND Machine = 194 /* KIPO-KAIST Core-A 2nd generation processor family */ |
| 354 |
EM_ARC_COMPACT2 Machine = 195 /* Synopsys ARCompact V2 */ |
| 355 |
EM_OPEN8 Machine = 196 /* Open8 8-bit RISC soft processor core */ |
| 356 |
EM_RL78 Machine = 197 /* Renesas RL78 family */ |
| 357 |
EM_VIDEOCORE5 Machine = 198 /* Broadcom VideoCore V processor */ |
| 358 |
EM_78KOR Machine = 199 /* Renesas 78KOR family */ |
| 359 |
EM_56800EX Machine = 200 /* Freescale 56800EX Digital Signal Controller (DSC) */ |
| 360 |
EM_BA1 Machine = 201 /* Beyond BA1 CPU architecture */ |
| 361 |
EM_BA2 Machine = 202 /* Beyond BA2 CPU architecture */ |
| 362 |
EM_XCORE Machine = 203 /* XMOS xCORE processor family */ |
| 363 |
EM_MCHP_PIC Machine = 204 /* Microchip 8-bit PIC(r) family */ |
| 364 |
EM_INTEL205 Machine = 205 /* Reserved by Intel */ |
| 365 |
EM_INTEL206 Machine = 206 /* Reserved by Intel */ |
| 366 |
EM_INTEL207 Machine = 207 /* Reserved by Intel */ |
| 367 |
EM_INTEL208 Machine = 208 /* Reserved by Intel */ |
| 368 |
EM_INTEL209 Machine = 209 /* Reserved by Intel */ |
| 369 |
EM_KM32 Machine = 210 /* KM211 KM32 32-bit processor */ |
| 370 |
EM_KMX32 Machine = 211 /* KM211 KMX32 32-bit processor */ |
| 371 |
EM_KMX16 Machine = 212 /* KM211 KMX16 16-bit processor */ |
| 372 |
EM_KMX8 Machine = 213 /* KM211 KMX8 8-bit processor */ |
| 373 |
EM_KVARC Machine = 214 /* KM211 KVARC processor */ |
| 374 |
EM_CDP Machine = 215 /* Paneve CDP architecture family */ |
| 375 |
EM_COGE Machine = 216 /* Cognitive Smart Memory Processor */ |
| 376 |
EM_COOL Machine = 217 /* Bluechip Systems CoolEngine */ |
| 377 |
EM_NORC Machine = 218 /* Nanoradio Optimized RISC */ |
| 378 |
EM_CSR_KALIMBA Machine = 219 /* CSR Kalimba architecture family */ |
| 379 |
EM_Z80 Machine = 220 /* Zilog Z80 */ |
| 380 |
EM_VISIUM Machine = 221 /* Controls and Data Services VISIUMcore processor */ |
| 381 |
EM_FT32 Machine = 222 /* FTDI Chip FT32 high performance 32-bit RISC architecture */ |
| 382 |
EM_MOXIE Machine = 223 /* Moxie processor family */ |
| 383 |
EM_AMDGPU Machine = 224 /* AMD GPU architecture */ |
| 384 |
EM_RISCV Machine = 243 /* RISC-V */ |
| 385 |
EM_LANAI Machine = 244 /* Lanai 32-bit processor */ |
| 386 |
EM_BPF Machine = 247 /* Linux BPF – in-kernel virtual machine */ |
| 387 |
EM_LOONGARCH Machine = 258 /* LoongArch */ |
| 388 |
|
| 389 |
/* Non-standard or deprecated. */ |
| 390 |
EM_486 Machine = 6 /* Intel i486. */ |
| 391 |
EM_MIPS_RS4_BE Machine = 10 /* MIPS R4000 Big-Endian */ |
| 392 |
EM_ALPHA_STD Machine = 41 /* Digital Alpha (standard value). */ |
| 393 |
EM_ALPHA Machine = 0x9026 /* Alpha (written in the absence of an ABI) */ |
| 394 |
) |
| 395 |
|
| 396 |
var machineStrings = []intName{ |
| 397 |
{0, "EM_NONE"}, |
| 398 |
{1, "EM_M32"}, |
| 399 |
{2, "EM_SPARC"}, |
| 400 |
{3, "EM_386"}, |
| 401 |
{4, "EM_68K"}, |
| 402 |
{5, "EM_88K"}, |
| 403 |
{7, "EM_860"}, |
| 404 |
{8, "EM_MIPS"}, |
| 405 |
{9, "EM_S370"}, |
| 406 |
{10, "EM_MIPS_RS3_LE"}, |
| 407 |
{15, "EM_PARISC"}, |
| 408 |
{17, "EM_VPP500"}, |
| 409 |
{18, "EM_SPARC32PLUS"}, |
| 410 |
{19, "EM_960"}, |
| 411 |
{20, "EM_PPC"}, |
| 412 |
{21, "EM_PPC64"}, |
| 413 |
{22, "EM_S390"}, |
| 414 |
{36, "EM_V800"}, |
| 415 |
{37, "EM_FR20"}, |
| 416 |
{38, "EM_RH32"}, |
| 417 |
{39, "EM_RCE"}, |
| 418 |
{40, "EM_ARM"}, |
| 419 |
{42, "EM_SH"}, |
| 420 |
{43, "EM_SPARCV9"}, |
| 421 |
{44, "EM_TRICORE"}, |
| 422 |
{45, "EM_ARC"}, |
| 423 |
{46, "EM_H8_300"}, |
| 424 |
{47, "EM_H8_300H"}, |
| 425 |
{48, "EM_H8S"}, |
| 426 |
{49, "EM_H8_500"}, |
| 427 |
{50, "EM_IA_64"}, |
| 428 |
{51, "EM_MIPS_X"}, |
| 429 |
{52, "EM_COLDFIRE"}, |
| 430 |
{53, "EM_68HC12"}, |
| 431 |
{54, "EM_MMA"}, |
| 432 |
{55, "EM_PCP"}, |
| 433 |
{56, "EM_NCPU"}, |
| 434 |
{57, "EM_NDR1"}, |
| 435 |
{58, "EM_STARCORE"}, |
| 436 |
{59, "EM_ME16"}, |
| 437 |
{60, "EM_ST100"}, |
| 438 |
{61, "EM_TINYJ"}, |
| 439 |
{62, "EM_X86_64"}, |
| 440 |
{63, "EM_PDSP"}, |
| 441 |
{64, "EM_PDP10"}, |
| 442 |
{65, "EM_PDP11"}, |
| 443 |
{66, "EM_FX66"}, |
| 444 |
{67, "EM_ST9PLUS"}, |
| 445 |
{68, "EM_ST7"}, |
| 446 |
{69, "EM_68HC16"}, |
| 447 |
{70, "EM_68HC11"}, |
| 448 |
{71, "EM_68HC08"}, |
| 449 |
{72, "EM_68HC05"}, |
| 450 |
{73, "EM_SVX"}, |
| 451 |
{74, "EM_ST19"}, |
| 452 |
{75, "EM_VAX"}, |
| 453 |
{76, "EM_CRIS"}, |
| 454 |
{77, "EM_JAVELIN"}, |
| 455 |
{78, "EM_FIREPATH"}, |
| 456 |
{79, "EM_ZSP"}, |
| 457 |
{80, "EM_MMIX"}, |
| 458 |
{81, "EM_HUANY"}, |
| 459 |
{82, "EM_PRISM"}, |
| 460 |
{83, "EM_AVR"}, |
| 461 |
{84, "EM_FR30"}, |
| 462 |
{85, "EM_D10V"}, |
| 463 |
{86, "EM_D30V"}, |
| 464 |
{87, "EM_V850"}, |
| 465 |
{88, "EM_M32R"}, |
| 466 |
{89, "EM_MN10300"}, |
| 467 |
{90, "EM_MN10200"}, |
| 468 |
{91, "EM_PJ"}, |
| 469 |
{92, "EM_OPENRISC"}, |
| 470 |
{93, "EM_ARC_COMPACT"}, |
| 471 |
{94, "EM_XTENSA"}, |
| 472 |
{95, "EM_VIDEOCORE"}, |
| 473 |
{96, "EM_TMM_GPP"}, |
| 474 |
{97, "EM_NS32K"}, |
| 475 |
{98, "EM_TPC"}, |
| 476 |
{99, "EM_SNP1K"}, |
| 477 |
{100, "EM_ST200"}, |
| 478 |
{101, "EM_IP2K"}, |
| 479 |
{102, "EM_MAX"}, |
| 480 |
{103, "EM_CR"}, |
| 481 |
{104, "EM_F2MC16"}, |
| 482 |
{105, "EM_MSP430"}, |
| 483 |
{106, "EM_BLACKFIN"}, |
| 484 |
{107, "EM_SE_C33"}, |
| 485 |
{108, "EM_SEP"}, |
| 486 |
{109, "EM_ARCA"}, |
| 487 |
{110, "EM_UNICORE"}, |
| 488 |
{111, "EM_EXCESS"}, |
| 489 |
{112, "EM_DXP"}, |
| 490 |
{113, "EM_ALTERA_NIOS2"}, |
| 491 |
{114, "EM_CRX"}, |
| 492 |
{115, "EM_XGATE"}, |
| 493 |
{116, "EM_C166"}, |
| 494 |
{117, "EM_M16C"}, |
| 495 |
{118, "EM_DSPIC30F"}, |
| 496 |
{119, "EM_CE"}, |
| 497 |
{120, "EM_M32C"}, |
| 498 |
{131, "EM_TSK3000"}, |
| 499 |
{132, "EM_RS08"}, |
| 500 |
{133, "EM_SHARC"}, |
| 501 |
{134, "EM_ECOG2"}, |
| 502 |
{135, "EM_SCORE7"}, |
| 503 |
{136, "EM_DSP24"}, |
| 504 |
{137, "EM_VIDEOCORE3"}, |
| 505 |
{138, "EM_LATTICEMICO32"}, |
| 506 |
{139, "EM_SE_C17"}, |
| 507 |
{140, "EM_TI_C6000"}, |
| 508 |
{141, "EM_TI_C2000"}, |
| 509 |
{142, "EM_TI_C5500"}, |
| 510 |
{143, "EM_TI_ARP32"}, |
| 511 |
{144, "EM_TI_PRU"}, |
| 512 |
{160, "EM_MMDSP_PLUS"}, |
| 513 |
{161, "EM_CYPRESS_M8C"}, |
| 514 |
{162, "EM_R32C"}, |
| 515 |
{163, "EM_TRIMEDIA"}, |
| 516 |
{164, "EM_QDSP6"}, |
| 517 |
{165, "EM_8051"}, |
| 518 |
{166, "EM_STXP7X"}, |
| 519 |
{167, "EM_NDS32"}, |
| 520 |
{168, "EM_ECOG1"}, |
| 521 |
{168, "EM_ECOG1X"}, |
| 522 |
{169, "EM_MAXQ30"}, |
| 523 |
{170, "EM_XIMO16"}, |
| 524 |
{171, "EM_MANIK"}, |
| 525 |
{172, "EM_CRAYNV2"}, |
| 526 |
{173, "EM_RX"}, |
| 527 |
{174, "EM_METAG"}, |
| 528 |
{175, "EM_MCST_ELBRUS"}, |
| 529 |
{176, "EM_ECOG16"}, |
| 530 |
{177, "EM_CR16"}, |
| 531 |
{178, "EM_ETPU"}, |
| 532 |
{179, "EM_SLE9X"}, |
| 533 |
{180, "EM_L10M"}, |
| 534 |
{181, "EM_K10M"}, |
| 535 |
{183, "EM_AARCH64"}, |
| 536 |
{185, "EM_AVR32"}, |
| 537 |
{186, "EM_STM8"}, |
| 538 |
{187, "EM_TILE64"}, |
| 539 |
{188, "EM_TILEPRO"}, |
| 540 |
{189, "EM_MICROBLAZE"}, |
| 541 |
{190, "EM_CUDA"}, |
| 542 |
{191, "EM_TILEGX"}, |
| 543 |
{192, "EM_CLOUDSHIELD"}, |
| 544 |
{193, "EM_COREA_1ST"}, |
| 545 |
{194, "EM_COREA_2ND"}, |
| 546 |
{195, "EM_ARC_COMPACT2"}, |
| 547 |
{196, "EM_OPEN8"}, |
| 548 |
{197, "EM_RL78"}, |
| 549 |
{198, "EM_VIDEOCORE5"}, |
| 550 |
{199, "EM_78KOR"}, |
| 551 |
{200, "EM_56800EX"}, |
| 552 |
{201, "EM_BA1"}, |
| 553 |
{202, "EM_BA2"}, |
| 554 |
{203, "EM_XCORE"}, |
| 555 |
{204, "EM_MCHP_PIC"}, |
| 556 |
{205, "EM_INTEL205"}, |
| 557 |
{206, "EM_INTEL206"}, |
| 558 |
{207, "EM_INTEL207"}, |
| 559 |
{208, "EM_INTEL208"}, |
| 560 |
{209, "EM_INTEL209"}, |
| 561 |
{210, "EM_KM32"}, |
| 562 |
{211, "EM_KMX32"}, |
| 563 |
{212, "EM_KMX16"}, |
| 564 |
{213, "EM_KMX8"}, |
| 565 |
{214, "EM_KVARC"}, |
| 566 |
{215, "EM_CDP"}, |
| 567 |
{216, "EM_COGE"}, |
| 568 |
{217, "EM_COOL"}, |
| 569 |
{218, "EM_NORC"}, |
| 570 |
{219, "EM_CSR_KALIMBA "}, |
| 571 |
{220, "EM_Z80 "}, |
| 572 |
{221, "EM_VISIUM "}, |
| 573 |
{222, "EM_FT32 "}, |
| 574 |
{223, "EM_MOXIE"}, |
| 575 |
{224, "EM_AMDGPU"}, |
| 576 |
{243, "EM_RISCV"}, |
| 577 |
{244, "EM_LANAI"}, |
| 578 |
{247, "EM_BPF"}, |
| 579 |
{258, "EM_LOONGARCH"}, |
| 580 |
|
| 581 |
/* Non-standard or deprecated. */ |
| 582 |
{6, "EM_486"}, |
| 583 |
{10, "EM_MIPS_RS4_BE"}, |
| 584 |
{41, "EM_ALPHA_STD"}, |
| 585 |
{0x9026, "EM_ALPHA"}, |
| 586 |
} |
| 587 |
|
| 588 |
func (i Machine) String() string { return stringName(uint32(i), machineStrings, false) } |
| 589 |
func (i Machine) GoString() string { return stringName(uint32(i), machineStrings, true) } |
| 590 |
|
| 591 |
// Special section indices. |
| 592 |
type SectionIndex int |
| 593 |
|
| 594 |
const ( |
| 595 |
SHN_UNDEF SectionIndex = 0 /* Undefined, missing, irrelevant. */ |
| 596 |
SHN_LORESERVE SectionIndex = 0xff00 /* First of reserved range. */ |
| 597 |
SHN_LOPROC SectionIndex = 0xff00 /* First processor-specific. */ |
| 598 |
SHN_HIPROC SectionIndex = 0xff1f /* Last processor-specific. */ |
| 599 |
SHN_LOOS SectionIndex = 0xff20 /* First operating system-specific. */ |
| 600 |
SHN_HIOS SectionIndex = 0xff3f /* Last operating system-specific. */ |
| 601 |
SHN_ABS SectionIndex = 0xfff1 /* Absolute values. */ |
| 602 |
SHN_COMMON SectionIndex = 0xfff2 /* Common data. */ |
| 603 |
SHN_XINDEX SectionIndex = 0xffff /* Escape; index stored elsewhere. */ |
| 604 |
SHN_HIRESERVE SectionIndex = 0xffff /* Last of reserved range. */ |
| 605 |
) |
| 606 |
|
| 607 |
var shnStrings = []intName{ |
| 608 |
{0, "SHN_UNDEF"}, |
| 609 |
{0xff00, "SHN_LOPROC"}, |
| 610 |
{0xff20, "SHN_LOOS"}, |
| 611 |
{0xfff1, "SHN_ABS"}, |
| 612 |
{0xfff2, "SHN_COMMON"}, |
| 613 |
{0xffff, "SHN_XINDEX"}, |
| 614 |
} |
| 615 |
|
| 616 |
func (i SectionIndex) String() string { return stringName(uint32(i), shnStrings, false) } |
| 617 |
func (i SectionIndex) GoString() string { return stringName(uint32(i), shnStrings, true) } |
| 618 |
|
| 619 |
// Section type. |
| 620 |
type SectionType uint32 |
| 621 |
|
| 622 |
const ( |
| 623 |
SHT_NULL SectionType = 0 /* inactive */ |
| 624 |
SHT_PROGBITS SectionType = 1 /* program defined information */ |
| 625 |
SHT_SYMTAB SectionType = 2 /* symbol table section */ |
| 626 |
SHT_STRTAB SectionType = 3 /* string table section */ |
| 627 |
SHT_RELA SectionType = 4 /* relocation section with addends */ |
| 628 |
SHT_HASH SectionType = 5 /* symbol hash table section */ |
| 629 |
SHT_DYNAMIC SectionType = 6 /* dynamic section */ |
| 630 |
SHT_NOTE SectionType = 7 /* note section */ |
| 631 |
SHT_NOBITS SectionType = 8 /* no space section */ |
| 632 |
SHT_REL SectionType = 9 /* relocation section - no addends */ |
| 633 |
SHT_SHLIB SectionType = 10 /* reserved - purpose unknown */ |
| 634 |
SHT_DYNSYM SectionType = 11 /* dynamic symbol table section */ |
| 635 |
SHT_INIT_ARRAY SectionType = 14 /* Initialization function pointers. */ |
| 636 |
SHT_FINI_ARRAY SectionType = 15 /* Termination function pointers. */ |
| 637 |
SHT_PREINIT_ARRAY SectionType = 16 /* Pre-initialization function ptrs. */ |
| 638 |
SHT_GROUP SectionType = 17 /* Section group. */ |
| 639 |
SHT_SYMTAB_SHNDX SectionType = 18 /* Section indexes (see SHN_XINDEX). */ |
| 640 |
SHT_LOOS SectionType = 0x60000000 /* First of OS specific semantics */ |
| 641 |
SHT_GNU_ATTRIBUTES SectionType = 0x6ffffff5 /* GNU object attributes */ |
| 642 |
SHT_GNU_HASH SectionType = 0x6ffffff6 /* GNU hash table */ |
| 643 |
SHT_GNU_LIBLIST SectionType = 0x6ffffff7 /* GNU prelink library list */ |
| 644 |
SHT_GNU_VERDEF SectionType = 0x6ffffffd /* GNU version definition section */ |
| 645 |
SHT_GNU_VERNEED SectionType = 0x6ffffffe /* GNU version needs section */ |
| 646 |
SHT_GNU_VERSYM SectionType = 0x6fffffff /* GNU version symbol table */ |
| 647 |
SHT_HIOS SectionType = 0x6fffffff /* Last of OS specific semantics */ |
| 648 |
SHT_LOPROC SectionType = 0x70000000 /* reserved range for processor */ |
| 649 |
SHT_RISCV_ATTRIBUTES SectionType = 0x70000003 /* RISCV object attributes */ |
| 650 |
SHT_MIPS_ABIFLAGS SectionType = 0x7000002a /* .MIPS.abiflags */ |
| 651 |
SHT_HIPROC SectionType = 0x7fffffff /* specific section header types */ |
| 652 |
SHT_LOUSER SectionType = 0x80000000 /* reserved range for application */ |
| 653 |
SHT_HIUSER SectionType = 0xffffffff /* specific indexes */ |
| 654 |
) |
| 655 |
|
| 656 |
var shtStrings = []intName{ |
| 657 |
{0, "SHT_NULL"}, |
| 658 |
{1, "SHT_PROGBITS"}, |
| 659 |
{2, "SHT_SYMTAB"}, |
| 660 |
{3, "SHT_STRTAB"}, |
| 661 |
{4, "SHT_RELA"}, |
| 662 |
{5, "SHT_HASH"}, |
| 663 |
{6, "SHT_DYNAMIC"}, |
| 664 |
{7, "SHT_NOTE"}, |
| 665 |
{8, "SHT_NOBITS"}, |
| 666 |
{9, "SHT_REL"}, |
| 667 |
{10, "SHT_SHLIB"}, |
| 668 |
{11, "SHT_DYNSYM"}, |
| 669 |
{14, "SHT_INIT_ARRAY"}, |
| 670 |
{15, "SHT_FINI_ARRAY"}, |
| 671 |
{16, "SHT_PREINIT_ARRAY"}, |
| 672 |
{17, "SHT_GROUP"}, |
| 673 |
{18, "SHT_SYMTAB_SHNDX"}, |
| 674 |
{0x60000000, "SHT_LOOS"}, |
| 675 |
{0x6ffffff5, "SHT_GNU_ATTRIBUTES"}, |
| 676 |
{0x6ffffff6, "SHT_GNU_HASH"}, |
| 677 |
{0x6ffffff7, "SHT_GNU_LIBLIST"}, |
| 678 |
{0x6ffffffd, "SHT_GNU_VERDEF"}, |
| 679 |
{0x6ffffffe, "SHT_GNU_VERNEED"}, |
| 680 |
{0x6fffffff, "SHT_GNU_VERSYM"}, |
| 681 |
{0x70000000, "SHT_LOPROC"}, |
| 682 |
// We don't list the processor-dependent SectionType, |
| 683 |
// as the values overlap. |
| 684 |
{0x7000002a, "SHT_MIPS_ABIFLAGS"}, |
| 685 |
{0x7fffffff, "SHT_HIPROC"}, |
| 686 |
{0x80000000, "SHT_LOUSER"}, |
| 687 |
{0xffffffff, "SHT_HIUSER"}, |
| 688 |
} |
| 689 |
|
| 690 |
func (i SectionType) String() string { return stringName(uint32(i), shtStrings, false) } |
| 691 |
func (i SectionType) GoString() string { return stringName(uint32(i), shtStrings, true) } |
| 692 |
|
| 693 |
// Section flags. |
| 694 |
type SectionFlag uint32 |
| 695 |
|
| 696 |
const ( |
| 697 |
SHF_WRITE SectionFlag = 0x1 /* Section contains writable data. */ |
| 698 |
SHF_ALLOC SectionFlag = 0x2 /* Section occupies memory. */ |
| 699 |
SHF_EXECINSTR SectionFlag = 0x4 /* Section contains instructions. */ |
| 700 |
SHF_MERGE SectionFlag = 0x10 /* Section may be merged. */ |
| 701 |
SHF_STRINGS SectionFlag = 0x20 /* Section contains strings. */ |
| 702 |
SHF_INFO_LINK SectionFlag = 0x40 /* sh_info holds section index. */ |
| 703 |
SHF_LINK_ORDER SectionFlag = 0x80 /* Special ordering requirements. */ |
| 704 |
SHF_OS_NONCONFORMING SectionFlag = 0x100 /* OS-specific processing required. */ |
| 705 |
SHF_GROUP SectionFlag = 0x200 /* Member of section group. */ |
| 706 |
SHF_TLS SectionFlag = 0x400 /* Section contains TLS data. */ |
| 707 |
SHF_COMPRESSED SectionFlag = 0x800 /* Section is compressed. */ |
| 708 |
SHF_MASKOS SectionFlag = 0x0ff00000 /* OS-specific semantics. */ |
| 709 |
SHF_MASKPROC SectionFlag = 0xf0000000 /* Processor-specific semantics. */ |
| 710 |
) |
| 711 |
|
| 712 |
var shfStrings = []intName{ |
| 713 |
{0x1, "SHF_WRITE"}, |
| 714 |
{0x2, "SHF_ALLOC"}, |
| 715 |
{0x4, "SHF_EXECINSTR"}, |
| 716 |
{0x10, "SHF_MERGE"}, |
| 717 |
{0x20, "SHF_STRINGS"}, |
| 718 |
{0x40, "SHF_INFO_LINK"}, |
| 719 |
{0x80, "SHF_LINK_ORDER"}, |
| 720 |
{0x100, "SHF_OS_NONCONFORMING"}, |
| 721 |
{0x200, "SHF_GROUP"}, |
| 722 |
{0x400, "SHF_TLS"}, |
| 723 |
{0x800, "SHF_COMPRESSED"}, |
| 724 |
} |
| 725 |
|
| 726 |
func (i SectionFlag) String() string { return flagName(uint32(i), shfStrings, false) } |
| 727 |
func (i SectionFlag) GoString() string { return flagName(uint32(i), shfStrings, true) } |
| 728 |
|
| 729 |
// Section compression type. |
| 730 |
type CompressionType int |
| 731 |
|
| 732 |
const ( |
| 733 |
COMPRESS_ZLIB CompressionType = 1 /* ZLIB compression. */ |
| 734 |
COMPRESS_ZSTD CompressionType = 2 /* ZSTD compression. */ |
| 735 |
COMPRESS_LOOS CompressionType = 0x60000000 /* First OS-specific. */ |
| 736 |
COMPRESS_HIOS CompressionType = 0x6fffffff /* Last OS-specific. */ |
| 737 |
COMPRESS_LOPROC CompressionType = 0x70000000 /* First processor-specific type. */ |
| 738 |
COMPRESS_HIPROC CompressionType = 0x7fffffff /* Last processor-specific type. */ |
| 739 |
) |
| 740 |
|
| 741 |
var compressionStrings = []intName{ |
| 742 |
{1, "COMPRESS_ZLIB"}, |
| 743 |
{2, "COMPRESS_ZSTD"}, |
| 744 |
{0x60000000, "COMPRESS_LOOS"}, |
| 745 |
{0x6fffffff, "COMPRESS_HIOS"}, |
| 746 |
{0x70000000, "COMPRESS_LOPROC"}, |
| 747 |
{0x7fffffff, "COMPRESS_HIPROC"}, |
| 748 |
} |
| 749 |
|
| 750 |
func (i CompressionType) String() string { return stringName(uint32(i), compressionStrings, false) } |
| 751 |
func (i CompressionType) GoString() string { return stringName(uint32(i), compressionStrings, true) } |
| 752 |
|
| 753 |
// Prog.Type |
| 754 |
type ProgType int |
| 755 |
|
| 756 |
const ( |
| 757 |
PT_NULL ProgType = 0 /* Unused entry. */ |
| 758 |
PT_LOAD ProgType = 1 /* Loadable segment. */ |
| 759 |
PT_DYNAMIC ProgType = 2 /* Dynamic linking information segment. */ |
| 760 |
PT_INTERP ProgType = 3 /* Pathname of interpreter. */ |
| 761 |
PT_NOTE ProgType = 4 /* Auxiliary information. */ |
| 762 |
PT_SHLIB ProgType = 5 /* Reserved (not used). */ |
| 763 |
PT_PHDR ProgType = 6 /* Location of program header itself. */ |
| 764 |
PT_TLS ProgType = 7 /* Thread local storage segment */ |
| 765 |
|
| 766 |
PT_LOOS ProgType = 0x60000000 /* First OS-specific. */ |
| 767 |
|
| 768 |
PT_GNU_EH_FRAME ProgType = 0x6474e550 /* Frame unwind information */ |
| 769 |
PT_GNU_STACK ProgType = 0x6474e551 /* Stack flags */ |
| 770 |
PT_GNU_RELRO ProgType = 0x6474e552 /* Read only after relocs */ |
| 771 |
PT_GNU_PROPERTY ProgType = 0x6474e553 /* GNU property */ |
| 772 |
PT_GNU_MBIND_LO ProgType = 0x6474e555 /* Mbind segments start */ |
| 773 |
PT_GNU_MBIND_HI ProgType = 0x6474f554 /* Mbind segments finish */ |
| 774 |
|
| 775 |
PT_PAX_FLAGS ProgType = 0x65041580 /* PAX flags */ |
| 776 |
|
| 777 |
PT_OPENBSD_RANDOMIZE ProgType = 0x65a3dbe6 /* Random data */ |
| 778 |
PT_OPENBSD_WXNEEDED ProgType = 0x65a3dbe7 /* W^X violations */ |
| 779 |
PT_OPENBSD_NOBTCFI ProgType = 0x65a3dbe8 /* No branch target CFI */ |
| 780 |
PT_OPENBSD_BOOTDATA ProgType = 0x65a41be6 /* Boot arguments */ |
| 781 |
|
| 782 |
PT_SUNW_EH_FRAME ProgType = 0x6474e550 /* Frame unwind information */ |
| 783 |
PT_SUNWSTACK ProgType = 0x6ffffffb /* Stack segment */ |
| 784 |
|
| 785 |
PT_HIOS ProgType = 0x6fffffff /* Last OS-specific. */ |
| 786 |
|
| 787 |
PT_LOPROC ProgType = 0x70000000 /* First processor-specific type. */ |
| 788 |
|
| 789 |
PT_ARM_ARCHEXT ProgType = 0x70000000 /* Architecture compatibility */ |
| 790 |
PT_ARM_EXIDX ProgType = 0x70000001 /* Exception unwind tables */ |
| 791 |
|
| 792 |
PT_AARCH64_ARCHEXT ProgType = 0x70000000 /* Architecture compatibility */ |
| 793 |
PT_AARCH64_UNWIND ProgType = 0x70000001 /* Exception unwind tables */ |
| 794 |
|
| 795 |
PT_MIPS_REGINFO ProgType = 0x70000000 /* Register usage */ |
| 796 |
PT_MIPS_RTPROC ProgType = 0x70000001 /* Runtime procedures */ |
| 797 |
PT_MIPS_OPTIONS ProgType = 0x70000002 /* Options */ |
| 798 |
PT_MIPS_ABIFLAGS ProgType = 0x70000003 /* ABI flags */ |
| 799 |
|
| 800 |
PT_RISCV_ATTRIBUTES ProgType = 0x70000003 /* RISC-V ELF attribute section. */ |
| 801 |
|
| 802 |
PT_S390_PGSTE ProgType = 0x70000000 /* 4k page table size */ |
| 803 |
|
| 804 |
PT_HIPROC ProgType = 0x7fffffff /* Last processor-specific type. */ |
| 805 |
) |
| 806 |
|
| 807 |
var ptStrings = []intName{ |
| 808 |
{0, "PT_NULL"}, |
| 809 |
{1, "PT_LOAD"}, |
| 810 |
{2, "PT_DYNAMIC"}, |
| 811 |
{3, "PT_INTERP"}, |
| 812 |
{4, "PT_NOTE"}, |
| 813 |
{5, "PT_SHLIB"}, |
| 814 |
{6, "PT_PHDR"}, |
| 815 |
{7, "PT_TLS"}, |
| 816 |
{0x60000000, "PT_LOOS"}, |
| 817 |
{0x6474e550, "PT_GNU_EH_FRAME"}, |
| 818 |
{0x6474e551, "PT_GNU_STACK"}, |
| 819 |
{0x6474e552, "PT_GNU_RELRO"}, |
| 820 |
{0x6474e553, "PT_GNU_PROPERTY"}, |
| 821 |
{0x65041580, "PT_PAX_FLAGS"}, |
| 822 |
{0x65a3dbe6, "PT_OPENBSD_RANDOMIZE"}, |
| 823 |
{0x65a3dbe7, "PT_OPENBSD_WXNEEDED"}, |
| 824 |
{0x65a41be6, "PT_OPENBSD_BOOTDATA"}, |
| 825 |
{0x6ffffffb, "PT_SUNWSTACK"}, |
| 826 |
{0x6fffffff, "PT_HIOS"}, |
| 827 |
{0x70000000, "PT_LOPROC"}, |
| 828 |
// We don't list the processor-dependent ProgTypes, |
| 829 |
// as the values overlap. |
| 830 |
{0x7fffffff, "PT_HIPROC"}, |
| 831 |
} |
| 832 |
|
| 833 |
func (i ProgType) String() string { return stringName(uint32(i), ptStrings, false) } |
| 834 |
func (i ProgType) GoString() string { return stringName(uint32(i), ptStrings, true) } |
| 835 |
|
| 836 |
// Prog.Flag |
| 837 |
type ProgFlag uint32 |
| 838 |
|
| 839 |
const ( |
| 840 |
PF_X ProgFlag = 0x1 /* Executable. */ |
| 841 |
PF_W ProgFlag = 0x2 /* Writable. */ |
| 842 |
PF_R ProgFlag = 0x4 /* Readable. */ |
| 843 |
PF_MASKOS ProgFlag = 0x0ff00000 /* Operating system-specific. */ |
| 844 |
PF_MASKPROC ProgFlag = 0xf0000000 /* Processor-specific. */ |
| 845 |
) |
| 846 |
|
| 847 |
var pfStrings = []intName{ |
| 848 |
{0x1, "PF_X"}, |
| 849 |
{0x2, "PF_W"}, |
| 850 |
{0x4, "PF_R"}, |
| 851 |
} |
| 852 |
|
| 853 |
func (i ProgFlag) String() string { return flagName(uint32(i), pfStrings, false) } |
| 854 |
func (i ProgFlag) GoString() string { return flagName(uint32(i), pfStrings, true) } |
| 855 |
|
| 856 |
// Dyn.Tag |
| 857 |
type DynTag int |
| 858 |
|
| 859 |
const ( |
| 860 |
DT_NULL DynTag = 0 /* Terminating entry. */ |
| 861 |
DT_NEEDED DynTag = 1 /* String table offset of a needed shared library. */ |
| 862 |
DT_PLTRELSZ DynTag = 2 /* Total size in bytes of PLT relocations. */ |
| 863 |
DT_PLTGOT DynTag = 3 /* Processor-dependent address. */ |
| 864 |
DT_HASH DynTag = 4 /* Address of symbol hash table. */ |
| 865 |
DT_STRTAB DynTag = 5 /* Address of string table. */ |
| 866 |
DT_SYMTAB DynTag = 6 /* Address of symbol table. */ |
| 867 |
DT_RELA DynTag = 7 /* Address of ElfNN_Rela relocations. */ |
| 868 |
DT_RELASZ DynTag = 8 /* Total size of ElfNN_Rela relocations. */ |
| 869 |
DT_RELAENT DynTag = 9 /* Size of each ElfNN_Rela relocation entry. */ |
| 870 |
DT_STRSZ DynTag = 10 /* Size of string table. */ |
| 871 |
DT_SYMENT DynTag = 11 /* Size of each symbol table entry. */ |
| 872 |
DT_INIT DynTag = 12 /* Address of initialization function. */ |
| 873 |
DT_FINI DynTag = 13 /* Address of finalization function. */ |
| 874 |
DT_SONAME DynTag = 14 /* String table offset of shared object name. */ |
| 875 |
DT_RPATH DynTag = 15 /* String table offset of library path. [sup] */ |
| 876 |
DT_SYMBOLIC DynTag = 16 /* Indicates "symbolic" linking. [sup] */ |
| 877 |
DT_REL DynTag = 17 /* Address of ElfNN_Rel relocations. */ |
| 878 |
DT_RELSZ DynTag = 18 /* Total size of ElfNN_Rel relocations. */ |
| 879 |
DT_RELENT DynTag = 19 /* Size of each ElfNN_Rel relocation. */ |
| 880 |
DT_PLTREL DynTag = 20 /* Type of relocation used for PLT. */ |
| 881 |
DT_DEBUG DynTag = 21 /* Reserved (not used). */ |
| 882 |
DT_TEXTREL DynTag = 22 /* Indicates there may be relocations in non-writable segments. [sup] */ |
| 883 |
DT_JMPREL DynTag = 23 /* Address of PLT relocations. */ |
| 884 |
DT_BIND_NOW DynTag = 24 /* [sup] */ |
| 885 |
DT_INIT_ARRAY DynTag = 25 /* Address of the array of pointers to initialization functions */ |
| 886 |
DT_FINI_ARRAY DynTag = 26 /* Address of the array of pointers to termination functions */ |
| 887 |
DT_INIT_ARRAYSZ DynTag = 27 /* Size in bytes of the array of initialization functions. */ |
| 888 |
DT_FINI_ARRAYSZ DynTag = 28 /* Size in bytes of the array of termination functions. */ |
| 889 |
DT_RUNPATH DynTag = 29 /* String table offset of a null-terminated library search path string. */ |
| 890 |
DT_FLAGS DynTag = 30 /* Object specific flag values. */ |
| 891 |
DT_ENCODING DynTag = 32 /* Values greater than or equal to DT_ENCODING |
| 892 |
and less than DT_LOOS follow the rules for |
| 893 |
the interpretation of the d_un union |
| 894 |
as follows: even == 'd_ptr', even == 'd_val' |
| 895 |
or none */ |
| 896 |
DT_PREINIT_ARRAY DynTag = 32 /* Address of the array of pointers to pre-initialization functions. */ |
| 897 |
DT_PREINIT_ARRAYSZ DynTag = 33 /* Size in bytes of the array of pre-initialization functions. */ |
| 898 |
DT_SYMTAB_SHNDX DynTag = 34 /* Address of SHT_SYMTAB_SHNDX section. */ |
| 899 |
|
| 900 |
DT_LOOS DynTag = 0x6000000d /* First OS-specific */ |
| 901 |
DT_HIOS DynTag = 0x6ffff000 /* Last OS-specific */ |
| 902 |
|
| 903 |
DT_VALRNGLO DynTag = 0x6ffffd00 |
| 904 |
DT_GNU_PRELINKED DynTag = 0x6ffffdf5 |
| 905 |
DT_GNU_CONFLICTSZ DynTag = 0x6ffffdf6 |
| 906 |
DT_GNU_LIBLISTSZ DynTag = 0x6ffffdf7 |
| 907 |
DT_CHECKSUM DynTag = 0x6ffffdf8 |
| 908 |
DT_PLTPADSZ DynTag = 0x6ffffdf9 |
| 909 |
DT_MOVEENT DynTag = 0x6ffffdfa |
| 910 |
DT_MOVESZ DynTag = 0x6ffffdfb |
| 911 |
DT_FEATURE DynTag = 0x6ffffdfc |
| 912 |
DT_POSFLAG_1 DynTag = 0x6ffffdfd |
| 913 |
DT_SYMINSZ DynTag = 0x6ffffdfe |
| 914 |
DT_SYMINENT DynTag = 0x6ffffdff |
| 915 |
DT_VALRNGHI DynTag = 0x6ffffdff |
| 916 |
|
| 917 |
DT_ADDRRNGLO DynTag = 0x6ffffe00 |
| 918 |
DT_GNU_HASH DynTag = 0x6ffffef5 |
| 919 |
DT_TLSDESC_PLT DynTag = 0x6ffffef6 |
| 920 |
DT_TLSDESC_GOT DynTag = 0x6ffffef7 |
| 921 |
DT_GNU_CONFLICT DynTag = 0x6ffffef8 |
| 922 |
DT_GNU_LIBLIST DynTag = 0x6ffffef9 |
| 923 |
DT_CONFIG DynTag = 0x6ffffefa |
| 924 |
DT_DEPAUDIT DynTag = 0x6ffffefb |
| 925 |
DT_AUDIT DynTag = 0x6ffffefc |
| 926 |
DT_PLTPAD DynTag = 0x6ffffefd |
| 927 |
DT_MOVETAB DynTag = 0x6ffffefe |
| 928 |
DT_SYMINFO DynTag = 0x6ffffeff |
| 929 |
DT_ADDRRNGHI DynTag = 0x6ffffeff |
| 930 |
|
| 931 |
DT_VERSYM DynTag = 0x6ffffff0 |
| 932 |
DT_RELACOUNT DynTag = 0x6ffffff9 |
| 933 |
DT_RELCOUNT DynTag = 0x6ffffffa |
| 934 |
DT_FLAGS_1 DynTag = 0x6ffffffb |
| 935 |
DT_VERDEF DynTag = 0x6ffffffc |
| 936 |
DT_VERDEFNUM DynTag = 0x6ffffffd |
| 937 |
DT_VERNEED DynTag = 0x6ffffffe |
| 938 |
DT_VERNEEDNUM DynTag = 0x6fffffff |
| 939 |
|
| 940 |
DT_LOPROC DynTag = 0x70000000 /* First processor-specific type. */ |
| 941 |
|
| 942 |
DT_MIPS_RLD_VERSION DynTag = 0x70000001 |
| 943 |
DT_MIPS_TIME_STAMP DynTag = 0x70000002 |
| 944 |
DT_MIPS_ICHECKSUM DynTag = 0x70000003 |
| 945 |
DT_MIPS_IVERSION DynTag = 0x70000004 |
| 946 |
DT_MIPS_FLAGS DynTag = 0x70000005 |
| 947 |
DT_MIPS_BASE_ADDRESS DynTag = 0x70000006 |
| 948 |
DT_MIPS_MSYM DynTag = 0x70000007 |
| 949 |
DT_MIPS_CONFLICT DynTag = 0x70000008 |
| 950 |
DT_MIPS_LIBLIST DynTag = 0x70000009 |
| 951 |
DT_MIPS_LOCAL_GOTNO DynTag = 0x7000000a |
| 952 |
DT_MIPS_CONFLICTNO DynTag = 0x7000000b |
| 953 |
DT_MIPS_LIBLISTNO DynTag = 0x70000010 |
| 954 |
DT_MIPS_SYMTABNO DynTag = 0x70000011 |
| 955 |
DT_MIPS_UNREFEXTNO DynTag = 0x70000012 |
| 956 |
DT_MIPS_GOTSYM DynTag = 0x70000013 |
| 957 |
DT_MIPS_HIPAGENO DynTag = 0x70000014 |
| 958 |
DT_MIPS_RLD_MAP DynTag = 0x70000016 |
| 959 |
DT_MIPS_DELTA_CLASS DynTag = 0x70000017 |
| 960 |
DT_MIPS_DELTA_CLASS_NO DynTag = 0x70000018 |
| 961 |
DT_MIPS_DELTA_INSTANCE DynTag = 0x70000019 |
| 962 |
DT_MIPS_DELTA_INSTANCE_NO DynTag = 0x7000001a |
| 963 |
DT_MIPS_DELTA_RELOC DynTag = 0x7000001b |
| 964 |
DT_MIPS_DELTA_RELOC_NO DynTag = 0x7000001c |
| 965 |
DT_MIPS_DELTA_SYM DynTag = 0x7000001d |
| 966 |
DT_MIPS_DELTA_SYM_NO DynTag = 0x7000001e |
| 967 |
DT_MIPS_DELTA_CLASSSYM DynTag = 0x70000020 |
| 968 |
DT_MIPS_DELTA_CLASSSYM_NO DynTag = 0x70000021 |
| 969 |
DT_MIPS_CXX_FLAGS DynTag = 0x70000022 |
| 970 |
DT_MIPS_PIXIE_INIT DynTag = 0x70000023 |
| 971 |
DT_MIPS_SYMBOL_LIB DynTag = 0x70000024 |
| 972 |
DT_MIPS_LOCALPAGE_GOTIDX DynTag = 0x70000025 |
| 973 |
DT_MIPS_LOCAL_GOTIDX DynTag = 0x70000026 |
| 974 |
DT_MIPS_HIDDEN_GOTIDX DynTag = 0x70000027 |
| 975 |
DT_MIPS_PROTECTED_GOTIDX DynTag = 0x70000028 |
| 976 |
DT_MIPS_OPTIONS DynTag = 0x70000029 |
| 977 |
DT_MIPS_INTERFACE DynTag = 0x7000002a |
| 978 |
DT_MIPS_DYNSTR_ALIGN DynTag = 0x7000002b |
| 979 |
DT_MIPS_INTERFACE_SIZE DynTag = 0x7000002c |
| 980 |
DT_MIPS_RLD_TEXT_RESOLVE_ADDR DynTag = 0x7000002d |
| 981 |
DT_MIPS_PERF_SUFFIX DynTag = 0x7000002e |
| 982 |
DT_MIPS_COMPACT_SIZE DynTag = 0x7000002f |
| 983 |
DT_MIPS_GP_VALUE DynTag = 0x70000030 |
| 984 |
DT_MIPS_AUX_DYNAMIC DynTag = 0x70000031 |
| 985 |
DT_MIPS_PLTGOT DynTag = 0x70000032 |
| 986 |
DT_MIPS_RWPLT DynTag = 0x70000034 |
| 987 |
DT_MIPS_RLD_MAP_REL DynTag = 0x70000035 |
| 988 |
|
| 989 |
DT_PPC_GOT DynTag = 0x70000000 |
| 990 |
DT_PPC_OPT DynTag = 0x70000001 |
| 991 |
|
| 992 |
DT_PPC64_GLINK DynTag = 0x70000000 |
| 993 |
DT_PPC64_OPD DynTag = 0x70000001 |
| 994 |
DT_PPC64_OPDSZ DynTag = 0x70000002 |
| 995 |
DT_PPC64_OPT DynTag = 0x70000003 |
| 996 |
|
| 997 |
DT_SPARC_REGISTER DynTag = 0x70000001 |
| 998 |
|
| 999 |
DT_AUXILIARY DynTag = 0x7ffffffd |
| 1000 |
DT_USED DynTag = 0x7ffffffe |
| 1001 |
DT_FILTER DynTag = 0x7fffffff |
| 1002 |
|
| 1003 |
DT_HIPROC DynTag = 0x7fffffff /* Last processor-specific type. */ |
| 1004 |
) |
| 1005 |
|
| 1006 |
var dtStrings = []intName{ |
| 1007 |
{0, "DT_NULL"}, |
| 1008 |
{1, "DT_NEEDED"}, |
| 1009 |
{2, "DT_PLTRELSZ"}, |
| 1010 |
{3, "DT_PLTGOT"}, |
| 1011 |
{4, "DT_HASH"}, |
| 1012 |
{5, "DT_STRTAB"}, |
| 1013 |
{6, "DT_SYMTAB"}, |
| 1014 |
{7, "DT_RELA"}, |
| 1015 |
{8, "DT_RELASZ"}, |
| 1016 |
{9, "DT_RELAENT"}, |
| 1017 |
{10, "DT_STRSZ"}, |
| 1018 |
{11, "DT_SYMENT"}, |
| 1019 |
{12, "DT_INIT"}, |
| 1020 |
{13, "DT_FINI"}, |
| 1021 |
{14, "DT_SONAME"}, |
| 1022 |
{15, "DT_RPATH"}, |
| 1023 |
{16, "DT_SYMBOLIC"}, |
| 1024 |
{17, "DT_REL"}, |
| 1025 |
{18, "DT_RELSZ"}, |
| 1026 |
{19, "DT_RELENT"}, |
| 1027 |
{20, "DT_PLTREL"}, |
| 1028 |
{21, "DT_DEBUG"}, |
| 1029 |
{22, "DT_TEXTREL"}, |
| 1030 |
{23, "DT_JMPREL"}, |
| 1031 |
{24, "DT_BIND_NOW"}, |
| 1032 |
{25, "DT_INIT_ARRAY"}, |
| 1033 |
{26, "DT_FINI_ARRAY"}, |
| 1034 |
{27, "DT_INIT_ARRAYSZ"}, |
| 1035 |
{28, "DT_FINI_ARRAYSZ"}, |
| 1036 |
{29, "DT_RUNPATH"}, |
| 1037 |
{30, "DT_FLAGS"}, |
| 1038 |
{32, "DT_ENCODING"}, |
| 1039 |
{32, "DT_PREINIT_ARRAY"}, |
| 1040 |
{33, "DT_PREINIT_ARRAYSZ"}, |
| 1041 |
{34, "DT_SYMTAB_SHNDX"}, |
| 1042 |
{0x6000000d, "DT_LOOS"}, |
| 1043 |
{0x6ffff000, "DT_HIOS"}, |
| 1044 |
{0x6ffffd00, "DT_VALRNGLO"}, |
| 1045 |
{0x6ffffdf5, "DT_GNU_PRELINKED"}, |
| 1046 |
{0x6ffffdf6, "DT_GNU_CONFLICTSZ"}, |
| 1047 |
{0x6ffffdf7, "DT_GNU_LIBLISTSZ"}, |
| 1048 |
{0x6ffffdf8, "DT_CHECKSUM"}, |
| 1049 |
{0x6ffffdf9, "DT_PLTPADSZ"}, |
| 1050 |
{0x6ffffdfa, "DT_MOVEENT"}, |
| 1051 |
{0x6ffffdfb, "DT_MOVESZ"}, |
| 1052 |
{0x6ffffdfc, "DT_FEATURE"}, |
| 1053 |
{0x6ffffdfd, "DT_POSFLAG_1"}, |
| 1054 |
{0x6ffffdfe, "DT_SYMINSZ"}, |
| 1055 |
{0x6ffffdff, "DT_SYMINENT"}, |
| 1056 |
{0x6ffffdff, "DT_VALRNGHI"}, |
| 1057 |
{0x6ffffe00, "DT_ADDRRNGLO"}, |
| 1058 |
{0x6ffffef5, "DT_GNU_HASH"}, |
| 1059 |
{0x6ffffef6, "DT_TLSDESC_PLT"}, |
| 1060 |
{0x6ffffef7, "DT_TLSDESC_GOT"}, |
| 1061 |
{0x6ffffef8, "DT_GNU_CONFLICT"}, |
| 1062 |
{0x6ffffef9, "DT_GNU_LIBLIST"}, |
| 1063 |
{0x6ffffefa, "DT_CONFIG"}, |
| 1064 |
{0x6ffffefb, "DT_DEPAUDIT"}, |
| 1065 |
{0x6ffffefc, "DT_AUDIT"}, |
| 1066 |
{0x6ffffefd, "DT_PLTPAD"}, |
| 1067 |
{0x6ffffefe, "DT_MOVETAB"}, |
| 1068 |
{0x6ffffeff, "DT_SYMINFO"}, |
| 1069 |
{0x6ffffeff, "DT_ADDRRNGHI"}, |
| 1070 |
{0x6ffffff0, "DT_VERSYM"}, |
| 1071 |
{0x6ffffff9, "DT_RELACOUNT"}, |
| 1072 |
{0x6ffffffa, "DT_RELCOUNT"}, |
| 1073 |
{0x6ffffffb, "DT_FLAGS_1"}, |
| 1074 |
{0x6ffffffc, "DT_VERDEF"}, |
| 1075 |
{0x6ffffffd, "DT_VERDEFNUM"}, |
| 1076 |
{0x6ffffffe, "DT_VERNEED"}, |
| 1077 |
{0x6fffffff, "DT_VERNEEDNUM"}, |
| 1078 |
{0x70000000, "DT_LOPROC"}, |
| 1079 |
// We don't list the processor-dependent DynTags, |
| 1080 |
// as the values overlap. |
| 1081 |
{0x7ffffffd, "DT_AUXILIARY"}, |
| 1082 |
{0x7ffffffe, "DT_USED"}, |
| 1083 |
{0x7fffffff, "DT_FILTER"}, |
| 1084 |
} |
| 1085 |
|
| 1086 |
func (i DynTag) String() string { return stringName(uint32(i), dtStrings, false) } |
| 1087 |
func (i DynTag) GoString() string { return stringName(uint32(i), dtStrings, true) } |
| 1088 |
|
| 1089 |
// DT_FLAGS values. |
| 1090 |
type DynFlag int |
| 1091 |
|
| 1092 |
const ( |
| 1093 |
DF_ORIGIN DynFlag = 0x0001 /* Indicates that the object being loaded may |
| 1094 |
make reference to the |
| 1095 |
$ORIGIN substitution string */ |
| 1096 |
DF_SYMBOLIC DynFlag = 0x0002 /* Indicates "symbolic" linking. */ |
| 1097 |
DF_TEXTREL DynFlag = 0x0004 /* Indicates there may be relocations in non-writable segments. */ |
| 1098 |
DF_BIND_NOW DynFlag = 0x0008 /* Indicates that the dynamic linker should |
| 1099 |
process all relocations for the object |
| 1100 |
containing this entry before transferring |
| 1101 |
control to the program. */ |
| 1102 |
DF_STATIC_TLS DynFlag = 0x0010 /* Indicates that the shared object or |
| 1103 |
executable contains code using a static |
| 1104 |
thread-local storage scheme. */ |
| 1105 |
) |
| 1106 |
|
| 1107 |
var dflagStrings = []intName{ |
| 1108 |
{0x0001, "DF_ORIGIN"}, |
| 1109 |
{0x0002, "DF_SYMBOLIC"}, |
| 1110 |
{0x0004, "DF_TEXTREL"}, |
| 1111 |
{0x0008, "DF_BIND_NOW"}, |
| 1112 |
{0x0010, "DF_STATIC_TLS"}, |
| 1113 |
} |
| 1114 |
|
| 1115 |
func (i DynFlag) String() string { return flagName(uint32(i), dflagStrings, false) } |
| 1116 |
func (i DynFlag) GoString() string { return flagName(uint32(i), dflagStrings, true) } |
| 1117 |
|
| 1118 |
// DT_FLAGS_1 values. |
| 1119 |
type DynFlag1 uint32 |
| 1120 |
|
| 1121 |
const ( |
| 1122 |
// Indicates that all relocations for this object must be processed before |
| 1123 |
// returning control to the program. |
| 1124 |
DF_1_NOW DynFlag1 = 0x00000001 |
| 1125 |
// Unused. |
| 1126 |
DF_1_GLOBAL DynFlag1 = 0x00000002 |
| 1127 |
// Indicates that the object is a member of a group. |
| 1128 |
DF_1_GROUP DynFlag1 = 0x00000004 |
| 1129 |
// Indicates that the object cannot be deleted from a process. |
| 1130 |
DF_1_NODELETE DynFlag1 = 0x00000008 |
| 1131 |
// Meaningful only for filters. Indicates that all associated filtees be |
| 1132 |
// processed immediately. |
| 1133 |
DF_1_LOADFLTR DynFlag1 = 0x00000010 |
| 1134 |
// Indicates that this object's initialization section be run before any other |
| 1135 |
// objects loaded. |
| 1136 |
DF_1_INITFIRST DynFlag1 = 0x00000020 |
| 1137 |
// Indicates that the object cannot be added to a running process with dlopen. |
| 1138 |
DF_1_NOOPEN DynFlag1 = 0x00000040 |
| 1139 |
// Indicates the object requires $ORIGIN processing. |
| 1140 |
DF_1_ORIGIN DynFlag1 = 0x00000080 |
| 1141 |
// Indicates that the object should use direct binding information. |
| 1142 |
DF_1_DIRECT DynFlag1 = 0x00000100 |
| 1143 |
// Unused. |
| 1144 |
DF_1_TRANS DynFlag1 = 0x00000200 |
| 1145 |
// Indicates that the objects symbol table is to interpose before all symbols |
| 1146 |
// except the primary load object, which is typically the executable. |
| 1147 |
DF_1_INTERPOSE DynFlag1 = 0x00000400 |
| 1148 |
// Indicates that the search for dependencies of this object ignores any |
| 1149 |
// default library search paths. |
| 1150 |
DF_1_NODEFLIB DynFlag1 = 0x00000800 |
| 1151 |
// Indicates that this object is not dumped by dldump. Candidates are objects |
| 1152 |
// with no relocations that might get included when generating alternative |
| 1153 |
// objects using. |
| 1154 |
DF_1_NODUMP DynFlag1 = 0x00001000 |
| 1155 |
// Identifies this object as a configuration alternative object generated by |
| 1156 |
// crle. Triggers the runtime linker to search for a configuration file $ORIGIN/ld.config.app-name. |
| 1157 |
DF_1_CONFALT DynFlag1 = 0x00002000 |
| 1158 |
// Meaningful only for filtees. Terminates a filters search for any |
| 1159 |
// further filtees. |
| 1160 |
DF_1_ENDFILTEE DynFlag1 = 0x00004000 |
| 1161 |
// Indicates that this object has displacement relocations applied. |
| 1162 |
DF_1_DISPRELDNE DynFlag1 = 0x00008000 |
| 1163 |
// Indicates that this object has displacement relocations pending. |
| 1164 |
DF_1_DISPRELPND DynFlag1 = 0x00010000 |
| 1165 |
// Indicates that this object contains symbols that cannot be directly |
| 1166 |
// bound to. |
| 1167 |
DF_1_NODIRECT DynFlag1 = 0x00020000 |
| 1168 |
// Reserved for internal use by the kernel runtime-linker. |
| 1169 |
DF_1_IGNMULDEF DynFlag1 = 0x00040000 |
| 1170 |
// Reserved for internal use by the kernel runtime-linker. |
| 1171 |
DF_1_NOKSYMS DynFlag1 = 0x00080000 |
| 1172 |
// Reserved for internal use by the kernel runtime-linker. |
| 1173 |
DF_1_NOHDR DynFlag1 = 0x00100000 |
| 1174 |
// Indicates that this object has been edited or has been modified since the |
| 1175 |
// objects original construction by the link-editor. |
| 1176 |
DF_1_EDITED DynFlag1 = 0x00200000 |
| 1177 |
// Reserved for internal use by the kernel runtime-linker. |
| 1178 |
DF_1_NORELOC DynFlag1 = 0x00400000 |
| 1179 |
// Indicates that the object contains individual symbols that should interpose |
| 1180 |
// before all symbols except the primary load object, which is typically the |
| 1181 |
// executable. |
| 1182 |
DF_1_SYMINTPOSE DynFlag1 = 0x00800000 |
| 1183 |
// Indicates that the executable requires global auditing. |
| 1184 |
DF_1_GLOBAUDIT DynFlag1 = 0x01000000 |
| 1185 |
// Indicates that the object defines, or makes reference to singleton symbols. |
| 1186 |
DF_1_SINGLETON DynFlag1 = 0x02000000 |
| 1187 |
// Indicates that the object is a stub. |
| 1188 |
DF_1_STUB DynFlag1 = 0x04000000 |
| 1189 |
// Indicates that the object is a position-independent executable. |
| 1190 |
DF_1_PIE DynFlag1 = 0x08000000 |
| 1191 |
// Indicates that the object is a kernel module. |
| 1192 |
DF_1_KMOD DynFlag1 = 0x10000000 |
| 1193 |
// Indicates that the object is a weak standard filter. |
| 1194 |
DF_1_WEAKFILTER DynFlag1 = 0x20000000 |
| 1195 |
// Unused. |
| 1196 |
DF_1_NOCOMMON DynFlag1 = 0x40000000 |
| 1197 |
) |
| 1198 |
|
| 1199 |
var dflag1Strings = []intName{ |
| 1200 |
{0x00000001, "DF_1_NOW"}, |
| 1201 |
{0x00000002, "DF_1_GLOBAL"}, |
| 1202 |
{0x00000004, "DF_1_GROUP"}, |
| 1203 |
{0x00000008, "DF_1_NODELETE"}, |
| 1204 |
{0x00000010, "DF_1_LOADFLTR"}, |
| 1205 |
{0x00000020, "DF_1_INITFIRST"}, |
| 1206 |
{0x00000040, "DF_1_NOOPEN"}, |
| 1207 |
{0x00000080, "DF_1_ORIGIN"}, |
| 1208 |
{0x00000100, "DF_1_DIRECT"}, |
| 1209 |
{0x00000200, "DF_1_TRANS"}, |
| 1210 |
{0x00000400, "DF_1_INTERPOSE"}, |
| 1211 |
{0x00000800, "DF_1_NODEFLIB"}, |
| 1212 |
{0x00001000, "DF_1_NODUMP"}, |
| 1213 |
{0x00002000, "DF_1_CONFALT"}, |
| 1214 |
{0x00004000, "DF_1_ENDFILTEE"}, |
| 1215 |
{0x00008000, "DF_1_DISPRELDNE"}, |
| 1216 |
{0x00010000, "DF_1_DISPRELPND"}, |
| 1217 |
{0x00020000, "DF_1_NODIRECT"}, |
| 1218 |
{0x00040000, "DF_1_IGNMULDEF"}, |
| 1219 |
{0x00080000, "DF_1_NOKSYMS"}, |
| 1220 |
{0x00100000, "DF_1_NOHDR"}, |
| 1221 |
{0x00200000, "DF_1_EDITED"}, |
| 1222 |
{0x00400000, "DF_1_NORELOC"}, |
| 1223 |
{0x00800000, "DF_1_SYMINTPOSE"}, |
| 1224 |
{0x01000000, "DF_1_GLOBAUDIT"}, |
| 1225 |
{0x02000000, "DF_1_SINGLETON"}, |
| 1226 |
{0x04000000, "DF_1_STUB"}, |
| 1227 |
{0x08000000, "DF_1_PIE"}, |
| 1228 |
{0x10000000, "DF_1_KMOD"}, |
| 1229 |
{0x20000000, "DF_1_WEAKFILTER"}, |
| 1230 |
{0x40000000, "DF_1_NOCOMMON"}, |
| 1231 |
} |
| 1232 |
|
| 1233 |
func (i DynFlag1) String() string { return flagName(uint32(i), dflag1Strings, false) } |
| 1234 |
func (i DynFlag1) GoString() string { return flagName(uint32(i), dflag1Strings, true) } |
| 1235 |
|
| 1236 |
// NType values; used in core files. |
| 1237 |
type NType int |
| 1238 |
|
| 1239 |
const ( |
| 1240 |
NT_PRSTATUS NType = 1 /* Process status. */ |
| 1241 |
NT_FPREGSET NType = 2 /* Floating point registers. */ |
| 1242 |
NT_PRPSINFO NType = 3 /* Process state info. */ |
| 1243 |
) |
| 1244 |
|
| 1245 |
var ntypeStrings = []intName{ |
| 1246 |
{1, "NT_PRSTATUS"}, |
| 1247 |
{2, "NT_FPREGSET"}, |
| 1248 |
{3, "NT_PRPSINFO"}, |
| 1249 |
} |
| 1250 |
|
| 1251 |
func (i NType) String() string { return stringName(uint32(i), ntypeStrings, false) } |
| 1252 |
func (i NType) GoString() string { return stringName(uint32(i), ntypeStrings, true) } |
| 1253 |
|
| 1254 |
/* Symbol Binding - ELFNN_ST_BIND - st_info */ |
| 1255 |
type SymBind int |
| 1256 |
|
| 1257 |
const ( |
| 1258 |
STB_LOCAL SymBind = 0 /* Local symbol */ |
| 1259 |
STB_GLOBAL SymBind = 1 /* Global symbol */ |
| 1260 |
STB_WEAK SymBind = 2 /* like global - lower precedence */ |
| 1261 |
STB_LOOS SymBind = 10 /* Reserved range for operating system */ |
| 1262 |
STB_HIOS SymBind = 12 /* specific semantics. */ |
| 1263 |
STB_LOPROC SymBind = 13 /* reserved range for processor */ |
| 1264 |
STB_HIPROC SymBind = 15 /* specific semantics. */ |
| 1265 |
) |
| 1266 |
|
| 1267 |
var stbStrings = []intName{ |
| 1268 |
{0, "STB_LOCAL"}, |
| 1269 |
{1, "STB_GLOBAL"}, |
| 1270 |
{2, "STB_WEAK"}, |
| 1271 |
{10, "STB_LOOS"}, |
| 1272 |
{12, "STB_HIOS"}, |
| 1273 |
{13, "STB_LOPROC"}, |
| 1274 |
{15, "STB_HIPROC"}, |
| 1275 |
} |
| 1276 |
|
| 1277 |
func (i SymBind) String() string { return stringName(uint32(i), stbStrings, false) } |
| 1278 |
func (i SymBind) GoString() string { return stringName(uint32(i), stbStrings, true) } |
| 1279 |
|
| 1280 |
/* Symbol type - ELFNN_ST_TYPE - st_info */ |
| 1281 |
type SymType int |
| 1282 |
|
| 1283 |
const ( |
| 1284 |
STT_NOTYPE SymType = 0 /* Unspecified type. */ |
| 1285 |
STT_OBJECT SymType = 1 /* Data object. */ |
| 1286 |
STT_FUNC SymType = 2 /* Function. */ |
| 1287 |
STT_SECTION SymType = 3 /* Section. */ |
| 1288 |
STT_FILE SymType = 4 /* Source file. */ |
| 1289 |
STT_COMMON SymType = 5 /* Uninitialized common block. */ |
| 1290 |
STT_TLS SymType = 6 /* TLS object. */ |
| 1291 |
STT_LOOS SymType = 10 /* Reserved range for operating system */ |
| 1292 |
STT_HIOS SymType = 12 /* specific semantics. */ |
| 1293 |
STT_LOPROC SymType = 13 /* reserved range for processor */ |
| 1294 |
STT_HIPROC SymType = 15 /* specific semantics. */ |
| 1295 |
|
| 1296 |
/* Non-standard symbol types. */ |
| 1297 |
STT_RELC SymType = 8 /* Complex relocation expression. */ |
| 1298 |
STT_SRELC SymType = 9 /* Signed complex relocation expression. */ |
| 1299 |
STT_GNU_IFUNC SymType = 10 /* Indirect code object. */ |
| 1300 |
) |
| 1301 |
|
| 1302 |
var sttStrings = []intName{ |
| 1303 |
{0, "STT_NOTYPE"}, |
| 1304 |
{1, "STT_OBJECT"}, |
| 1305 |
{2, "STT_FUNC"}, |
| 1306 |
{3, "STT_SECTION"}, |
| 1307 |
{4, "STT_FILE"}, |
| 1308 |
{5, "STT_COMMON"}, |
| 1309 |
{6, "STT_TLS"}, |
| 1310 |
{8, "STT_RELC"}, |
| 1311 |
{9, "STT_SRELC"}, |
| 1312 |
{10, "STT_LOOS"}, |
| 1313 |
{12, "STT_HIOS"}, |
| 1314 |
{13, "STT_LOPROC"}, |
| 1315 |
{15, "STT_HIPROC"}, |
| 1316 |
} |
| 1317 |
|
| 1318 |
func (i SymType) String() string { return stringName(uint32(i), sttStrings, false) } |
| 1319 |
func (i SymType) GoString() string { return stringName(uint32(i), sttStrings, true) } |
| 1320 |
|
| 1321 |
/* Symbol visibility - ELFNN_ST_VISIBILITY - st_other */ |
| 1322 |
type SymVis int |
| 1323 |
|
| 1324 |
const ( |
| 1325 |
STV_DEFAULT SymVis = 0x0 /* Default visibility (see binding). */ |
| 1326 |
STV_INTERNAL SymVis = 0x1 /* Special meaning in relocatable objects. */ |
| 1327 |
STV_HIDDEN SymVis = 0x2 /* Not visible. */ |
| 1328 |
STV_PROTECTED SymVis = 0x3 /* Visible but not preemptible. */ |
| 1329 |
) |
| 1330 |
|
| 1331 |
var stvStrings = []intName{ |
| 1332 |
{0x0, "STV_DEFAULT"}, |
| 1333 |
{0x1, "STV_INTERNAL"}, |
| 1334 |
{0x2, "STV_HIDDEN"}, |
| 1335 |
{0x3, "STV_PROTECTED"}, |
| 1336 |
} |
| 1337 |
|
| 1338 |
func (i SymVis) String() string { return stringName(uint32(i), stvStrings, false) } |
| 1339 |
func (i SymVis) GoString() string { return stringName(uint32(i), stvStrings, true) } |
| 1340 |
|
| 1341 |
/* |
| 1342 |
* Relocation types. |
| 1343 |
*/ |
| 1344 |
|
| 1345 |
// Relocation types for x86-64. |
| 1346 |
type R_X86_64 int |
| 1347 |
|
| 1348 |
const ( |
| 1349 |
R_X86_64_NONE R_X86_64 = 0 /* No relocation. */ |
| 1350 |
R_X86_64_64 R_X86_64 = 1 /* Add 64 bit symbol value. */ |
| 1351 |
R_X86_64_PC32 R_X86_64 = 2 /* PC-relative 32 bit signed sym value. */ |
| 1352 |
R_X86_64_GOT32 R_X86_64 = 3 /* PC-relative 32 bit GOT offset. */ |
| 1353 |
R_X86_64_PLT32 R_X86_64 = 4 /* PC-relative 32 bit PLT offset. */ |
| 1354 |
R_X86_64_COPY R_X86_64 = 5 /* Copy data from shared object. */ |
| 1355 |
R_X86_64_GLOB_DAT R_X86_64 = 6 /* Set GOT entry to data address. */ |
| 1356 |
R_X86_64_JMP_SLOT R_X86_64 = 7 /* Set GOT entry to code address. */ |
| 1357 |
R_X86_64_RELATIVE R_X86_64 = 8 /* Add load address of shared object. */ |
| 1358 |
R_X86_64_GOTPCREL R_X86_64 = 9 /* Add 32 bit signed pcrel offset to GOT. */ |
| 1359 |
R_X86_64_32 R_X86_64 = 10 /* Add 32 bit zero extended symbol value */ |
| 1360 |
R_X86_64_32S R_X86_64 = 11 /* Add 32 bit sign extended symbol value */ |
| 1361 |
R_X86_64_16 R_X86_64 = 12 /* Add 16 bit zero extended symbol value */ |
| 1362 |
R_X86_64_PC16 R_X86_64 = 13 /* Add 16 bit signed extended pc relative symbol value */ |
| 1363 |
R_X86_64_8 R_X86_64 = 14 /* Add 8 bit zero extended symbol value */ |
| 1364 |
R_X86_64_PC8 R_X86_64 = 15 /* Add 8 bit signed extended pc relative symbol value */ |
| 1365 |
R_X86_64_DTPMOD64 R_X86_64 = 16 /* ID of module containing symbol */ |
| 1366 |
R_X86_64_DTPOFF64 R_X86_64 = 17 /* Offset in TLS block */ |
| 1367 |
R_X86_64_TPOFF64 R_X86_64 = 18 /* Offset in static TLS block */ |
| 1368 |
R_X86_64_TLSGD R_X86_64 = 19 /* PC relative offset to GD GOT entry */ |
| 1369 |
R_X86_64_TLSLD R_X86_64 = 20 /* PC relative offset to LD GOT entry */ |
| 1370 |
R_X86_64_DTPOFF32 R_X86_64 = 21 /* Offset in TLS block */ |
| 1371 |
R_X86_64_GOTTPOFF R_X86_64 = 22 /* PC relative offset to IE GOT entry */ |
| 1372 |
R_X86_64_TPOFF32 R_X86_64 = 23 /* Offset in static TLS block */ |
| 1373 |
R_X86_64_PC64 R_X86_64 = 24 /* PC relative 64-bit sign extended symbol value. */ |
| 1374 |
R_X86_64_GOTOFF64 R_X86_64 = 25 |
| 1375 |
R_X86_64_GOTPC32 R_X86_64 = 26 |
| 1376 |
R_X86_64_GOT64 R_X86_64 = 27 |
| 1377 |
R_X86_64_GOTPCREL64 R_X86_64 = 28 |
| 1378 |
R_X86_64_GOTPC64 R_X86_64 = 29 |
| 1379 |
R_X86_64_GOTPLT64 R_X86_64 = 30 |
| 1380 |
R_X86_64_PLTOFF64 R_X86_64 = 31 |
| 1381 |
R_X86_64_SIZE32 R_X86_64 = 32 |
| 1382 |
R_X86_64_SIZE64 R_X86_64 = 33 |
| 1383 |
R_X86_64_GOTPC32_TLSDESC R_X86_64 = 34 |
| 1384 |
R_X86_64_TLSDESC_CALL R_X86_64 = 35 |
| 1385 |
R_X86_64_TLSDESC R_X86_64 = 36 |
| 1386 |
R_X86_64_IRELATIVE R_X86_64 = 37 |
| 1387 |
R_X86_64_RELATIVE64 R_X86_64 = 38 |
| 1388 |
R_X86_64_PC32_BND R_X86_64 = 39 |
| 1389 |
R_X86_64_PLT32_BND R_X86_64 = 40 |
| 1390 |
R_X86_64_GOTPCRELX R_X86_64 = 41 |
| 1391 |
R_X86_64_REX_GOTPCRELX R_X86_64 = 42 |
| 1392 |
) |
| 1393 |
|
| 1394 |
var rx86_64Strings = []intName{ |
| 1395 |
{0, "R_X86_64_NONE"}, |
| 1396 |
{1, "R_X86_64_64"}, |
| 1397 |
{2, "R_X86_64_PC32"}, |
| 1398 |
{3, "R_X86_64_GOT32"}, |
| 1399 |
{4, "R_X86_64_PLT32"}, |
| 1400 |
{5, "R_X86_64_COPY"}, |
| 1401 |
{6, "R_X86_64_GLOB_DAT"}, |
| 1402 |
{7, "R_X86_64_JMP_SLOT"}, |
| 1403 |
{8, "R_X86_64_RELATIVE"}, |
| 1404 |
{9, "R_X86_64_GOTPCREL"}, |
| 1405 |
{10, "R_X86_64_32"}, |
| 1406 |
{11, "R_X86_64_32S"}, |
| 1407 |
{12, "R_X86_64_16"}, |
| 1408 |
{13, "R_X86_64_PC16"}, |
| 1409 |
{14, "R_X86_64_8"}, |
| 1410 |
{15, "R_X86_64_PC8"}, |
| 1411 |
{16, "R_X86_64_DTPMOD64"}, |
| 1412 |
{17, "R_X86_64_DTPOFF64"}, |
| 1413 |
{18, "R_X86_64_TPOFF64"}, |
| 1414 |
{19, "R_X86_64_TLSGD"}, |
| 1415 |
{20, "R_X86_64_TLSLD"}, |
| 1416 |
{21, "R_X86_64_DTPOFF32"}, |
| 1417 |
{22, "R_X86_64_GOTTPOFF"}, |
| 1418 |
{23, "R_X86_64_TPOFF32"}, |
| 1419 |
{24, "R_X86_64_PC64"}, |
| 1420 |
{25, "R_X86_64_GOTOFF64"}, |
| 1421 |
{26, "R_X86_64_GOTPC32"}, |
| 1422 |
{27, "R_X86_64_GOT64"}, |
| 1423 |
{28, "R_X86_64_GOTPCREL64"}, |
| 1424 |
{29, "R_X86_64_GOTPC64"}, |
| 1425 |
{30, "R_X86_64_GOTPLT64"}, |
| 1426 |
{31, "R_X86_64_PLTOFF64"}, |
| 1427 |
{32, "R_X86_64_SIZE32"}, |
| 1428 |
{33, "R_X86_64_SIZE64"}, |
| 1429 |
{34, "R_X86_64_GOTPC32_TLSDESC"}, |
| 1430 |
{35, "R_X86_64_TLSDESC_CALL"}, |
| 1431 |
{36, "R_X86_64_TLSDESC"}, |
| 1432 |
{37, "R_X86_64_IRELATIVE"}, |
| 1433 |
{38, "R_X86_64_RELATIVE64"}, |
| 1434 |
{39, "R_X86_64_PC32_BND"}, |
| 1435 |
{40, "R_X86_64_PLT32_BND"}, |
| 1436 |
{41, "R_X86_64_GOTPCRELX"}, |
| 1437 |
{42, "R_X86_64_REX_GOTPCRELX"}, |
| 1438 |
} |
| 1439 |
|
| 1440 |
func (i R_X86_64) String() string { return stringName(uint32(i), rx86_64Strings, false) } |
| 1441 |
func (i R_X86_64) GoString() string { return stringName(uint32(i), rx86_64Strings, true) } |
| 1442 |
|
| 1443 |
// Relocation types for AArch64 (aka arm64) |
| 1444 |
type R_AARCH64 int |
| 1445 |
|
| 1446 |
const ( |
| 1447 |
R_AARCH64_NONE R_AARCH64 = 0 |
| 1448 |
R_AARCH64_P32_ABS32 R_AARCH64 = 1 |
| 1449 |
R_AARCH64_P32_ABS16 R_AARCH64 = 2 |
| 1450 |
R_AARCH64_P32_PREL32 R_AARCH64 = 3 |
| 1451 |
R_AARCH64_P32_PREL16 R_AARCH64 = 4 |
| 1452 |
R_AARCH64_P32_MOVW_UABS_G0 R_AARCH64 = 5 |
| 1453 |
R_AARCH64_P32_MOVW_UABS_G0_NC R_AARCH64 = 6 |
| 1454 |
R_AARCH64_P32_MOVW_UABS_G1 R_AARCH64 = 7 |
| 1455 |
R_AARCH64_P32_MOVW_SABS_G0 R_AARCH64 = 8 |
| 1456 |
R_AARCH64_P32_LD_PREL_LO19 R_AARCH64 = 9 |
| 1457 |
R_AARCH64_P32_ADR_PREL_LO21 R_AARCH64 = 10 |
| 1458 |
R_AARCH64_P32_ADR_PREL_PG_HI21 R_AARCH64 = 11 |
| 1459 |
R_AARCH64_P32_ADD_ABS_LO12_NC R_AARCH64 = 12 |
| 1460 |
R_AARCH64_P32_LDST8_ABS_LO12_NC R_AARCH64 = 13 |
| 1461 |
R_AARCH64_P32_LDST16_ABS_LO12_NC R_AARCH64 = 14 |
| 1462 |
R_AARCH64_P32_LDST32_ABS_LO12_NC R_AARCH64 = 15 |
| 1463 |
R_AARCH64_P32_LDST64_ABS_LO12_NC R_AARCH64 = 16 |
| 1464 |
R_AARCH64_P32_LDST128_ABS_LO12_NC R_AARCH64 = 17 |
| 1465 |
R_AARCH64_P32_TSTBR14 R_AARCH64 = 18 |
| 1466 |
R_AARCH64_P32_CONDBR19 R_AARCH64 = 19 |
| 1467 |
R_AARCH64_P32_JUMP26 R_AARCH64 = 20 |
| 1468 |
R_AARCH64_P32_CALL26 R_AARCH64 = 21 |
| 1469 |
R_AARCH64_P32_GOT_LD_PREL19 R_AARCH64 = 25 |
| 1470 |
R_AARCH64_P32_ADR_GOT_PAGE R_AARCH64 = 26 |
| 1471 |
R_AARCH64_P32_LD32_GOT_LO12_NC R_AARCH64 = 27 |
| 1472 |
R_AARCH64_P32_TLSGD_ADR_PAGE21 R_AARCH64 = 81 |
| 1473 |
R_AARCH64_P32_TLSGD_ADD_LO12_NC R_AARCH64 = 82 |
| 1474 |
R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21 R_AARCH64 = 103 |
| 1475 |
R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC R_AARCH64 = 104 |
| 1476 |
R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19 R_AARCH64 = 105 |
| 1477 |
R_AARCH64_P32_TLSLE_MOVW_TPREL_G1 R_AARCH64 = 106 |
| 1478 |
R_AARCH64_P32_TLSLE_MOVW_TPREL_G0 R_AARCH64 = 107 |
| 1479 |
R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC R_AARCH64 = 108 |
| 1480 |
R_AARCH64_P32_TLSLE_ADD_TPREL_HI12 R_AARCH64 = 109 |
| 1481 |
R_AARCH64_P32_TLSLE_ADD_TPREL_LO12 R_AARCH64 = 110 |
| 1482 |
R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC R_AARCH64 = 111 |
| 1483 |
R_AARCH64_P32_TLSDESC_LD_PREL19 R_AARCH64 = 122 |
| 1484 |
R_AARCH64_P32_TLSDESC_ADR_PREL21 R_AARCH64 = 123 |
| 1485 |
R_AARCH64_P32_TLSDESC_ADR_PAGE21 R_AARCH64 = 124 |
| 1486 |
R_AARCH64_P32_TLSDESC_LD32_LO12_NC R_AARCH64 = 125 |
| 1487 |
R_AARCH64_P32_TLSDESC_ADD_LO12_NC R_AARCH64 = 126 |
| 1488 |
R_AARCH64_P32_TLSDESC_CALL R_AARCH64 = 127 |
| 1489 |
R_AARCH64_P32_COPY R_AARCH64 = 180 |
| 1490 |
R_AARCH64_P32_GLOB_DAT R_AARCH64 = 181 |
| 1491 |
R_AARCH64_P32_JUMP_SLOT R_AARCH64 = 182 |
| 1492 |
R_AARCH64_P32_RELATIVE R_AARCH64 = 183 |
| 1493 |
R_AARCH64_P32_TLS_DTPMOD R_AARCH64 = 184 |
| 1494 |
R_AARCH64_P32_TLS_DTPREL R_AARCH64 = 185 |
| 1495 |
R_AARCH64_P32_TLS_TPREL R_AARCH64 = 186 |
| 1496 |
R_AARCH64_P32_TLSDESC R_AARCH64 = 187 |
| 1497 |
R_AARCH64_P32_IRELATIVE R_AARCH64 = 188 |
| 1498 |
R_AARCH64_NULL R_AARCH64 = 256 |
| 1499 |
R_AARCH64_ABS64 R_AARCH64 = 257 |
| 1500 |
R_AARCH64_ABS32 R_AARCH64 = 258 |
| 1501 |
R_AARCH64_ABS16 R_AARCH64 = 259 |
| 1502 |
R_AARCH64_PREL64 R_AARCH64 = 260 |
| 1503 |
R_AARCH64_PREL32 R_AARCH64 = 261 |
| 1504 |
R_AARCH64_PREL16 R_AARCH64 = 262 |
| 1505 |
R_AARCH64_MOVW_UABS_G0 R_AARCH64 = 263 |
| 1506 |
R_AARCH64_MOVW_UABS_G0_NC R_AARCH64 = 264 |
| 1507 |
R_AARCH64_MOVW_UABS_G1 R_AARCH64 = 265 |
| 1508 |
R_AARCH64_MOVW_UABS_G1_NC R_AARCH64 = 266 |
| 1509 |
R_AARCH64_MOVW_UABS_G2 R_AARCH64 = 267 |
| 1510 |
R_AARCH64_MOVW_UABS_G2_NC R_AARCH64 = 268 |
| 1511 |
R_AARCH64_MOVW_UABS_G3 R_AARCH64 = 269 |
| 1512 |
R_AARCH64_MOVW_SABS_G0 R_AARCH64 = 270 |
| 1513 |
R_AARCH64_MOVW_SABS_G1 R_AARCH64 = 271 |
| 1514 |
R_AARCH64_MOVW_SABS_G2 R_AARCH64 = 272 |
| 1515 |
R_AARCH64_LD_PREL_LO19 R_AARCH64 = 273 |
| 1516 |
R_AARCH64_ADR_PREL_LO21 R_AARCH64 = 274 |
| 1517 |
R_AARCH64_ADR_PREL_PG_HI21 R_AARCH64 = 275 |
| 1518 |
R_AARCH64_ADR_PREL_PG_HI21_NC R_AARCH64 = 276 |
| 1519 |
R_AARCH64_ADD_ABS_LO12_NC R_AARCH64 = 277 |
| 1520 |
R_AARCH64_LDST8_ABS_LO12_NC R_AARCH64 = 278 |
| 1521 |
R_AARCH64_TSTBR14 R_AARCH64 = 279 |
| 1522 |
R_AARCH64_CONDBR19 R_AARCH64 = 280 |
| 1523 |
R_AARCH64_JUMP26 R_AARCH64 = 282 |
| 1524 |
R_AARCH64_CALL26 R_AARCH64 = 283 |
| 1525 |
R_AARCH64_LDST16_ABS_LO12_NC R_AARCH64 = 284 |
| 1526 |
R_AARCH64_LDST32_ABS_LO12_NC R_AARCH64 = 285 |
| 1527 |
R_AARCH64_LDST64_ABS_LO12_NC R_AARCH64 = 286 |
| 1528 |
R_AARCH64_LDST128_ABS_LO12_NC R_AARCH64 = 299 |
| 1529 |
R_AARCH64_GOT_LD_PREL19 R_AARCH64 = 309 |
| 1530 |
R_AARCH64_LD64_GOTOFF_LO15 R_AARCH64 = 310 |
| 1531 |
R_AARCH64_ADR_GOT_PAGE R_AARCH64 = 311 |
| 1532 |
R_AARCH64_LD64_GOT_LO12_NC R_AARCH64 = 312 |
| 1533 |
R_AARCH64_LD64_GOTPAGE_LO15 R_AARCH64 = 313 |
| 1534 |
R_AARCH64_TLSGD_ADR_PREL21 R_AARCH64 = 512 |
| 1535 |
R_AARCH64_TLSGD_ADR_PAGE21 R_AARCH64 = 513 |
| 1536 |
R_AARCH64_TLSGD_ADD_LO12_NC R_AARCH64 = 514 |
| 1537 |
R_AARCH64_TLSGD_MOVW_G1 R_AARCH64 = 515 |
| 1538 |
R_AARCH64_TLSGD_MOVW_G0_NC R_AARCH64 = 516 |
| 1539 |
R_AARCH64_TLSLD_ADR_PREL21 R_AARCH64 = 517 |
| 1540 |
R_AARCH64_TLSLD_ADR_PAGE21 R_AARCH64 = 518 |
| 1541 |
R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 R_AARCH64 = 539 |
| 1542 |
R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC R_AARCH64 = 540 |
| 1543 |
R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 R_AARCH64 = 541 |
| 1544 |
R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC R_AARCH64 = 542 |
| 1545 |
R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 R_AARCH64 = 543 |
| 1546 |
R_AARCH64_TLSLE_MOVW_TPREL_G2 R_AARCH64 = 544 |
| 1547 |
R_AARCH64_TLSLE_MOVW_TPREL_G1 R_AARCH64 = 545 |
| 1548 |
R_AARCH64_TLSLE_MOVW_TPREL_G1_NC R_AARCH64 = 546 |
| 1549 |
R_AARCH64_TLSLE_MOVW_TPREL_G0 R_AARCH64 = 547 |
| 1550 |
R_AARCH64_TLSLE_MOVW_TPREL_G0_NC R_AARCH64 = 548 |
| 1551 |
R_AARCH64_TLSLE_ADD_TPREL_HI12 R_AARCH64 = 549 |
| 1552 |
R_AARCH64_TLSLE_ADD_TPREL_LO12 R_AARCH64 = 550 |
| 1553 |
R_AARCH64_TLSLE_ADD_TPREL_LO12_NC R_AARCH64 = 551 |
| 1554 |
R_AARCH64_TLSDESC_LD_PREL19 R_AARCH64 = 560 |
| 1555 |
R_AARCH64_TLSDESC_ADR_PREL21 R_AARCH64 = 561 |
| 1556 |
R_AARCH64_TLSDESC_ADR_PAGE21 R_AARCH64 = 562 |
| 1557 |
R_AARCH64_TLSDESC_LD64_LO12_NC R_AARCH64 = 563 |
| 1558 |
R_AARCH64_TLSDESC_ADD_LO12_NC R_AARCH64 = 564 |
| 1559 |
R_AARCH64_TLSDESC_OFF_G1 R_AARCH64 = 565 |
| 1560 |
R_AARCH64_TLSDESC_OFF_G0_NC R_AARCH64 = 566 |
| 1561 |
R_AARCH64_TLSDESC_LDR R_AARCH64 = 567 |
| 1562 |
R_AARCH64_TLSDESC_ADD R_AARCH64 = 568 |
| 1563 |
R_AARCH64_TLSDESC_CALL R_AARCH64 = 569 |
| 1564 |
R_AARCH64_TLSLE_LDST128_TPREL_LO12 R_AARCH64 = 570 |
| 1565 |
R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC R_AARCH64 = 571 |
| 1566 |
R_AARCH64_TLSLD_LDST128_DTPREL_LO12 R_AARCH64 = 572 |
| 1567 |
R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC R_AARCH64 = 573 |
| 1568 |
R_AARCH64_COPY R_AARCH64 = 1024 |
| 1569 |
R_AARCH64_GLOB_DAT R_AARCH64 = 1025 |
| 1570 |
R_AARCH64_JUMP_SLOT R_AARCH64 = 1026 |
| 1571 |
R_AARCH64_RELATIVE R_AARCH64 = 1027 |
| 1572 |
R_AARCH64_TLS_DTPMOD64 R_AARCH64 = 1028 |
| 1573 |
R_AARCH64_TLS_DTPREL64 R_AARCH64 = 1029 |
| 1574 |
R_AARCH64_TLS_TPREL64 R_AARCH64 = 1030 |
| 1575 |
R_AARCH64_TLSDESC R_AARCH64 = 1031 |
| 1576 |
R_AARCH64_IRELATIVE R_AARCH64 = 1032 |
| 1577 |
) |
| 1578 |
|
| 1579 |
var raarch64Strings = []intName{ |
| 1580 |
{0, "R_AARCH64_NONE"}, |
| 1581 |
{1, "R_AARCH64_P32_ABS32"}, |
| 1582 |
{2, "R_AARCH64_P32_ABS16"}, |
| 1583 |
{3, "R_AARCH64_P32_PREL32"}, |
| 1584 |
{4, "R_AARCH64_P32_PREL16"}, |
| 1585 |
{5, "R_AARCH64_P32_MOVW_UABS_G0"}, |
| 1586 |
{6, "R_AARCH64_P32_MOVW_UABS_G0_NC"}, |
| 1587 |
{7, "R_AARCH64_P32_MOVW_UABS_G1"}, |
| 1588 |
{8, "R_AARCH64_P32_MOVW_SABS_G0"}, |
| 1589 |
{9, "R_AARCH64_P32_LD_PREL_LO19"}, |
| 1590 |
{10, "R_AARCH64_P32_ADR_PREL_LO21"}, |
| 1591 |
{11, "R_AARCH64_P32_ADR_PREL_PG_HI21"}, |
| 1592 |
{12, "R_AARCH64_P32_ADD_ABS_LO12_NC"}, |
| 1593 |
{13, "R_AARCH64_P32_LDST8_ABS_LO12_NC"}, |
| 1594 |
{14, "R_AARCH64_P32_LDST16_ABS_LO12_NC"}, |
| 1595 |
{15, "R_AARCH64_P32_LDST32_ABS_LO12_NC"}, |
| 1596 |
{16, "R_AARCH64_P32_LDST64_ABS_LO12_NC"}, |
| 1597 |
{17, "R_AARCH64_P32_LDST128_ABS_LO12_NC"}, |
| 1598 |
{18, "R_AARCH64_P32_TSTBR14"}, |
| 1599 |
{19, "R_AARCH64_P32_CONDBR19"}, |
| 1600 |
{20, "R_AARCH64_P32_JUMP26"}, |
| 1601 |
{21, "R_AARCH64_P32_CALL26"}, |
| 1602 |
{25, "R_AARCH64_P32_GOT_LD_PREL19"}, |
| 1603 |
{26, "R_AARCH64_P32_ADR_GOT_PAGE"}, |
| 1604 |
{27, "R_AARCH64_P32_LD32_GOT_LO12_NC"}, |
| 1605 |
{81, "R_AARCH64_P32_TLSGD_ADR_PAGE21"}, |
| 1606 |
{82, "R_AARCH64_P32_TLSGD_ADD_LO12_NC"}, |
| 1607 |
{103, "R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21"}, |
| 1608 |
{104, "R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC"}, |
| 1609 |
{105, "R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19"}, |
| 1610 |
{106, "R_AARCH64_P32_TLSLE_MOVW_TPREL_G1"}, |
| 1611 |
{107, "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0"}, |
| 1612 |
{108, "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC"}, |
| 1613 |
{109, "R_AARCH64_P32_TLSLE_ADD_TPREL_HI12"}, |
| 1614 |
{110, "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12"}, |
| 1615 |
{111, "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC"}, |
| 1616 |
{122, "R_AARCH64_P32_TLSDESC_LD_PREL19"}, |
| 1617 |
{123, "R_AARCH64_P32_TLSDESC_ADR_PREL21"}, |
| 1618 |
{124, "R_AARCH64_P32_TLSDESC_ADR_PAGE21"}, |
| 1619 |
{125, "R_AARCH64_P32_TLSDESC_LD32_LO12_NC"}, |
| 1620 |
{126, "R_AARCH64_P32_TLSDESC_ADD_LO12_NC"}, |
| 1621 |
{127, "R_AARCH64_P32_TLSDESC_CALL"}, |
| 1622 |
{180, "R_AARCH64_P32_COPY"}, |
| 1623 |
{181, "R_AARCH64_P32_GLOB_DAT"}, |
| 1624 |
{182, "R_AARCH64_P32_JUMP_SLOT"}, |
| 1625 |
{183, "R_AARCH64_P32_RELATIVE"}, |
| 1626 |
{184, "R_AARCH64_P32_TLS_DTPMOD"}, |
| 1627 |
{185, "R_AARCH64_P32_TLS_DTPREL"}, |
| 1628 |
{186, "R_AARCH64_P32_TLS_TPREL"}, |
| 1629 |
{187, "R_AARCH64_P32_TLSDESC"}, |
| 1630 |
{188, "R_AARCH64_P32_IRELATIVE"}, |
| 1631 |
{256, "R_AARCH64_NULL"}, |
| 1632 |
{257, "R_AARCH64_ABS64"}, |
| 1633 |
{258, "R_AARCH64_ABS32"}, |
| 1634 |
{259, "R_AARCH64_ABS16"}, |
| 1635 |
{260, "R_AARCH64_PREL64"}, |
| 1636 |
{261, "R_AARCH64_PREL32"}, |
| 1637 |
{262, "R_AARCH64_PREL16"}, |
| 1638 |
{263, "R_AARCH64_MOVW_UABS_G0"}, |
| 1639 |
{264, "R_AARCH64_MOVW_UABS_G0_NC"}, |
| 1640 |
{265, "R_AARCH64_MOVW_UABS_G1"}, |
| 1641 |
{266, "R_AARCH64_MOVW_UABS_G1_NC"}, |
| 1642 |
{267, "R_AARCH64_MOVW_UABS_G2"}, |
| 1643 |
{268, "R_AARCH64_MOVW_UABS_G2_NC"}, |
| 1644 |
{269, "R_AARCH64_MOVW_UABS_G3"}, |
| 1645 |
{270, "R_AARCH64_MOVW_SABS_G0"}, |
| 1646 |
{271, "R_AARCH64_MOVW_SABS_G1"}, |
| 1647 |
{272, "R_AARCH64_MOVW_SABS_G2"}, |
| 1648 |
{273, "R_AARCH64_LD_PREL_LO19"}, |
| 1649 |
{274, "R_AARCH64_ADR_PREL_LO21"}, |
| 1650 |
{275, "R_AARCH64_ADR_PREL_PG_HI21"}, |
| 1651 |
{276, "R_AARCH64_ADR_PREL_PG_HI21_NC"}, |
| 1652 |
{277, "R_AARCH64_ADD_ABS_LO12_NC"}, |
| 1653 |
{278, "R_AARCH64_LDST8_ABS_LO12_NC"}, |
| 1654 |
{279, "R_AARCH64_TSTBR14"}, |
| 1655 |
{280, "R_AARCH64_CONDBR19"}, |
| 1656 |
{282, "R_AARCH64_JUMP26"}, |
| 1657 |
{283, "R_AARCH64_CALL26"}, |
| 1658 |
{284, "R_AARCH64_LDST16_ABS_LO12_NC"}, |
| 1659 |
{285, "R_AARCH64_LDST32_ABS_LO12_NC"}, |
| 1660 |
{286, "R_AARCH64_LDST64_ABS_LO12_NC"}, |
| 1661 |
{299, "R_AARCH64_LDST128_ABS_LO12_NC"}, |
| 1662 |
{309, "R_AARCH64_GOT_LD_PREL19"}, |
| 1663 |
{310, "R_AARCH64_LD64_GOTOFF_LO15"}, |
| 1664 |
{311, "R_AARCH64_ADR_GOT_PAGE"}, |
| 1665 |
{312, "R_AARCH64_LD64_GOT_LO12_NC"}, |
| 1666 |
{313, "R_AARCH64_LD64_GOTPAGE_LO15"}, |
| 1667 |
{512, "R_AARCH64_TLSGD_ADR_PREL21"}, |
| 1668 |
{513, "R_AARCH64_TLSGD_ADR_PAGE21"}, |
| 1669 |
{514, "R_AARCH64_TLSGD_ADD_LO12_NC"}, |
| 1670 |
{515, "R_AARCH64_TLSGD_MOVW_G1"}, |
| 1671 |
{516, "R_AARCH64_TLSGD_MOVW_G0_NC"}, |
| 1672 |
{517, "R_AARCH64_TLSLD_ADR_PREL21"}, |
| 1673 |
{518, "R_AARCH64_TLSLD_ADR_PAGE21"}, |
| 1674 |
{539, "R_AARCH64_TLSIE_MOVW_GOTTPREL_G1"}, |
| 1675 |
{540, "R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC"}, |
| 1676 |
{541, "R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21"}, |
| 1677 |
{542, "R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC"}, |
| 1678 |
{543, "R_AARCH64_TLSIE_LD_GOTTPREL_PREL19"}, |
| 1679 |
{544, "R_AARCH64_TLSLE_MOVW_TPREL_G2"}, |
| 1680 |
{545, "R_AARCH64_TLSLE_MOVW_TPREL_G1"}, |
| 1681 |
{546, "R_AARCH64_TLSLE_MOVW_TPREL_G1_NC"}, |
| 1682 |
{547, "R_AARCH64_TLSLE_MOVW_TPREL_G0"}, |
| 1683 |
{548, "R_AARCH64_TLSLE_MOVW_TPREL_G0_NC"}, |
| 1684 |
{549, "R_AARCH64_TLSLE_ADD_TPREL_HI12"}, |
| 1685 |
{550, "R_AARCH64_TLSLE_ADD_TPREL_LO12"}, |
| 1686 |
{551, "R_AARCH64_TLSLE_ADD_TPREL_LO12_NC"}, |
| 1687 |
{560, "R_AARCH64_TLSDESC_LD_PREL19"}, |
| 1688 |
{561, "R_AARCH64_TLSDESC_ADR_PREL21"}, |
| 1689 |
{562, "R_AARCH64_TLSDESC_ADR_PAGE21"}, |
| 1690 |
{563, "R_AARCH64_TLSDESC_LD64_LO12_NC"}, |
| 1691 |
{564, "R_AARCH64_TLSDESC_ADD_LO12_NC"}, |
| 1692 |
{565, "R_AARCH64_TLSDESC_OFF_G1"}, |
| 1693 |
{566, "R_AARCH64_TLSDESC_OFF_G0_NC"}, |
| 1694 |
{567, "R_AARCH64_TLSDESC_LDR"}, |
| 1695 |
{568, "R_AARCH64_TLSDESC_ADD"}, |
| 1696 |
{569, "R_AARCH64_TLSDESC_CALL"}, |
| 1697 |
{570, "R_AARCH64_TLSLE_LDST128_TPREL_LO12"}, |
| 1698 |
{571, "R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC"}, |
| 1699 |
{572, "R_AARCH64_TLSLD_LDST128_DTPREL_LO12"}, |
| 1700 |
{573, "R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC"}, |
| 1701 |
{1024, "R_AARCH64_COPY"}, |
| 1702 |
{1025, "R_AARCH64_GLOB_DAT"}, |
| 1703 |
{1026, "R_AARCH64_JUMP_SLOT"}, |
| 1704 |
{1027, "R_AARCH64_RELATIVE"}, |
| 1705 |
{1028, "R_AARCH64_TLS_DTPMOD64"}, |
| 1706 |
{1029, "R_AARCH64_TLS_DTPREL64"}, |
| 1707 |
{1030, "R_AARCH64_TLS_TPREL64"}, |
| 1708 |
{1031, "R_AARCH64_TLSDESC"}, |
| 1709 |
{1032, "R_AARCH64_IRELATIVE"}, |
| 1710 |
} |
| 1711 |
|
| 1712 |
func (i R_AARCH64) String() string { return stringName(uint32(i), raarch64Strings, false) } |
| 1713 |
func (i R_AARCH64) GoString() string { return stringName(uint32(i), raarch64Strings, true) } |
| 1714 |
|
| 1715 |
// Relocation types for Alpha. |
| 1716 |
type R_ALPHA int |
| 1717 |
|
| 1718 |
const ( |
| 1719 |
R_ALPHA_NONE R_ALPHA = 0 /* No reloc */ |
| 1720 |
R_ALPHA_REFLONG R_ALPHA = 1 /* Direct 32 bit */ |
| 1721 |
R_ALPHA_REFQUAD R_ALPHA = 2 /* Direct 64 bit */ |
| 1722 |
R_ALPHA_GPREL32 R_ALPHA = 3 /* GP relative 32 bit */ |
| 1723 |
R_ALPHA_LITERAL R_ALPHA = 4 /* GP relative 16 bit w/optimization */ |
| 1724 |
R_ALPHA_LITUSE R_ALPHA = 5 /* Optimization hint for LITERAL */ |
| 1725 |
R_ALPHA_GPDISP R_ALPHA = 6 /* Add displacement to GP */ |
| 1726 |
R_ALPHA_BRADDR R_ALPHA = 7 /* PC+4 relative 23 bit shifted */ |
| 1727 |
R_ALPHA_HINT R_ALPHA = 8 /* PC+4 relative 16 bit shifted */ |
| 1728 |
R_ALPHA_SREL16 R_ALPHA = 9 /* PC relative 16 bit */ |
| 1729 |
R_ALPHA_SREL32 R_ALPHA = 10 /* PC relative 32 bit */ |
| 1730 |
R_ALPHA_SREL64 R_ALPHA = 11 /* PC relative 64 bit */ |
| 1731 |
R_ALPHA_OP_PUSH R_ALPHA = 12 /* OP stack push */ |
| 1732 |
R_ALPHA_OP_STORE R_ALPHA = 13 /* OP stack pop and store */ |
| 1733 |
R_ALPHA_OP_PSUB R_ALPHA = 14 /* OP stack subtract */ |
| 1734 |
R_ALPHA_OP_PRSHIFT R_ALPHA = 15 /* OP stack right shift */ |
| 1735 |
R_ALPHA_GPVALUE R_ALPHA = 16 |
| 1736 |
R_ALPHA_GPRELHIGH R_ALPHA = 17 |
| 1737 |
R_ALPHA_GPRELLOW R_ALPHA = 18 |
| 1738 |
R_ALPHA_IMMED_GP_16 R_ALPHA = 19 |
| 1739 |
R_ALPHA_IMMED_GP_HI32 R_ALPHA = 20 |
| 1740 |
R_ALPHA_IMMED_SCN_HI32 R_ALPHA = 21 |
| 1741 |
R_ALPHA_IMMED_BR_HI32 R_ALPHA = 22 |
| 1742 |
R_ALPHA_IMMED_LO32 R_ALPHA = 23 |
| 1743 |
R_ALPHA_COPY R_ALPHA = 24 /* Copy symbol at runtime */ |
| 1744 |
R_ALPHA_GLOB_DAT R_ALPHA = 25 /* Create GOT entry */ |
| 1745 |
R_ALPHA_JMP_SLOT R_ALPHA = 26 /* Create PLT entry */ |
| 1746 |
R_ALPHA_RELATIVE R_ALPHA = 27 /* Adjust by program base */ |
| 1747 |
) |
| 1748 |
|
| 1749 |
var ralphaStrings = []intName{ |
| 1750 |
{0, "R_ALPHA_NONE"}, |
| 1751 |
{1, "R_ALPHA_REFLONG"}, |
| 1752 |
{2, "R_ALPHA_REFQUAD"}, |
| 1753 |
{3, "R_ALPHA_GPREL32"}, |
| 1754 |
{4, "R_ALPHA_LITERAL"}, |
| 1755 |
{5, "R_ALPHA_LITUSE"}, |
| 1756 |
{6, "R_ALPHA_GPDISP"}, |
| 1757 |
{7, "R_ALPHA_BRADDR"}, |
| 1758 |
{8, "R_ALPHA_HINT"}, |
| 1759 |
{9, "R_ALPHA_SREL16"}, |
| 1760 |
{10, "R_ALPHA_SREL32"}, |
| 1761 |
{11, "R_ALPHA_SREL64"}, |
| 1762 |
{12, "R_ALPHA_OP_PUSH"}, |
| 1763 |
{13, "R_ALPHA_OP_STORE"}, |
| 1764 |
{14, "R_ALPHA_OP_PSUB"}, |
| 1765 |
{15, "R_ALPHA_OP_PRSHIFT"}, |
| 1766 |
{16, "R_ALPHA_GPVALUE"}, |
| 1767 |
{17, "R_ALPHA_GPRELHIGH"}, |
| 1768 |
{18, "R_ALPHA_GPRELLOW"}, |
| 1769 |
{19, "R_ALPHA_IMMED_GP_16"}, |
| 1770 |
{20, "R_ALPHA_IMMED_GP_HI32"}, |
| 1771 |
{21, "R_ALPHA_IMMED_SCN_HI32"}, |
| 1772 |
{22, "R_ALPHA_IMMED_BR_HI32"}, |
| 1773 |
{23, "R_ALPHA_IMMED_LO32"}, |
| 1774 |
{24, "R_ALPHA_COPY"}, |
| 1775 |
{25, "R_ALPHA_GLOB_DAT"}, |
| 1776 |
{26, "R_ALPHA_JMP_SLOT"}, |
| 1777 |
{27, "R_ALPHA_RELATIVE"}, |
| 1778 |
} |
| 1779 |
|
| 1780 |
func (i R_ALPHA) String() string { return stringName(uint32(i), ralphaStrings, false) } |
| 1781 |
func (i R_ALPHA) GoString() string { return stringName(uint32(i), ralphaStrings, true) } |
| 1782 |
|
| 1783 |
// Relocation types for ARM. |
| 1784 |
type R_ARM int |
| 1785 |
|
| 1786 |
const ( |
| 1787 |
R_ARM_NONE R_ARM = 0 /* No relocation. */ |
| 1788 |
R_ARM_PC24 R_ARM = 1 |
| 1789 |
R_ARM_ABS32 R_ARM = 2 |
| 1790 |
R_ARM_REL32 R_ARM = 3 |
| 1791 |
R_ARM_PC13 R_ARM = 4 |
| 1792 |
R_ARM_ABS16 R_ARM = 5 |
| 1793 |
R_ARM_ABS12 R_ARM = 6 |
| 1794 |
R_ARM_THM_ABS5 R_ARM = 7 |
| 1795 |
R_ARM_ABS8 R_ARM = 8 |
| 1796 |
R_ARM_SBREL32 R_ARM = 9 |
| 1797 |
R_ARM_THM_PC22 R_ARM = 10 |
| 1798 |
R_ARM_THM_PC8 R_ARM = 11 |
| 1799 |
R_ARM_AMP_VCALL9 R_ARM = 12 |
| 1800 |
R_ARM_SWI24 R_ARM = 13 |
| 1801 |
R_ARM_THM_SWI8 R_ARM = 14 |
| 1802 |
R_ARM_XPC25 R_ARM = 15 |
| 1803 |
R_ARM_THM_XPC22 R_ARM = 16 |
| 1804 |
R_ARM_TLS_DTPMOD32 R_ARM = 17 |
| 1805 |
R_ARM_TLS_DTPOFF32 R_ARM = 18 |
| 1806 |
R_ARM_TLS_TPOFF32 R_ARM = 19 |
| 1807 |
R_ARM_COPY R_ARM = 20 /* Copy data from shared object. */ |
| 1808 |
R_ARM_GLOB_DAT R_ARM = 21 /* Set GOT entry to data address. */ |
| 1809 |
R_ARM_JUMP_SLOT R_ARM = 22 /* Set GOT entry to code address. */ |
| 1810 |
R_ARM_RELATIVE R_ARM = 23 /* Add load address of shared object. */ |
| 1811 |
R_ARM_GOTOFF R_ARM = 24 /* Add GOT-relative symbol address. */ |
| 1812 |
R_ARM_GOTPC R_ARM = 25 /* Add PC-relative GOT table address. */ |
| 1813 |
R_ARM_GOT32 R_ARM = 26 /* Add PC-relative GOT offset. */ |
| 1814 |
R_ARM_PLT32 R_ARM = 27 /* Add PC-relative PLT offset. */ |
| 1815 |
R_ARM_CALL R_ARM = 28 |
| 1816 |
R_ARM_JUMP24 R_ARM = 29 |
| 1817 |
R_ARM_THM_JUMP24 R_ARM = 30 |
| 1818 |
R_ARM_BASE_ABS R_ARM = 31 |
| 1819 |
R_ARM_ALU_PCREL_7_0 R_ARM = 32 |
| 1820 |
R_ARM_ALU_PCREL_15_8 R_ARM = 33 |
| 1821 |
R_ARM_ALU_PCREL_23_15 R_ARM = 34 |
| 1822 |
R_ARM_LDR_SBREL_11_10_NC R_ARM = 35 |
| 1823 |
R_ARM_ALU_SBREL_19_12_NC R_ARM = 36 |
| 1824 |
R_ARM_ALU_SBREL_27_20_CK R_ARM = 37 |
| 1825 |
R_ARM_TARGET1 R_ARM = 38 |
| 1826 |
R_ARM_SBREL31 R_ARM = 39 |
| 1827 |
R_ARM_V4BX R_ARM = 40 |
| 1828 |
R_ARM_TARGET2 R_ARM = 41 |
| 1829 |
R_ARM_PREL31 R_ARM = 42 |
| 1830 |
R_ARM_MOVW_ABS_NC R_ARM = 43 |
| 1831 |
R_ARM_MOVT_ABS R_ARM = 44 |
| 1832 |
R_ARM_MOVW_PREL_NC R_ARM = 45 |
| 1833 |
R_ARM_MOVT_PREL R_ARM = 46 |
| 1834 |
R_ARM_THM_MOVW_ABS_NC R_ARM = 47 |
| 1835 |
R_ARM_THM_MOVT_ABS R_ARM = 48 |
| 1836 |
R_ARM_THM_MOVW_PREL_NC R_ARM = 49 |
| 1837 |
R_ARM_THM_MOVT_PREL R_ARM = 50 |
| 1838 |
R_ARM_THM_JUMP19 R_ARM = 51 |
| 1839 |
R_ARM_THM_JUMP6 R_ARM = 52 |
| 1840 |
R_ARM_THM_ALU_PREL_11_0 R_ARM = 53 |
| 1841 |
R_ARM_THM_PC12 R_ARM = 54 |
| 1842 |
R_ARM_ABS32_NOI R_ARM = 55 |
| 1843 |
R_ARM_REL32_NOI R_ARM = 56 |
| 1844 |
R_ARM_ALU_PC_G0_NC R_ARM = 57 |
| 1845 |
R_ARM_ALU_PC_G0 R_ARM = 58 |
| 1846 |
R_ARM_ALU_PC_G1_NC R_ARM = 59 |
| 1847 |
R_ARM_ALU_PC_G1 R_ARM = 60 |
| 1848 |
R_ARM_ALU_PC_G2 R_ARM = 61 |
| 1849 |
R_ARM_LDR_PC_G1 R_ARM = 62 |
| 1850 |
R_ARM_LDR_PC_G2 R_ARM = 63 |
| 1851 |
R_ARM_LDRS_PC_G0 R_ARM = 64 |
| 1852 |
R_ARM_LDRS_PC_G1 R_ARM = 65 |
| 1853 |
R_ARM_LDRS_PC_G2 R_ARM = 66 |
| 1854 |
R_ARM_LDC_PC_G0 R_ARM = 67 |
| 1855 |
R_ARM_LDC_PC_G1 R_ARM = 68 |
| 1856 |
R_ARM_LDC_PC_G2 R_ARM = 69 |
| 1857 |
R_ARM_ALU_SB_G0_NC R_ARM = 70 |
| 1858 |
R_ARM_ALU_SB_G0 R_ARM = 71 |
| 1859 |
R_ARM_ALU_SB_G1_NC R_ARM = 72 |
| 1860 |
R_ARM_ALU_SB_G1 R_ARM = 73 |
| 1861 |
R_ARM_ALU_SB_G2 R_ARM = 74 |
| 1862 |
R_ARM_LDR_SB_G0 R_ARM = 75 |
| 1863 |
R_ARM_LDR_SB_G1 R_ARM = 76 |
| 1864 |
R_ARM_LDR_SB_G2 R_ARM = 77 |
| 1865 |
R_ARM_LDRS_SB_G0 R_ARM = 78 |
| 1866 |
R_ARM_LDRS_SB_G1 R_ARM = 79 |
| 1867 |
R_ARM_LDRS_SB_G2 R_ARM = 80 |
| 1868 |
R_ARM_LDC_SB_G0 R_ARM = 81 |
| 1869 |
R_ARM_LDC_SB_G1 R_ARM = 82 |
| 1870 |
R_ARM_LDC_SB_G2 R_ARM = 83 |
| 1871 |
R_ARM_MOVW_BREL_NC R_ARM = 84 |
| 1872 |
R_ARM_MOVT_BREL R_ARM = 85 |
| 1873 |
R_ARM_MOVW_BREL R_ARM = 86 |
| 1874 |
R_ARM_THM_MOVW_BREL_NC R_ARM = 87 |
| 1875 |
R_ARM_THM_MOVT_BREL R_ARM = 88 |
| 1876 |
R_ARM_THM_MOVW_BREL R_ARM = 89 |
| 1877 |
R_ARM_TLS_GOTDESC R_ARM = 90 |
| 1878 |
R_ARM_TLS_CALL R_ARM = 91 |
| 1879 |
R_ARM_TLS_DESCSEQ R_ARM = 92 |
| 1880 |
R_ARM_THM_TLS_CALL R_ARM = 93 |
| 1881 |
R_ARM_PLT32_ABS R_ARM = 94 |
| 1882 |
R_ARM_GOT_ABS R_ARM = 95 |
| 1883 |
R_ARM_GOT_PREL R_ARM = 96 |
| 1884 |
R_ARM_GOT_BREL12 R_ARM = 97 |
| 1885 |
R_ARM_GOTOFF12 R_ARM = 98 |
| 1886 |
R_ARM_GOTRELAX R_ARM = 99 |
| 1887 |
R_ARM_GNU_VTENTRY R_ARM = 100 |
| 1888 |
R_ARM_GNU_VTINHERIT R_ARM = 101 |
| 1889 |
R_ARM_THM_JUMP11 R_ARM = 102 |
| 1890 |
R_ARM_THM_JUMP8 R_ARM = 103 |
| 1891 |
R_ARM_TLS_GD32 R_ARM = 104 |
| 1892 |
R_ARM_TLS_LDM32 R_ARM = 105 |
| 1893 |
R_ARM_TLS_LDO32 R_ARM = 106 |
| 1894 |
R_ARM_TLS_IE32 R_ARM = 107 |
| 1895 |
R_ARM_TLS_LE32 R_ARM = 108 |
| 1896 |
R_ARM_TLS_LDO12 R_ARM = 109 |
| 1897 |
R_ARM_TLS_LE12 R_ARM = 110 |
| 1898 |
R_ARM_TLS_IE12GP R_ARM = 111 |
| 1899 |
R_ARM_PRIVATE_0 R_ARM = 112 |
| 1900 |
R_ARM_PRIVATE_1 R_ARM = 113 |
| 1901 |
R_ARM_PRIVATE_2 R_ARM = 114 |
| 1902 |
R_ARM_PRIVATE_3 R_ARM = 115 |
| 1903 |
R_ARM_PRIVATE_4 R_ARM = 116 |
| 1904 |
R_ARM_PRIVATE_5 R_ARM = 117 |
| 1905 |
R_ARM_PRIVATE_6 R_ARM = 118 |
| 1906 |
R_ARM_PRIVATE_7 R_ARM = 119 |
| 1907 |
R_ARM_PRIVATE_8 R_ARM = 120 |
| 1908 |
R_ARM_PRIVATE_9 R_ARM = 121 |
| 1909 |
R_ARM_PRIVATE_10 R_ARM = 122 |
| 1910 |
R_ARM_PRIVATE_11 R_ARM = 123 |
| 1911 |
R_ARM_PRIVATE_12 R_ARM = 124 |
| 1912 |
R_ARM_PRIVATE_13 R_ARM = 125 |
| 1913 |
R_ARM_PRIVATE_14 R_ARM = 126 |
| 1914 |
R_ARM_PRIVATE_15 R_ARM = 127 |
| 1915 |
R_ARM_ME_TOO R_ARM = 128 |
| 1916 |
R_ARM_THM_TLS_DESCSEQ16 R_ARM = 129 |
| 1917 |
R_ARM_THM_TLS_DESCSEQ32 R_ARM = 130 |
| 1918 |
R_ARM_THM_GOT_BREL12 R_ARM = 131 |
| 1919 |
R_ARM_THM_ALU_ABS_G0_NC R_ARM = 132 |
| 1920 |
R_ARM_THM_ALU_ABS_G1_NC R_ARM = 133 |
| 1921 |
R_ARM_THM_ALU_ABS_G2_NC R_ARM = 134 |
| 1922 |
R_ARM_THM_ALU_ABS_G3 R_ARM = 135 |
| 1923 |
R_ARM_IRELATIVE R_ARM = 160 |
| 1924 |
R_ARM_RXPC25 R_ARM = 249 |
| 1925 |
R_ARM_RSBREL32 R_ARM = 250 |
| 1926 |
R_ARM_THM_RPC22 R_ARM = 251 |
| 1927 |
R_ARM_RREL32 R_ARM = 252 |
| 1928 |
R_ARM_RABS32 R_ARM = 253 |
| 1929 |
R_ARM_RPC24 R_ARM = 254 |
| 1930 |
R_ARM_RBASE R_ARM = 255 |
| 1931 |
) |
| 1932 |
|
| 1933 |
var rarmStrings = []intName{ |
| 1934 |
{0, "R_ARM_NONE"}, |
| 1935 |
{1, "R_ARM_PC24"}, |
| 1936 |
{2, "R_ARM_ABS32"}, |
| 1937 |
{3, "R_ARM_REL32"}, |
| 1938 |
{4, "R_ARM_PC13"}, |
| 1939 |
{5, "R_ARM_ABS16"}, |
| 1940 |
{6, "R_ARM_ABS12"}, |
| 1941 |
{7, "R_ARM_THM_ABS5"}, |
| 1942 |
{8, "R_ARM_ABS8"}, |
| 1943 |
{9, "R_ARM_SBREL32"}, |
| 1944 |
{10, "R_ARM_THM_PC22"}, |
| 1945 |
{11, "R_ARM_THM_PC8"}, |
| 1946 |
{12, "R_ARM_AMP_VCALL9"}, |
| 1947 |
{13, "R_ARM_SWI24"}, |
| 1948 |
{14, "R_ARM_THM_SWI8"}, |
| 1949 |
{15, "R_ARM_XPC25"}, |
| 1950 |
{16, "R_ARM_THM_XPC22"}, |
| 1951 |
{17, "R_ARM_TLS_DTPMOD32"}, |
| 1952 |
{18, "R_ARM_TLS_DTPOFF32"}, |
| 1953 |
{19, "R_ARM_TLS_TPOFF32"}, |
| 1954 |
{20, "R_ARM_COPY"}, |
| 1955 |
{21, "R_ARM_GLOB_DAT"}, |
| 1956 |
{22, "R_ARM_JUMP_SLOT"}, |
| 1957 |
{23, "R_ARM_RELATIVE"}, |
| 1958 |
{24, "R_ARM_GOTOFF"}, |
| 1959 |
{25, "R_ARM_GOTPC"}, |
| 1960 |
{26, "R_ARM_GOT32"}, |
| 1961 |
{27, "R_ARM_PLT32"}, |
| 1962 |
{28, "R_ARM_CALL"}, |
| 1963 |
{29, "R_ARM_JUMP24"}, |
| 1964 |
{30, "R_ARM_THM_JUMP24"}, |
| 1965 |
{31, "R_ARM_BASE_ABS"}, |
| 1966 |
{32, "R_ARM_ALU_PCREL_7_0"}, |
| 1967 |
{33, "R_ARM_ALU_PCREL_15_8"}, |
| 1968 |
{34, "R_ARM_ALU_PCREL_23_15"}, |
| 1969 |
{35, "R_ARM_LDR_SBREL_11_10_NC"}, |
| 1970 |
{36, "R_ARM_ALU_SBREL_19_12_NC"}, |
| 1971 |
{37, "R_ARM_ALU_SBREL_27_20_CK"}, |
| 1972 |
{38, "R_ARM_TARGET1"}, |
| 1973 |
{39, "R_ARM_SBREL31"}, |
| 1974 |
{40, "R_ARM_V4BX"}, |
| 1975 |
{41, "R_ARM_TARGET2"}, |
| 1976 |
{42, "R_ARM_PREL31"}, |
| 1977 |
{43, "R_ARM_MOVW_ABS_NC"}, |
| 1978 |
{44, "R_ARM_MOVT_ABS"}, |
| 1979 |
{45, "R_ARM_MOVW_PREL_NC"}, |
| 1980 |
{46, "R_ARM_MOVT_PREL"}, |
| 1981 |
{47, "R_ARM_THM_MOVW_ABS_NC"}, |
| 1982 |
{48, "R_ARM_THM_MOVT_ABS"}, |
| 1983 |
{49, "R_ARM_THM_MOVW_PREL_NC"}, |
| 1984 |
{50, "R_ARM_THM_MOVT_PREL"}, |
| 1985 |
{51, "R_ARM_THM_JUMP19"}, |
| 1986 |
{52, "R_ARM_THM_JUMP6"}, |
| 1987 |
{53, "R_ARM_THM_ALU_PREL_11_0"}, |
| 1988 |
{54, "R_ARM_THM_PC12"}, |
| 1989 |
{55, "R_ARM_ABS32_NOI"}, |
| 1990 |
{56, "R_ARM_REL32_NOI"}, |
| 1991 |
{57, "R_ARM_ALU_PC_G0_NC"}, |
| 1992 |
{58, "R_ARM_ALU_PC_G0"}, |
| 1993 |
{59, "R_ARM_ALU_PC_G1_NC"}, |
| 1994 |
{60, "R_ARM_ALU_PC_G1"}, |
| 1995 |
{61, "R_ARM_ALU_PC_G2"}, |
| 1996 |
{62, "R_ARM_LDR_PC_G1"}, |
| 1997 |
{63, "R_ARM_LDR_PC_G2"}, |
| 1998 |
{64, "R_ARM_LDRS_PC_G0"}, |
| 1999 |
{65, "R_ARM_LDRS_PC_G1"}, |
| 2000 |
{66, "R_ARM_LDRS_PC_G2"}, |
| 2001 |
{67, "R_ARM_LDC_PC_G0"}, |
| 2002 |
{68, "R_ARM_LDC_PC_G1"}, |
| 2003 |
{69, "R_ARM_LDC_PC_G2"}, |
| 2004 |
{70, "R_ARM_ALU_SB_G0_NC"}, |
| 2005 |
{71, "R_ARM_ALU_SB_G0"}, |
| 2006 |
{72, "R_ARM_ALU_SB_G1_NC"}, |
| 2007 |
{73, "R_ARM_ALU_SB_G1"}, |
| 2008 |
{74, "R_ARM_ALU_SB_G2"}, |
| 2009 |
{75, "R_ARM_LDR_SB_G0"}, |
| 2010 |
{76, "R_ARM_LDR_SB_G1"}, |
| 2011 |
{77, "R_ARM_LDR_SB_G2"}, |
| 2012 |
{78, "R_ARM_LDRS_SB_G0"}, |
| 2013 |
{79, "R_ARM_LDRS_SB_G1"}, |
| 2014 |
{80, "R_ARM_LDRS_SB_G2"}, |
| 2015 |
{81, "R_ARM_LDC_SB_G0"}, |
| 2016 |
{82, "R_ARM_LDC_SB_G1"}, |
| 2017 |
{83, "R_ARM_LDC_SB_G2"}, |
| 2018 |
{84, "R_ARM_MOVW_BREL_NC"}, |
| 2019 |
{85, "R_ARM_MOVT_BREL"}, |
| 2020 |
{86, "R_ARM_MOVW_BREL"}, |
| 2021 |
{87, "R_ARM_THM_MOVW_BREL_NC"}, |
| 2022 |
{88, "R_ARM_THM_MOVT_BREL"}, |
| 2023 |
{89, "R_ARM_THM_MOVW_BREL"}, |
| 2024 |
{90, "R_ARM_TLS_GOTDESC"}, |
| 2025 |
{91, "R_ARM_TLS_CALL"}, |
| 2026 |
{92, "R_ARM_TLS_DESCSEQ"}, |
| 2027 |
{93, "R_ARM_THM_TLS_CALL"}, |
| 2028 |
{94, "R_ARM_PLT32_ABS"}, |
| 2029 |
{95, "R_ARM_GOT_ABS"}, |
| 2030 |
{96, "R_ARM_GOT_PREL"}, |
| 2031 |
{97, "R_ARM_GOT_BREL12"}, |
| 2032 |
{98, "R_ARM_GOTOFF12"}, |
| 2033 |
{99, "R_ARM_GOTRELAX"}, |
| 2034 |
{100, "R_ARM_GNU_VTENTRY"}, |
| 2035 |
{101, "R_ARM_GNU_VTINHERIT"}, |
| 2036 |
{102, "R_ARM_THM_JUMP11"}, |
| 2037 |
{103, "R_ARM_THM_JUMP8"}, |
| 2038 |
{104, "R_ARM_TLS_GD32"}, |
| 2039 |
{105, "R_ARM_TLS_LDM32"}, |
| 2040 |
{106, "R_ARM_TLS_LDO32"}, |
| 2041 |
{107, "R_ARM_TLS_IE32"}, |
| 2042 |
{108, "R_ARM_TLS_LE32"}, |
| 2043 |
{109, "R_ARM_TLS_LDO12"}, |
| 2044 |
{110, "R_ARM_TLS_LE12"}, |
| 2045 |
{111, "R_ARM_TLS_IE12GP"}, |
| 2046 |
{112, "R_ARM_PRIVATE_0"}, |
| 2047 |
{113, "R_ARM_PRIVATE_1"}, |
| 2048 |
{114, "R_ARM_PRIVATE_2"}, |
| 2049 |
{115, "R_ARM_PRIVATE_3"}, |
| 2050 |
{116, "R_ARM_PRIVATE_4"}, |
| 2051 |
{117, "R_ARM_PRIVATE_5"}, |
| 2052 |
{118, "R_ARM_PRIVATE_6"}, |
| 2053 |
{119, "R_ARM_PRIVATE_7"}, |
| 2054 |
{120, "R_ARM_PRIVATE_8"}, |
| 2055 |
{121, "R_ARM_PRIVATE_9"}, |
| 2056 |
{122, "R_ARM_PRIVATE_10"}, |
| 2057 |
{123, "R_ARM_PRIVATE_11"}, |
| 2058 |
{124, "R_ARM_PRIVATE_12"}, |
| 2059 |
{125, "R_ARM_PRIVATE_13"}, |
| 2060 |
{126, "R_ARM_PRIVATE_14"}, |
| 2061 |
{127, "R_ARM_PRIVATE_15"}, |
| 2062 |
{128, "R_ARM_ME_TOO"}, |
| 2063 |
{129, "R_ARM_THM_TLS_DESCSEQ16"}, |
| 2064 |
{130, "R_ARM_THM_TLS_DESCSEQ32"}, |
| 2065 |
{131, "R_ARM_THM_GOT_BREL12"}, |
| 2066 |
{132, "R_ARM_THM_ALU_ABS_G0_NC"}, |
| 2067 |
{133, "R_ARM_THM_ALU_ABS_G1_NC"}, |
| 2068 |
{134, "R_ARM_THM_ALU_ABS_G2_NC"}, |
| 2069 |
{135, "R_ARM_THM_ALU_ABS_G3"}, |
| 2070 |
{160, "R_ARM_IRELATIVE"}, |
| 2071 |
{249, "R_ARM_RXPC25"}, |
| 2072 |
{250, "R_ARM_RSBREL32"}, |
| 2073 |
{251, "R_ARM_THM_RPC22"}, |
| 2074 |
{252, "R_ARM_RREL32"}, |
| 2075 |
{253, "R_ARM_RABS32"}, |
| 2076 |
{254, "R_ARM_RPC24"}, |
| 2077 |
{255, "R_ARM_RBASE"}, |
| 2078 |
} |
| 2079 |
|
| 2080 |
func (i R_ARM) String() string { return stringName(uint32(i), rarmStrings, false) } |
| 2081 |
func (i R_ARM) GoString() string { return stringName(uint32(i), rarmStrings, true) } |
| 2082 |
|
| 2083 |
// Relocation types for 386. |
| 2084 |
type R_386 int |
| 2085 |
|
| 2086 |
const ( |
| 2087 |
R_386_NONE R_386 = 0 /* No relocation. */ |
| 2088 |
R_386_32 R_386 = 1 /* Add symbol value. */ |
| 2089 |
R_386_PC32 R_386 = 2 /* Add PC-relative symbol value. */ |
| 2090 |
R_386_GOT32 R_386 = 3 /* Add PC-relative GOT offset. */ |
| 2091 |
R_386_PLT32 R_386 = 4 /* Add PC-relative PLT offset. */ |
| 2092 |
R_386_COPY R_386 = 5 /* Copy data from shared object. */ |
| 2093 |
R_386_GLOB_DAT R_386 = 6 /* Set GOT entry to data address. */ |
| 2094 |
R_386_JMP_SLOT R_386 = 7 /* Set GOT entry to code address. */ |
| 2095 |
R_386_RELATIVE R_386 = 8 /* Add load address of shared object. */ |
| 2096 |
R_386_GOTOFF R_386 = 9 /* Add GOT-relative symbol address. */ |
| 2097 |
R_386_GOTPC R_386 = 10 /* Add PC-relative GOT table address. */ |
| 2098 |
R_386_32PLT R_386 = 11 |
| 2099 |
R_386_TLS_TPOFF R_386 = 14 /* Negative offset in static TLS block */ |
| 2100 |
R_386_TLS_IE R_386 = 15 /* Absolute address of GOT for -ve static TLS */ |
| 2101 |
R_386_TLS_GOTIE R_386 = 16 /* GOT entry for negative static TLS block */ |
| 2102 |
R_386_TLS_LE R_386 = 17 /* Negative offset relative to static TLS */ |
| 2103 |
R_386_TLS_GD R_386 = 18 /* 32 bit offset to GOT (index,off) pair */ |
| 2104 |
R_386_TLS_LDM R_386 = 19 /* 32 bit offset to GOT (index,zero) pair */ |
| 2105 |
R_386_16 R_386 = 20 |
| 2106 |
R_386_PC16 R_386 = 21 |
| 2107 |
R_386_8 R_386 = 22 |
| 2108 |
R_386_PC8 R_386 = 23 |
| 2109 |
R_386_TLS_GD_32 R_386 = 24 /* 32 bit offset to GOT (index,off) pair */ |
| 2110 |
R_386_TLS_GD_PUSH R_386 = 25 /* pushl instruction for Sun ABI GD sequence */ |
| 2111 |
R_386_TLS_GD_CALL R_386 = 26 /* call instruction for Sun ABI GD sequence */ |
| 2112 |
R_386_TLS_GD_POP R_386 = 27 /* popl instruction for Sun ABI GD sequence */ |
| 2113 |
R_386_TLS_LDM_32 R_386 = 28 /* 32 bit offset to GOT (index,zero) pair */ |
| 2114 |
R_386_TLS_LDM_PUSH R_386 = 29 /* pushl instruction for Sun ABI LD sequence */ |
| 2115 |
R_386_TLS_LDM_CALL R_386 = 30 /* call instruction for Sun ABI LD sequence */ |
| 2116 |
R_386_TLS_LDM_POP R_386 = 31 /* popl instruction for Sun ABI LD sequence */ |
| 2117 |
R_386_TLS_LDO_32 R_386 = 32 /* 32 bit offset from start of TLS block */ |
| 2118 |
R_386_TLS_IE_32 R_386 = 33 /* 32 bit offset to GOT static TLS offset entry */ |
| 2119 |
R_386_TLS_LE_32 R_386 = 34 /* 32 bit offset within static TLS block */ |
| 2120 |
R_386_TLS_DTPMOD32 R_386 = 35 /* GOT entry containing TLS index */ |
| 2121 |
R_386_TLS_DTPOFF32 R_386 = 36 /* GOT entry containing TLS offset */ |
| 2122 |
R_386_TLS_TPOFF32 R_386 = 37 /* GOT entry of -ve static TLS offset */ |
| 2123 |
R_386_SIZE32 R_386 = 38 |
| 2124 |
R_386_TLS_GOTDESC R_386 = 39 |
| 2125 |
R_386_TLS_DESC_CALL R_386 = 40 |
| 2126 |
R_386_TLS_DESC R_386 = 41 |
| 2127 |
R_386_IRELATIVE R_386 = 42 |
| 2128 |
R_386_GOT32X R_386 = 43 |
| 2129 |
) |
| 2130 |
|
| 2131 |
var r386Strings = []intName{ |
| 2132 |
{0, "R_386_NONE"}, |
| 2133 |
{1, "R_386_32"}, |
| 2134 |
{2, "R_386_PC32"}, |
| 2135 |
{3, "R_386_GOT32"}, |
| 2136 |
{4, "R_386_PLT32"}, |
| 2137 |
{5, "R_386_COPY"}, |
| 2138 |
{6, "R_386_GLOB_DAT"}, |
| 2139 |
{7, "R_386_JMP_SLOT"}, |
| 2140 |
{8, "R_386_RELATIVE"}, |
| 2141 |
{9, "R_386_GOTOFF"}, |
| 2142 |
{10, "R_386_GOTPC"}, |
| 2143 |
{11, "R_386_32PLT"}, |
| 2144 |
{14, "R_386_TLS_TPOFF"}, |
| 2145 |
{15, "R_386_TLS_IE"}, |
| 2146 |
{16, "R_386_TLS_GOTIE"}, |
| 2147 |
{17, "R_386_TLS_LE"}, |
| 2148 |
{18, "R_386_TLS_GD"}, |
| 2149 |
{19, "R_386_TLS_LDM"}, |
| 2150 |
{20, "R_386_16"}, |
| 2151 |
{21, "R_386_PC16"}, |
| 2152 |
{22, "R_386_8"}, |
| 2153 |
{23, "R_386_PC8"}, |
| 2154 |
{24, "R_386_TLS_GD_32"}, |
| 2155 |
{25, "R_386_TLS_GD_PUSH"}, |
| 2156 |
{26, "R_386_TLS_GD_CALL"}, |
| 2157 |
{27, "R_386_TLS_GD_POP"}, |
| 2158 |
{28, "R_386_TLS_LDM_32"}, |
| 2159 |
{29, "R_386_TLS_LDM_PUSH"}, |
| 2160 |
{30, "R_386_TLS_LDM_CALL"}, |
| 2161 |
{31, "R_386_TLS_LDM_POP"}, |
| 2162 |
{32, "R_386_TLS_LDO_32"}, |
| 2163 |
{33, "R_386_TLS_IE_32"}, |
| 2164 |
{34, "R_386_TLS_LE_32"}, |
| 2165 |
{35, "R_386_TLS_DTPMOD32"}, |
| 2166 |
{36, "R_386_TLS_DTPOFF32"}, |
| 2167 |
{37, "R_386_TLS_TPOFF32"}, |
| 2168 |
{38, "R_386_SIZE32"}, |
| 2169 |
{39, "R_386_TLS_GOTDESC"}, |
| 2170 |
{40, "R_386_TLS_DESC_CALL"}, |
| 2171 |
{41, "R_386_TLS_DESC"}, |
| 2172 |
{42, "R_386_IRELATIVE"}, |
| 2173 |
{43, "R_386_GOT32X"}, |
| 2174 |
} |
| 2175 |
|
| 2176 |
func (i R_386) String() string { return stringName(uint32(i), r386Strings, false) } |
| 2177 |
func (i R_386) GoString() string { return stringName(uint32(i), r386Strings, true) } |
| 2178 |
|
| 2179 |
// Relocation types for MIPS. |
| 2180 |
type R_MIPS int |
| 2181 |
|
| 2182 |
const ( |
| 2183 |
R_MIPS_NONE R_MIPS = 0 |
| 2184 |
R_MIPS_16 R_MIPS = 1 |
| 2185 |
R_MIPS_32 R_MIPS = 2 |
| 2186 |
R_MIPS_REL32 R_MIPS = 3 |
| 2187 |
R_MIPS_26 R_MIPS = 4 |
| 2188 |
R_MIPS_HI16 R_MIPS = 5 /* high 16 bits of symbol value */ |
| 2189 |
R_MIPS_LO16 R_MIPS = 6 /* low 16 bits of symbol value */ |
| 2190 |
R_MIPS_GPREL16 R_MIPS = 7 /* GP-relative reference */ |
| 2191 |
R_MIPS_LITERAL R_MIPS = 8 /* Reference to literal section */ |
| 2192 |
R_MIPS_GOT16 R_MIPS = 9 /* Reference to global offset table */ |
| 2193 |
R_MIPS_PC16 R_MIPS = 10 /* 16 bit PC relative reference */ |
| 2194 |
R_MIPS_CALL16 R_MIPS = 11 /* 16 bit call through glbl offset tbl */ |
| 2195 |
R_MIPS_GPREL32 R_MIPS = 12 |
| 2196 |
R_MIPS_SHIFT5 R_MIPS = 16 |
| 2197 |
R_MIPS_SHIFT6 R_MIPS = 17 |
| 2198 |
R_MIPS_64 R_MIPS = 18 |
| 2199 |
R_MIPS_GOT_DISP R_MIPS = 19 |
| 2200 |
R_MIPS_GOT_PAGE R_MIPS = 20 |
| 2201 |
R_MIPS_GOT_OFST R_MIPS = 21 |
| 2202 |
R_MIPS_GOT_HI16 R_MIPS = 22 |
| 2203 |
R_MIPS_GOT_LO16 R_MIPS = 23 |
| 2204 |
R_MIPS_SUB R_MIPS = 24 |
| 2205 |
R_MIPS_INSERT_A R_MIPS = 25 |
| 2206 |
R_MIPS_INSERT_B R_MIPS = 26 |
| 2207 |
R_MIPS_DELETE R_MIPS = 27 |
| 2208 |
R_MIPS_HIGHER R_MIPS = 28 |
| 2209 |
R_MIPS_HIGHEST R_MIPS = 29 |
| 2210 |
R_MIPS_CALL_HI16 R_MIPS = 30 |
| 2211 |
R_MIPS_CALL_LO16 R_MIPS = 31 |
| 2212 |
R_MIPS_SCN_DISP R_MIPS = 32 |
| 2213 |
R_MIPS_REL16 R_MIPS = 33 |
| 2214 |
R_MIPS_ADD_IMMEDIATE R_MIPS = 34 |
| 2215 |
R_MIPS_PJUMP R_MIPS = 35 |
| 2216 |
R_MIPS_RELGOT R_MIPS = 36 |
| 2217 |
R_MIPS_JALR R_MIPS = 37 |
| 2218 |
|
| 2219 |
R_MIPS_TLS_DTPMOD32 R_MIPS = 38 /* Module number 32 bit */ |
| 2220 |
R_MIPS_TLS_DTPREL32 R_MIPS = 39 /* Module-relative offset 32 bit */ |
| 2221 |
R_MIPS_TLS_DTPMOD64 R_MIPS = 40 /* Module number 64 bit */ |
| 2222 |
R_MIPS_TLS_DTPREL64 R_MIPS = 41 /* Module-relative offset 64 bit */ |
| 2223 |
R_MIPS_TLS_GD R_MIPS = 42 /* 16 bit GOT offset for GD */ |
| 2224 |
R_MIPS_TLS_LDM R_MIPS = 43 /* 16 bit GOT offset for LDM */ |
| 2225 |
R_MIPS_TLS_DTPREL_HI16 R_MIPS = 44 /* Module-relative offset, high 16 bits */ |
| 2226 |
R_MIPS_TLS_DTPREL_LO16 R_MIPS = 45 /* Module-relative offset, low 16 bits */ |
| 2227 |
R_MIPS_TLS_GOTTPREL R_MIPS = 46 /* 16 bit GOT offset for IE */ |
| 2228 |
R_MIPS_TLS_TPREL32 R_MIPS = 47 /* TP-relative offset, 32 bit */ |
| 2229 |
R_MIPS_TLS_TPREL64 R_MIPS = 48 /* TP-relative offset, 64 bit */ |
| 2230 |
R_MIPS_TLS_TPREL_HI16 R_MIPS = 49 /* TP-relative offset, high 16 bits */ |
| 2231 |
R_MIPS_TLS_TPREL_LO16 R_MIPS = 50 /* TP-relative offset, low 16 bits */ |
| 2232 |
|
| 2233 |
R_MIPS_PC32 R_MIPS = 248 /* 32 bit PC relative reference */ |
| 2234 |
) |
| 2235 |
|
| 2236 |
var rmipsStrings = []intName{ |
| 2237 |
{0, "R_MIPS_NONE"}, |
| 2238 |
{1, "R_MIPS_16"}, |
| 2239 |
{2, "R_MIPS_32"}, |
| 2240 |
{3, "R_MIPS_REL32"}, |
| 2241 |
{4, "R_MIPS_26"}, |
| 2242 |
{5, "R_MIPS_HI16"}, |
| 2243 |
{6, "R_MIPS_LO16"}, |
| 2244 |
{7, "R_MIPS_GPREL16"}, |
| 2245 |
{8, "R_MIPS_LITERAL"}, |
| 2246 |
{9, "R_MIPS_GOT16"}, |
| 2247 |
{10, "R_MIPS_PC16"}, |
| 2248 |
{11, "R_MIPS_CALL16"}, |
| 2249 |
{12, "R_MIPS_GPREL32"}, |
| 2250 |
{16, "R_MIPS_SHIFT5"}, |
| 2251 |
{17, "R_MIPS_SHIFT6"}, |
| 2252 |
{18, "R_MIPS_64"}, |
| 2253 |
{19, "R_MIPS_GOT_DISP"}, |
| 2254 |
{20, "R_MIPS_GOT_PAGE"}, |
| 2255 |
{21, "R_MIPS_GOT_OFST"}, |
| 2256 |
{22, "R_MIPS_GOT_HI16"}, |
| 2257 |
{23, "R_MIPS_GOT_LO16"}, |
| 2258 |
{24, "R_MIPS_SUB"}, |
| 2259 |
{25, "R_MIPS_INSERT_A"}, |
| 2260 |
{26, "R_MIPS_INSERT_B"}, |
| 2261 |
{27, "R_MIPS_DELETE"}, |
| 2262 |
{28, "R_MIPS_HIGHER"}, |
| 2263 |
{29, "R_MIPS_HIGHEST"}, |
| 2264 |
{30, "R_MIPS_CALL_HI16"}, |
| 2265 |
{31, "R_MIPS_CALL_LO16"}, |
| 2266 |
{32, "R_MIPS_SCN_DISP"}, |
| 2267 |
{33, "R_MIPS_REL16"}, |
| 2268 |
{34, "R_MIPS_ADD_IMMEDIATE"}, |
| 2269 |
{35, "R_MIPS_PJUMP"}, |
| 2270 |
{36, "R_MIPS_RELGOT"}, |
| 2271 |
{37, "R_MIPS_JALR"}, |
| 2272 |
{38, "R_MIPS_TLS_DTPMOD32"}, |
| 2273 |
{39, "R_MIPS_TLS_DTPREL32"}, |
| 2274 |
{40, "R_MIPS_TLS_DTPMOD64"}, |
| 2275 |
{41, "R_MIPS_TLS_DTPREL64"}, |
| 2276 |
{42, "R_MIPS_TLS_GD"}, |
| 2277 |
{43, "R_MIPS_TLS_LDM"}, |
| 2278 |
{44, "R_MIPS_TLS_DTPREL_HI16"}, |
| 2279 |
{45, "R_MIPS_TLS_DTPREL_LO16"}, |
| 2280 |
{46, "R_MIPS_TLS_GOTTPREL"}, |
| 2281 |
{47, "R_MIPS_TLS_TPREL32"}, |
| 2282 |
{48, "R_MIPS_TLS_TPREL64"}, |
| 2283 |
{49, "R_MIPS_TLS_TPREL_HI16"}, |
| 2284 |
{50, "R_MIPS_TLS_TPREL_LO16"}, |
| 2285 |
{248, "R_MIPS_PC32"}, |
| 2286 |
} |
| 2287 |
|
| 2288 |
func (i R_MIPS) String() string { return stringName(uint32(i), rmipsStrings, false) } |
| 2289 |
func (i R_MIPS) GoString() string { return stringName(uint32(i), rmipsStrings, true) } |
| 2290 |
|
| 2291 |
// Relocation types for LoongArch. |
| 2292 |
type R_LARCH int |
| 2293 |
|
| 2294 |
const ( |
| 2295 |
R_LARCH_NONE R_LARCH = 0 |
| 2296 |
R_LARCH_32 R_LARCH = 1 |
| 2297 |
R_LARCH_64 R_LARCH = 2 |
| 2298 |
R_LARCH_RELATIVE R_LARCH = 3 |
| 2299 |
R_LARCH_COPY R_LARCH = 4 |
| 2300 |
R_LARCH_JUMP_SLOT R_LARCH = 5 |
| 2301 |
R_LARCH_TLS_DTPMOD32 R_LARCH = 6 |
| 2302 |
R_LARCH_TLS_DTPMOD64 R_LARCH = 7 |
| 2303 |
R_LARCH_TLS_DTPREL32 R_LARCH = 8 |
| 2304 |
R_LARCH_TLS_DTPREL64 R_LARCH = 9 |
| 2305 |
R_LARCH_TLS_TPREL32 R_LARCH = 10 |
| 2306 |
R_LARCH_TLS_TPREL64 R_LARCH = 11 |
| 2307 |
R_LARCH_IRELATIVE R_LARCH = 12 |
| 2308 |
R_LARCH_TLS_DESC32 R_LARCH = 13 |
| 2309 |
R_LARCH_TLS_DESC64 R_LARCH = 14 |
| 2310 |
R_LARCH_MARK_LA R_LARCH = 20 |
| 2311 |
R_LARCH_MARK_PCREL R_LARCH = 21 |
| 2312 |
R_LARCH_SOP_PUSH_PCREL R_LARCH = 22 |
| 2313 |
R_LARCH_SOP_PUSH_ABSOLUTE R_LARCH = 23 |
| 2314 |
R_LARCH_SOP_PUSH_DUP R_LARCH = 24 |
| 2315 |
R_LARCH_SOP_PUSH_GPREL R_LARCH = 25 |
| 2316 |
R_LARCH_SOP_PUSH_TLS_TPREL R_LARCH = 26 |
| 2317 |
R_LARCH_SOP_PUSH_TLS_GOT R_LARCH = 27 |
| 2318 |
R_LARCH_SOP_PUSH_TLS_GD R_LARCH = 28 |
| 2319 |
R_LARCH_SOP_PUSH_PLT_PCREL R_LARCH = 29 |
| 2320 |
R_LARCH_SOP_ASSERT R_LARCH = 30 |
| 2321 |
R_LARCH_SOP_NOT R_LARCH = 31 |
| 2322 |
R_LARCH_SOP_SUB R_LARCH = 32 |
| 2323 |
R_LARCH_SOP_SL R_LARCH = 33 |
| 2324 |
R_LARCH_SOP_SR R_LARCH = 34 |
| 2325 |
R_LARCH_SOP_ADD R_LARCH = 35 |
| 2326 |
R_LARCH_SOP_AND R_LARCH = 36 |
| 2327 |
R_LARCH_SOP_IF_ELSE R_LARCH = 37 |
| 2328 |
R_LARCH_SOP_POP_32_S_10_5 R_LARCH = 38 |
| 2329 |
R_LARCH_SOP_POP_32_U_10_12 R_LARCH = 39 |
| 2330 |
R_LARCH_SOP_POP_32_S_10_12 R_LARCH = 40 |
| 2331 |
R_LARCH_SOP_POP_32_S_10_16 R_LARCH = 41 |
| 2332 |
R_LARCH_SOP_POP_32_S_10_16_S2 R_LARCH = 42 |
| 2333 |
R_LARCH_SOP_POP_32_S_5_20 R_LARCH = 43 |
| 2334 |
R_LARCH_SOP_POP_32_S_0_5_10_16_S2 R_LARCH = 44 |
| 2335 |
R_LARCH_SOP_POP_32_S_0_10_10_16_S2 R_LARCH = 45 |
| 2336 |
R_LARCH_SOP_POP_32_U R_LARCH = 46 |
| 2337 |
R_LARCH_ADD8 R_LARCH = 47 |
| 2338 |
R_LARCH_ADD16 R_LARCH = 48 |
| 2339 |
R_LARCH_ADD24 R_LARCH = 49 |
| 2340 |
R_LARCH_ADD32 R_LARCH = 50 |
| 2341 |
R_LARCH_ADD64 R_LARCH = 51 |
| 2342 |
R_LARCH_SUB8 R_LARCH = 52 |
| 2343 |
R_LARCH_SUB16 R_LARCH = 53 |
| 2344 |
R_LARCH_SUB24 R_LARCH = 54 |
| 2345 |
R_LARCH_SUB32 R_LARCH = 55 |
| 2346 |
R_LARCH_SUB64 R_LARCH = 56 |
| 2347 |
R_LARCH_GNU_VTINHERIT R_LARCH = 57 |
| 2348 |
R_LARCH_GNU_VTENTRY R_LARCH = 58 |
| 2349 |
R_LARCH_B16 R_LARCH = 64 |
| 2350 |
R_LARCH_B21 R_LARCH = 65 |
| 2351 |
R_LARCH_B26 R_LARCH = 66 |
| 2352 |
R_LARCH_ABS_HI20 R_LARCH = 67 |
| 2353 |
R_LARCH_ABS_LO12 R_LARCH = 68 |
| 2354 |
R_LARCH_ABS64_LO20 R_LARCH = 69 |
| 2355 |
R_LARCH_ABS64_HI12 R_LARCH = 70 |
| 2356 |
R_LARCH_PCALA_HI20 R_LARCH = 71 |
| 2357 |
R_LARCH_PCALA_LO12 R_LARCH = 72 |
| 2358 |
R_LARCH_PCALA64_LO20 R_LARCH = 73 |
| 2359 |
R_LARCH_PCALA64_HI12 R_LARCH = 74 |
| 2360 |
R_LARCH_GOT_PC_HI20 R_LARCH = 75 |
| 2361 |
R_LARCH_GOT_PC_LO12 R_LARCH = 76 |
| 2362 |
R_LARCH_GOT64_PC_LO20 R_LARCH = 77 |
| 2363 |
R_LARCH_GOT64_PC_HI12 R_LARCH = 78 |
| 2364 |
R_LARCH_GOT_HI20 R_LARCH = 79 |
| 2365 |
R_LARCH_GOT_LO12 R_LARCH = 80 |
| 2366 |
R_LARCH_GOT64_LO20 R_LARCH = 81 |
| 2367 |
R_LARCH_GOT64_HI12 R_LARCH = 82 |
| 2368 |
R_LARCH_TLS_LE_HI20 R_LARCH = 83 |
| 2369 |
R_LARCH_TLS_LE_LO12 R_LARCH = 84 |
| 2370 |
R_LARCH_TLS_LE64_LO20 R_LARCH = 85 |
| 2371 |
R_LARCH_TLS_LE64_HI12 R_LARCH = 86 |
| 2372 |
R_LARCH_TLS_IE_PC_HI20 R_LARCH = 87 |
| 2373 |
R_LARCH_TLS_IE_PC_LO12 R_LARCH = 88 |
| 2374 |
R_LARCH_TLS_IE64_PC_LO20 R_LARCH = 89 |
| 2375 |
R_LARCH_TLS_IE64_PC_HI12 R_LARCH = 90 |
| 2376 |
R_LARCH_TLS_IE_HI20 R_LARCH = 91 |
| 2377 |
R_LARCH_TLS_IE_LO12 R_LARCH = 92 |
| 2378 |
R_LARCH_TLS_IE64_LO20 R_LARCH = 93 |
| 2379 |
R_LARCH_TLS_IE64_HI12 R_LARCH = 94 |
| 2380 |
R_LARCH_TLS_LD_PC_HI20 R_LARCH = 95 |
| 2381 |
R_LARCH_TLS_LD_HI20 R_LARCH = 96 |
| 2382 |
R_LARCH_TLS_GD_PC_HI20 R_LARCH = 97 |
| 2383 |
R_LARCH_TLS_GD_HI20 R_LARCH = 98 |
| 2384 |
R_LARCH_32_PCREL R_LARCH = 99 |
| 2385 |
R_LARCH_RELAX R_LARCH = 100 |
| 2386 |
R_LARCH_DELETE R_LARCH = 101 |
| 2387 |
R_LARCH_ALIGN R_LARCH = 102 |
| 2388 |
R_LARCH_PCREL20_S2 R_LARCH = 103 |
| 2389 |
R_LARCH_CFA R_LARCH = 104 |
| 2390 |
R_LARCH_ADD6 R_LARCH = 105 |
| 2391 |
R_LARCH_SUB6 R_LARCH = 106 |
| 2392 |
R_LARCH_ADD_ULEB128 R_LARCH = 107 |
| 2393 |
R_LARCH_SUB_ULEB128 R_LARCH = 108 |
| 2394 |
R_LARCH_64_PCREL R_LARCH = 109 |
| 2395 |
R_LARCH_CALL36 R_LARCH = 110 |
| 2396 |
R_LARCH_TLS_DESC_PC_HI20 R_LARCH = 111 |
| 2397 |
R_LARCH_TLS_DESC_PC_LO12 R_LARCH = 112 |
| 2398 |
R_LARCH_TLS_DESC64_PC_LO20 R_LARCH = 113 |
| 2399 |
R_LARCH_TLS_DESC64_PC_HI12 R_LARCH = 114 |
| 2400 |
R_LARCH_TLS_DESC_HI20 R_LARCH = 115 |
| 2401 |
R_LARCH_TLS_DESC_LO12 R_LARCH = 116 |
| 2402 |
R_LARCH_TLS_DESC64_LO20 R_LARCH = 117 |
| 2403 |
R_LARCH_TLS_DESC64_HI12 R_LARCH = 118 |
| 2404 |
R_LARCH_TLS_DESC_LD R_LARCH = 119 |
| 2405 |
R_LARCH_TLS_DESC_CALL R_LARCH = 120 |
| 2406 |
R_LARCH_TLS_LE_HI20_R R_LARCH = 121 |
| 2407 |
R_LARCH_TLS_LE_ADD_R R_LARCH = 122 |
| 2408 |
R_LARCH_TLS_LE_LO12_R R_LARCH = 123 |
| 2409 |
R_LARCH_TLS_LD_PCREL20_S2 R_LARCH = 124 |
| 2410 |
R_LARCH_TLS_GD_PCREL20_S2 R_LARCH = 125 |
| 2411 |
R_LARCH_TLS_DESC_PCREL20_S2 R_LARCH = 126 |
| 2412 |
) |
| 2413 |
|
| 2414 |
var rlarchStrings = []intName{ |
| 2415 |
{0, "R_LARCH_NONE"}, |
| 2416 |
{1, "R_LARCH_32"}, |
| 2417 |
{2, "R_LARCH_64"}, |
| 2418 |
{3, "R_LARCH_RELATIVE"}, |
| 2419 |
{4, "R_LARCH_COPY"}, |
| 2420 |
{5, "R_LARCH_JUMP_SLOT"}, |
| 2421 |
{6, "R_LARCH_TLS_DTPMOD32"}, |
| 2422 |
{7, "R_LARCH_TLS_DTPMOD64"}, |
| 2423 |
{8, "R_LARCH_TLS_DTPREL32"}, |
| 2424 |
{9, "R_LARCH_TLS_DTPREL64"}, |
| 2425 |
{10, "R_LARCH_TLS_TPREL32"}, |
| 2426 |
{11, "R_LARCH_TLS_TPREL64"}, |
| 2427 |
{12, "R_LARCH_IRELATIVE"}, |
| 2428 |
{13, "R_LARCH_TLS_DESC32"}, |
| 2429 |
{14, "R_LARCH_TLS_DESC64"}, |
| 2430 |
{20, "R_LARCH_MARK_LA"}, |
| 2431 |
{21, "R_LARCH_MARK_PCREL"}, |
| 2432 |
{22, "R_LARCH_SOP_PUSH_PCREL"}, |
| 2433 |
{23, "R_LARCH_SOP_PUSH_ABSOLUTE"}, |
| 2434 |
{24, "R_LARCH_SOP_PUSH_DUP"}, |
| 2435 |
{25, "R_LARCH_SOP_PUSH_GPREL"}, |
| 2436 |
{26, "R_LARCH_SOP_PUSH_TLS_TPREL"}, |
| 2437 |
{27, "R_LARCH_SOP_PUSH_TLS_GOT"}, |
| 2438 |
{28, "R_LARCH_SOP_PUSH_TLS_GD"}, |
| 2439 |
{29, "R_LARCH_SOP_PUSH_PLT_PCREL"}, |
| 2440 |
{30, "R_LARCH_SOP_ASSERT"}, |
| 2441 |
{31, "R_LARCH_SOP_NOT"}, |
| 2442 |
{32, "R_LARCH_SOP_SUB"}, |
| 2443 |
{33, "R_LARCH_SOP_SL"}, |
| 2444 |
{34, "R_LARCH_SOP_SR"}, |
| 2445 |
{35, "R_LARCH_SOP_ADD"}, |
| 2446 |
{36, "R_LARCH_SOP_AND"}, |
| 2447 |
{37, "R_LARCH_SOP_IF_ELSE"}, |
| 2448 |
{38, "R_LARCH_SOP_POP_32_S_10_5"}, |
| 2449 |
{39, "R_LARCH_SOP_POP_32_U_10_12"}, |
| 2450 |
{40, "R_LARCH_SOP_POP_32_S_10_12"}, |
| 2451 |
{41, "R_LARCH_SOP_POP_32_S_10_16"}, |
| 2452 |
{42, "R_LARCH_SOP_POP_32_S_10_16_S2"}, |
| 2453 |
{43, "R_LARCH_SOP_POP_32_S_5_20"}, |
| 2454 |
{44, "R_LARCH_SOP_POP_32_S_0_5_10_16_S2"}, |
| 2455 |
{45, "R_LARCH_SOP_POP_32_S_0_10_10_16_S2"}, |
| 2456 |
{46, "R_LARCH_SOP_POP_32_U"}, |
| 2457 |
{47, "R_LARCH_ADD8"}, |
| 2458 |
{48, "R_LARCH_ADD16"}, |
| 2459 |
{49, "R_LARCH_ADD24"}, |
| 2460 |
{50, "R_LARCH_ADD32"}, |
| 2461 |
{51, "R_LARCH_ADD64"}, |
| 2462 |
{52, "R_LARCH_SUB8"}, |
| 2463 |
{53, "R_LARCH_SUB16"}, |
| 2464 |
{54, "R_LARCH_SUB24"}, |
| 2465 |
{55, "R_LARCH_SUB32"}, |
| 2466 |
{56, "R_LARCH_SUB64"}, |
| 2467 |
{57, "R_LARCH_GNU_VTINHERIT"}, |
| 2468 |
{58, "R_LARCH_GNU_VTENTRY"}, |
| 2469 |
{64, "R_LARCH_B16"}, |
| 2470 |
{65, "R_LARCH_B21"}, |
| 2471 |
{66, "R_LARCH_B26"}, |
| 2472 |
{67, "R_LARCH_ABS_HI20"}, |
| 2473 |
{68, "R_LARCH_ABS_LO12"}, |
| 2474 |
{69, "R_LARCH_ABS64_LO20"}, |
| 2475 |
{70, "R_LARCH_ABS64_HI12"}, |
| 2476 |
{71, "R_LARCH_PCALA_HI20"}, |
| 2477 |
{72, "R_LARCH_PCALA_LO12"}, |
| 2478 |
{73, "R_LARCH_PCALA64_LO20"}, |
| 2479 |
{74, "R_LARCH_PCALA64_HI12"}, |
| 2480 |
{75, "R_LARCH_GOT_PC_HI20"}, |
| 2481 |
{76, "R_LARCH_GOT_PC_LO12"}, |
| 2482 |
{77, "R_LARCH_GOT64_PC_LO20"}, |
| 2483 |
{78, "R_LARCH_GOT64_PC_HI12"}, |
| 2484 |
{79, "R_LARCH_GOT_HI20"}, |
| 2485 |
{80, "R_LARCH_GOT_LO12"}, |
| 2486 |
{81, "R_LARCH_GOT64_LO20"}, |
| 2487 |
{82, "R_LARCH_GOT64_HI12"}, |
| 2488 |
{83, "R_LARCH_TLS_LE_HI20"}, |
| 2489 |
{84, "R_LARCH_TLS_LE_LO12"}, |
| 2490 |
{85, "R_LARCH_TLS_LE64_LO20"}, |
| 2491 |
{86, "R_LARCH_TLS_LE64_HI12"}, |
| 2492 |
{87, "R_LARCH_TLS_IE_PC_HI20"}, |
| 2493 |
{88, "R_LARCH_TLS_IE_PC_LO12"}, |
| 2494 |
{89, "R_LARCH_TLS_IE64_PC_LO20"}, |
| 2495 |
{90, "R_LARCH_TLS_IE64_PC_HI12"}, |
| 2496 |
{91, "R_LARCH_TLS_IE_HI20"}, |
| 2497 |
{92, "R_LARCH_TLS_IE_LO12"}, |
| 2498 |
{93, "R_LARCH_TLS_IE64_LO20"}, |
| 2499 |
{94, "R_LARCH_TLS_IE64_HI12"}, |
| 2500 |
{95, "R_LARCH_TLS_LD_PC_HI20"}, |
| 2501 |
{96, "R_LARCH_TLS_LD_HI20"}, |
| 2502 |
{97, "R_LARCH_TLS_GD_PC_HI20"}, |
| 2503 |
{98, "R_LARCH_TLS_GD_HI20"}, |
| 2504 |
{99, "R_LARCH_32_PCREL"}, |
| 2505 |
{100, "R_LARCH_RELAX"}, |
| 2506 |
{101, "R_LARCH_DELETE"}, |
| 2507 |
{102, "R_LARCH_ALIGN"}, |
| 2508 |
{103, "R_LARCH_PCREL20_S2"}, |
| 2509 |
{104, "R_LARCH_CFA"}, |
| 2510 |
{105, "R_LARCH_ADD6"}, |
| 2511 |
{106, "R_LARCH_SUB6"}, |
| 2512 |
{107, "R_LARCH_ADD_ULEB128"}, |
| 2513 |
{108, "R_LARCH_SUB_ULEB128"}, |
| 2514 |
{109, "R_LARCH_64_PCREL"}, |
| 2515 |
{110, "R_LARCH_CALL36"}, |
| 2516 |
{111, "R_LARCH_TLS_DESC_PC_HI20"}, |
| 2517 |
{112, "R_LARCH_TLS_DESC_PC_LO12"}, |
| 2518 |
{113, "R_LARCH_TLS_DESC64_PC_LO20"}, |
| 2519 |
{114, "R_LARCH_TLS_DESC64_PC_HI12"}, |
| 2520 |
{115, "R_LARCH_TLS_DESC_HI20"}, |
| 2521 |
{116, "R_LARCH_TLS_DESC_LO12"}, |
| 2522 |
{117, "R_LARCH_TLS_DESC64_LO20"}, |
| 2523 |
{118, "R_LARCH_TLS_DESC64_HI12"}, |
| 2524 |
{119, "R_LARCH_TLS_DESC_LD"}, |
| 2525 |
{120, "R_LARCH_TLS_DESC_CALL"}, |
| 2526 |
{121, "R_LARCH_TLS_LE_HI20_R"}, |
| 2527 |
{122, "R_LARCH_TLS_LE_ADD_R"}, |
| 2528 |
{123, "R_LARCH_TLS_LE_LO12_R"}, |
| 2529 |
{124, "R_LARCH_TLS_LD_PCREL20_S2"}, |
| 2530 |
{125, "R_LARCH_TLS_GD_PCREL20_S2"}, |
| 2531 |
{126, "R_LARCH_TLS_DESC_PCREL20_S2"}, |
| 2532 |
} |
| 2533 |
|
| 2534 |
func (i R_LARCH) String() string { return stringName(uint32(i), rlarchStrings, false) } |
| 2535 |
func (i R_LARCH) GoString() string { return stringName(uint32(i), rlarchStrings, true) } |
| 2536 |
|
| 2537 |
// Relocation types for PowerPC. |
| 2538 |
// |
| 2539 |
// Values that are shared by both R_PPC and R_PPC64 are prefixed with |
| 2540 |
// R_POWERPC_ in the ELF standard. For the R_PPC type, the relevant |
| 2541 |
// shared relocations have been renamed with the prefix R_PPC_. |
| 2542 |
// The original name follows the value in a comment. |
| 2543 |
type R_PPC int |
| 2544 |
|
| 2545 |
const ( |
| 2546 |
R_PPC_NONE R_PPC = 0 // R_POWERPC_NONE |
| 2547 |
R_PPC_ADDR32 R_PPC = 1 // R_POWERPC_ADDR32 |
| 2548 |
R_PPC_ADDR24 R_PPC = 2 // R_POWERPC_ADDR24 |
| 2549 |
R_PPC_ADDR16 R_PPC = 3 // R_POWERPC_ADDR16 |
| 2550 |
R_PPC_ADDR16_LO R_PPC = 4 // R_POWERPC_ADDR16_LO |
| 2551 |
R_PPC_ADDR16_HI R_PPC = 5 // R_POWERPC_ADDR16_HI |
| 2552 |
R_PPC_ADDR16_HA R_PPC = 6 // R_POWERPC_ADDR16_HA |
| 2553 |
R_PPC_ADDR14 R_PPC = 7 // R_POWERPC_ADDR14 |
| 2554 |
R_PPC_ADDR14_BRTAKEN R_PPC = 8 // R_POWERPC_ADDR14_BRTAKEN |
| 2555 |
R_PPC_ADDR14_BRNTAKEN R_PPC = 9 // R_POWERPC_ADDR14_BRNTAKEN |
| 2556 |
R_PPC_REL24 R_PPC = 10 // R_POWERPC_REL24 |
| 2557 |
R_PPC_REL14 R_PPC = 11 // R_POWERPC_REL14 |
| 2558 |
R_PPC_REL14_BRTAKEN R_PPC = 12 // R_POWERPC_REL14_BRTAKEN |
| 2559 |
R_PPC_REL14_BRNTAKEN R_PPC = 13 // R_POWERPC_REL14_BRNTAKEN |
| 2560 |
R_PPC_GOT16 R_PPC = 14 // R_POWERPC_GOT16 |
| 2561 |
R_PPC_GOT16_LO R_PPC = 15 // R_POWERPC_GOT16_LO |
| 2562 |
R_PPC_GOT16_HI R_PPC = 16 // R_POWERPC_GOT16_HI |
| 2563 |
R_PPC_GOT16_HA R_PPC = 17 // R_POWERPC_GOT16_HA |
| 2564 |
R_PPC_PLTREL24 R_PPC = 18 |
| 2565 |
R_PPC_COPY R_PPC = 19 // R_POWERPC_COPY |
| 2566 |
R_PPC_GLOB_DAT R_PPC = 20 // R_POWERPC_GLOB_DAT |
| 2567 |
R_PPC_JMP_SLOT R_PPC = 21 // R_POWERPC_JMP_SLOT |
| 2568 |
R_PPC_RELATIVE R_PPC = 22 // R_POWERPC_RELATIVE |
| 2569 |
R_PPC_LOCAL24PC R_PPC = 23 |
| 2570 |
R_PPC_UADDR32 R_PPC = 24 // R_POWERPC_UADDR32 |
| 2571 |
R_PPC_UADDR16 R_PPC = 25 // R_POWERPC_UADDR16 |
| 2572 |
R_PPC_REL32 R_PPC = 26 // R_POWERPC_REL32 |
| 2573 |
R_PPC_PLT32 R_PPC = 27 // R_POWERPC_PLT32 |
| 2574 |
R_PPC_PLTREL32 R_PPC = 28 // R_POWERPC_PLTREL32 |
| 2575 |
R_PPC_PLT16_LO R_PPC = 29 // R_POWERPC_PLT16_LO |
| 2576 |
R_PPC_PLT16_HI R_PPC = 30 // R_POWERPC_PLT16_HI |
| 2577 |
R_PPC_PLT16_HA R_PPC = 31 // R_POWERPC_PLT16_HA |
| 2578 |
R_PPC_SDAREL16 R_PPC = 32 |
| 2579 |
R_PPC_SECTOFF R_PPC = 33 // R_POWERPC_SECTOFF |
| 2580 |
R_PPC_SECTOFF_LO R_PPC = 34 // R_POWERPC_SECTOFF_LO |
| 2581 |
R_PPC_SECTOFF_HI R_PPC = 35 // R_POWERPC_SECTOFF_HI |
| 2582 |
R_PPC_SECTOFF_HA R_PPC = 36 // R_POWERPC_SECTOFF_HA |
| 2583 |
R_PPC_TLS R_PPC = 67 // R_POWERPC_TLS |
| 2584 |
R_PPC_DTPMOD32 R_PPC = 68 // R_POWERPC_DTPMOD32 |
| 2585 |
R_PPC_TPREL16 R_PPC = 69 // R_POWERPC_TPREL16 |
| 2586 |
R_PPC_TPREL16_LO R_PPC = 70 // R_POWERPC_TPREL16_LO |
| 2587 |
R_PPC_TPREL16_HI R_PPC = 71 // R_POWERPC_TPREL16_HI |
| 2588 |
R_PPC_TPREL16_HA R_PPC = 72 // R_POWERPC_TPREL16_HA |
| 2589 |
R_PPC_TPREL32 R_PPC = 73 // R_POWERPC_TPREL32 |
| 2590 |
R_PPC_DTPREL16 R_PPC = 74 // R_POWERPC_DTPREL16 |
| 2591 |
R_PPC_DTPREL16_LO R_PPC = 75 // R_POWERPC_DTPREL16_LO |
| 2592 |
R_PPC_DTPREL16_HI R_PPC = 76 // R_POWERPC_DTPREL16_HI |
| 2593 |
R_PPC_DTPREL16_HA R_PPC = 77 // R_POWERPC_DTPREL16_HA |
| 2594 |
R_PPC_DTPREL32 R_PPC = 78 // R_POWERPC_DTPREL32 |
| 2595 |
R_PPC_GOT_TLSGD16 R_PPC = 79 // R_POWERPC_GOT_TLSGD16 |
| 2596 |
R_PPC_GOT_TLSGD16_LO R_PPC = 80 // R_POWERPC_GOT_TLSGD16_LO |
| 2597 |
R_PPC_GOT_TLSGD16_HI R_PPC = 81 // R_POWERPC_GOT_TLSGD16_HI |
| 2598 |
R_PPC_GOT_TLSGD16_HA R_PPC = 82 // R_POWERPC_GOT_TLSGD16_HA |
| 2599 |
R_PPC_GOT_TLSLD16 R_PPC = 83 // R_POWERPC_GOT_TLSLD16 |
| 2600 |
R_PPC_GOT_TLSLD16_LO R_PPC = 84 // R_POWERPC_GOT_TLSLD16_LO |
| 2601 |
R_PPC_GOT_TLSLD16_HI R_PPC = 85 // R_POWERPC_GOT_TLSLD16_HI |
| 2602 |
R_PPC_GOT_TLSLD16_HA R_PPC = 86 // R_POWERPC_GOT_TLSLD16_HA |
| 2603 |
R_PPC_GOT_TPREL16 R_PPC = 87 // R_POWERPC_GOT_TPREL16 |
| 2604 |
R_PPC_GOT_TPREL16_LO R_PPC = 88 // R_POWERPC_GOT_TPREL16_LO |
| 2605 |
R_PPC_GOT_TPREL16_HI R_PPC = 89 // R_POWERPC_GOT_TPREL16_HI |
| 2606 |
R_PPC_GOT_TPREL16_HA R_PPC = 90 // R_POWERPC_GOT_TPREL16_HA |
| 2607 |
R_PPC_EMB_NADDR32 R_PPC = 101 |
| 2608 |
R_PPC_EMB_NADDR16 R_PPC = 102 |
| 2609 |
R_PPC_EMB_NADDR16_LO R_PPC = 103 |
| 2610 |
R_PPC_EMB_NADDR16_HI R_PPC = 104 |
| 2611 |
R_PPC_EMB_NADDR16_HA R_PPC = 105 |
| 2612 |
R_PPC_EMB_SDAI16 R_PPC = 106 |
| 2613 |
R_PPC_EMB_SDA2I16 R_PPC = 107 |
| 2614 |
R_PPC_EMB_SDA2REL R_PPC = 108 |
| 2615 |
R_PPC_EMB_SDA21 R_PPC = 109 |
| 2616 |
R_PPC_EMB_MRKREF R_PPC = 110 |
| 2617 |
R_PPC_EMB_RELSEC16 R_PPC = 111 |
| 2618 |
R_PPC_EMB_RELST_LO R_PPC = 112 |
| 2619 |
R_PPC_EMB_RELST_HI R_PPC = 113 |
| 2620 |
R_PPC_EMB_RELST_HA R_PPC = 114 |
| 2621 |
R_PPC_EMB_BIT_FLD R_PPC = 115 |
| 2622 |
R_PPC_EMB_RELSDA R_PPC = 116 |
| 2623 |
) |
| 2624 |
|
| 2625 |
var rppcStrings = []intName{ |
| 2626 |
{0, "R_PPC_NONE"}, |
| 2627 |
{1, "R_PPC_ADDR32"}, |
| 2628 |
{2, "R_PPC_ADDR24"}, |
| 2629 |
{3, "R_PPC_ADDR16"}, |
| 2630 |
{4, "R_PPC_ADDR16_LO"}, |
| 2631 |
{5, "R_PPC_ADDR16_HI"}, |
| 2632 |
{6, "R_PPC_ADDR16_HA"}, |
| 2633 |
{7, "R_PPC_ADDR14"}, |
| 2634 |
{8, "R_PPC_ADDR14_BRTAKEN"}, |
| 2635 |
{9, "R_PPC_ADDR14_BRNTAKEN"}, |
| 2636 |
{10, "R_PPC_REL24"}, |
| 2637 |
{11, "R_PPC_REL14"}, |
| 2638 |
{12, "R_PPC_REL14_BRTAKEN"}, |
| 2639 |
{13, "R_PPC_REL14_BRNTAKEN"}, |
| 2640 |
{14, "R_PPC_GOT16"}, |
| 2641 |
{15, "R_PPC_GOT16_LO"}, |
| 2642 |
{16, "R_PPC_GOT16_HI"}, |
| 2643 |
{17, "R_PPC_GOT16_HA"}, |
| 2644 |
{18, "R_PPC_PLTREL24"}, |
| 2645 |
{19, "R_PPC_COPY"}, |
| 2646 |
{20, "R_PPC_GLOB_DAT"}, |
| 2647 |
{21, "R_PPC_JMP_SLOT"}, |
| 2648 |
{22, "R_PPC_RELATIVE"}, |
| 2649 |
{23, "R_PPC_LOCAL24PC"}, |
| 2650 |
{24, "R_PPC_UADDR32"}, |
| 2651 |
{25, "R_PPC_UADDR16"}, |
| 2652 |
{26, "R_PPC_REL32"}, |
| 2653 |
{27, "R_PPC_PLT32"}, |
| 2654 |
{28, "R_PPC_PLTREL32"}, |
| 2655 |
{29, "R_PPC_PLT16_LO"}, |
| 2656 |
{30, "R_PPC_PLT16_HI"}, |
| 2657 |
{31, "R_PPC_PLT16_HA"}, |
| 2658 |
{32, "R_PPC_SDAREL16"}, |
| 2659 |
{33, "R_PPC_SECTOFF"}, |
| 2660 |
{34, "R_PPC_SECTOFF_LO"}, |
| 2661 |
{35, "R_PPC_SECTOFF_HI"}, |
| 2662 |
{36, "R_PPC_SECTOFF_HA"}, |
| 2663 |
{67, "R_PPC_TLS"}, |
| 2664 |
{68, "R_PPC_DTPMOD32"}, |
| 2665 |
{69, "R_PPC_TPREL16"}, |
| 2666 |
{70, "R_PPC_TPREL16_LO"}, |
| 2667 |
{71, "R_PPC_TPREL16_HI"}, |
| 2668 |
{72, "R_PPC_TPREL16_HA"}, |
| 2669 |
{73, "R_PPC_TPREL32"}, |
| 2670 |
{74, "R_PPC_DTPREL16"}, |
| 2671 |
{75, "R_PPC_DTPREL16_LO"}, |
| 2672 |
{76, "R_PPC_DTPREL16_HI"}, |
| 2673 |
{77, "R_PPC_DTPREL16_HA"}, |
| 2674 |
{78, "R_PPC_DTPREL32"}, |
| 2675 |
{79, "R_PPC_GOT_TLSGD16"}, |
| 2676 |
{80, "R_PPC_GOT_TLSGD16_LO"}, |
| 2677 |
{81, "R_PPC_GOT_TLSGD16_HI"}, |
| 2678 |
{82, "R_PPC_GOT_TLSGD16_HA"}, |
| 2679 |
{83, "R_PPC_GOT_TLSLD16"}, |
| 2680 |
{84, "R_PPC_GOT_TLSLD16_LO"}, |
| 2681 |
{85, "R_PPC_GOT_TLSLD16_HI"}, |
| 2682 |
{86, "R_PPC_GOT_TLSLD16_HA"}, |
| 2683 |
{87, "R_PPC_GOT_TPREL16"}, |
| 2684 |
{88, "R_PPC_GOT_TPREL16_LO"}, |
| 2685 |
{89, "R_PPC_GOT_TPREL16_HI"}, |
| 2686 |
{90, "R_PPC_GOT_TPREL16_HA"}, |
| 2687 |
{101, "R_PPC_EMB_NADDR32"}, |
| 2688 |
{102, "R_PPC_EMB_NADDR16"}, |
| 2689 |
{103, "R_PPC_EMB_NADDR16_LO"}, |
| 2690 |
{104, "R_PPC_EMB_NADDR16_HI"}, |
| 2691 |
{105, "R_PPC_EMB_NADDR16_HA"}, |
| 2692 |
{106, "R_PPC_EMB_SDAI16"}, |
| 2693 |
{107, "R_PPC_EMB_SDA2I16"}, |
| 2694 |
{108, "R_PPC_EMB_SDA2REL"}, |
| 2695 |
{109, "R_PPC_EMB_SDA21"}, |
| 2696 |
{110, "R_PPC_EMB_MRKREF"}, |
| 2697 |
{111, "R_PPC_EMB_RELSEC16"}, |
| 2698 |
{112, "R_PPC_EMB_RELST_LO"}, |
| 2699 |
{113, "R_PPC_EMB_RELST_HI"}, |
| 2700 |
{114, "R_PPC_EMB_RELST_HA"}, |
| 2701 |
{115, "R_PPC_EMB_BIT_FLD"}, |
| 2702 |
{116, "R_PPC_EMB_RELSDA"}, |
| 2703 |
} |
| 2704 |
|
| 2705 |
func (i R_PPC) String() string { return stringName(uint32(i), rppcStrings, false) } |
| 2706 |
func (i R_PPC) GoString() string { return stringName(uint32(i), rppcStrings, true) } |
| 2707 |
|
| 2708 |
// Relocation types for 64-bit PowerPC or Power Architecture processors. |
| 2709 |
// |
| 2710 |
// Values that are shared by both R_PPC and R_PPC64 are prefixed with |
| 2711 |
// R_POWERPC_ in the ELF standard. For the R_PPC64 type, the relevant |
| 2712 |
// shared relocations have been renamed with the prefix R_PPC64_. |
| 2713 |
// The original name follows the value in a comment. |
| 2714 |
type R_PPC64 int |
| 2715 |
|
| 2716 |
const ( |
| 2717 |
R_PPC64_NONE R_PPC64 = 0 // R_POWERPC_NONE |
| 2718 |
R_PPC64_ADDR32 R_PPC64 = 1 // R_POWERPC_ADDR32 |
| 2719 |
R_PPC64_ADDR24 R_PPC64 = 2 // R_POWERPC_ADDR24 |
| 2720 |
R_PPC64_ADDR16 R_PPC64 = 3 // R_POWERPC_ADDR16 |
| 2721 |
R_PPC64_ADDR16_LO R_PPC64 = 4 // R_POWERPC_ADDR16_LO |
| 2722 |
R_PPC64_ADDR16_HI R_PPC64 = 5 // R_POWERPC_ADDR16_HI |
| 2723 |
R_PPC64_ADDR16_HA R_PPC64 = 6 // R_POWERPC_ADDR16_HA |
| 2724 |
R_PPC64_ADDR14 R_PPC64 = 7 // R_POWERPC_ADDR14 |
| 2725 |
R_PPC64_ADDR14_BRTAKEN R_PPC64 = 8 // R_POWERPC_ADDR14_BRTAKEN |
| 2726 |
R_PPC64_ADDR14_BRNTAKEN R_PPC64 = 9 // R_POWERPC_ADDR14_BRNTAKEN |
| 2727 |
R_PPC64_REL24 R_PPC64 = 10 // R_POWERPC_REL24 |
| 2728 |
R_PPC64_REL14 R_PPC64 = 11 // R_POWERPC_REL14 |
| 2729 |
R_PPC64_REL14_BRTAKEN R_PPC64 = 12 // R_POWERPC_REL14_BRTAKEN |
| 2730 |
R_PPC64_REL14_BRNTAKEN R_PPC64 = 13 // R_POWERPC_REL14_BRNTAKEN |
| 2731 |
R_PPC64_GOT16 R_PPC64 = 14 // R_POWERPC_GOT16 |
| 2732 |
R_PPC64_GOT16_LO R_PPC64 = 15 // R_POWERPC_GOT16_LO |
| 2733 |
R_PPC64_GOT16_HI R_PPC64 = 16 // R_POWERPC_GOT16_HI |
| 2734 |
R_PPC64_GOT16_HA R_PPC64 = 17 // R_POWERPC_GOT16_HA |
| 2735 |
R_PPC64_COPY R_PPC64 = 19 // R_POWERPC_COPY |
| 2736 |
R_PPC64_GLOB_DAT R_PPC64 = 20 // R_POWERPC_GLOB_DAT |
| 2737 |
R_PPC64_JMP_SLOT R_PPC64 = 21 // R_POWERPC_JMP_SLOT |
| 2738 |
R_PPC64_RELATIVE R_PPC64 = 22 // R_POWERPC_RELATIVE |
| 2739 |
R_PPC64_UADDR32 R_PPC64 = 24 // R_POWERPC_UADDR32 |
| 2740 |
R_PPC64_UADDR16 R_PPC64 = 25 // R_POWERPC_UADDR16 |
| 2741 |
R_PPC64_REL32 R_PPC64 = 26 // R_POWERPC_REL32 |
| 2742 |
R_PPC64_PLT32 R_PPC64 = 27 // R_POWERPC_PLT32 |
| 2743 |
R_PPC64_PLTREL32 R_PPC64 = 28 // R_POWERPC_PLTREL32 |
| 2744 |
R_PPC64_PLT16_LO R_PPC64 = 29 // R_POWERPC_PLT16_LO |
| 2745 |
R_PPC64_PLT16_HI R_PPC64 = 30 // R_POWERPC_PLT16_HI |
| 2746 |
R_PPC64_PLT16_HA R_PPC64 = 31 // R_POWERPC_PLT16_HA |
| 2747 |
R_PPC64_SECTOFF R_PPC64 = 33 // R_POWERPC_SECTOFF |
| 2748 |
R_PPC64_SECTOFF_LO R_PPC64 = 34 // R_POWERPC_SECTOFF_LO |
| 2749 |
R_PPC64_SECTOFF_HI R_PPC64 = 35 // R_POWERPC_SECTOFF_HI |
| 2750 |
R_PPC64_SECTOFF_HA R_PPC64 = 36 // R_POWERPC_SECTOFF_HA |
| 2751 |
R_PPC64_REL30 R_PPC64 = 37 // R_POWERPC_ADDR30 |
| 2752 |
R_PPC64_ADDR64 R_PPC64 = 38 |
| 2753 |
R_PPC64_ADDR16_HIGHER R_PPC64 = 39 |
| 2754 |
R_PPC64_ADDR16_HIGHERA R_PPC64 = 40 |
| 2755 |
R_PPC64_ADDR16_HIGHEST R_PPC64 = 41 |
| 2756 |
R_PPC64_ADDR16_HIGHESTA R_PPC64 = 42 |
| 2757 |
R_PPC64_UADDR64 R_PPC64 = 43 |
| 2758 |
R_PPC64_REL64 R_PPC64 = 44 |
| 2759 |
R_PPC64_PLT64 R_PPC64 = 45 |
| 2760 |
R_PPC64_PLTREL64 R_PPC64 = 46 |
| 2761 |
R_PPC64_TOC16 R_PPC64 = 47 |
| 2762 |
R_PPC64_TOC16_LO R_PPC64 = 48 |
| 2763 |
R_PPC64_TOC16_HI R_PPC64 = 49 |
| 2764 |
R_PPC64_TOC16_HA R_PPC64 = 50 |
| 2765 |
R_PPC64_TOC R_PPC64 = 51 |
| 2766 |
R_PPC64_PLTGOT16 R_PPC64 = 52 |
| 2767 |
R_PPC64_PLTGOT16_LO R_PPC64 = 53 |
| 2768 |
R_PPC64_PLTGOT16_HI R_PPC64 = 54 |
| 2769 |
R_PPC64_PLTGOT16_HA R_PPC64 = 55 |
| 2770 |
R_PPC64_ADDR16_DS R_PPC64 = 56 |
| 2771 |
R_PPC64_ADDR16_LO_DS R_PPC64 = 57 |
| 2772 |
R_PPC64_GOT16_DS R_PPC64 = 58 |
| 2773 |
R_PPC64_GOT16_LO_DS R_PPC64 = 59 |
| 2774 |
R_PPC64_PLT16_LO_DS R_PPC64 = 60 |
| 2775 |
R_PPC64_SECTOFF_DS R_PPC64 = 61 |
| 2776 |
R_PPC64_SECTOFF_LO_DS R_PPC64 = 62 |
| 2777 |
R_PPC64_TOC16_DS R_PPC64 = 63 |
| 2778 |
R_PPC64_TOC16_LO_DS R_PPC64 = 64 |
| 2779 |
R_PPC64_PLTGOT16_DS R_PPC64 = 65 |
| 2780 |
R_PPC64_PLTGOT_LO_DS R_PPC64 = 66 |
| 2781 |
R_PPC64_TLS R_PPC64 = 67 // R_POWERPC_TLS |
| 2782 |
R_PPC64_DTPMOD64 R_PPC64 = 68 // R_POWERPC_DTPMOD64 |
| 2783 |
R_PPC64_TPREL16 R_PPC64 = 69 // R_POWERPC_TPREL16 |
| 2784 |
R_PPC64_TPREL16_LO R_PPC64 = 70 // R_POWERPC_TPREL16_LO |
| 2785 |
R_PPC64_TPREL16_HI R_PPC64 = 71 // R_POWERPC_TPREL16_HI |
| 2786 |
R_PPC64_TPREL16_HA R_PPC64 = 72 // R_POWERPC_TPREL16_HA |
| 2787 |
R_PPC64_TPREL64 R_PPC64 = 73 // R_POWERPC_TPREL64 |
| 2788 |
R_PPC64_DTPREL16 R_PPC64 = 74 // R_POWERPC_DTPREL16 |
| 2789 |
R_PPC64_DTPREL16_LO R_PPC64 = 75 // R_POWERPC_DTPREL16_LO |
| 2790 |
R_PPC64_DTPREL16_HI R_PPC64 = 76 // R_POWERPC_DTPREL16_HI |
| 2791 |
R_PPC64_DTPREL16_HA R_PPC64 = 77 // R_POWERPC_DTPREL16_HA |
| 2792 |
R_PPC64_DTPREL64 R_PPC64 = 78 // R_POWERPC_DTPREL64 |
| 2793 |
R_PPC64_GOT_TLSGD16 R_PPC64 = 79 // R_POWERPC_GOT_TLSGD16 |
| 2794 |
R_PPC64_GOT_TLSGD16_LO R_PPC64 = 80 // R_POWERPC_GOT_TLSGD16_LO |
| 2795 |
R_PPC64_GOT_TLSGD16_HI R_PPC64 = 81 // R_POWERPC_GOT_TLSGD16_HI |
| 2796 |
R_PPC64_GOT_TLSGD16_HA R_PPC64 = 82 // R_POWERPC_GOT_TLSGD16_HA |
| 2797 |
R_PPC64_GOT_TLSLD16 R_PPC64 = 83 // R_POWERPC_GOT_TLSLD16 |
| 2798 |
R_PPC64_GOT_TLSLD16_LO R_PPC64 = 84 // R_POWERPC_GOT_TLSLD16_LO |
| 2799 |
R_PPC64_GOT_TLSLD16_HI R_PPC64 = 85 // R_POWERPC_GOT_TLSLD16_HI |
| 2800 |
R_PPC64_GOT_TLSLD16_HA R_PPC64 = 86 // R_POWERPC_GOT_TLSLD16_HA |
| 2801 |
R_PPC64_GOT_TPREL16_DS R_PPC64 = 87 // R_POWERPC_GOT_TPREL16_DS |
| 2802 |
R_PPC64_GOT_TPREL16_LO_DS R_PPC64 = 88 // R_POWERPC_GOT_TPREL16_LO_DS |
| 2803 |
R_PPC64_GOT_TPREL16_HI R_PPC64 = 89 // R_POWERPC_GOT_TPREL16_HI |
| 2804 |
R_PPC64_GOT_TPREL16_HA R_PPC64 = 90 // R_POWERPC_GOT_TPREL16_HA |
| 2805 |
R_PPC64_GOT_DTPREL16_DS R_PPC64 = 91 // R_POWERPC_GOT_DTPREL16_DS |
| 2806 |
R_PPC64_GOT_DTPREL16_LO_DS R_PPC64 = 92 // R_POWERPC_GOT_DTPREL16_LO_DS |
| 2807 |
R_PPC64_GOT_DTPREL16_HI R_PPC64 = 93 // R_POWERPC_GOT_DTPREL16_HI |
| 2808 |
R_PPC64_GOT_DTPREL16_HA R_PPC64 = 94 // R_POWERPC_GOT_DTPREL16_HA |
| 2809 |
R_PPC64_TPREL16_DS R_PPC64 = 95 |
| 2810 |
R_PPC64_TPREL16_LO_DS R_PPC64 = 96 |
| 2811 |
R_PPC64_TPREL16_HIGHER R_PPC64 = 97 |
| 2812 |
R_PPC64_TPREL16_HIGHERA R_PPC64 = 98 |
| 2813 |
R_PPC64_TPREL16_HIGHEST R_PPC64 = 99 |
| 2814 |
R_PPC64_TPREL16_HIGHESTA R_PPC64 = 100 |
| 2815 |
R_PPC64_DTPREL16_DS R_PPC64 = 101 |
| 2816 |
R_PPC64_DTPREL16_LO_DS R_PPC64 = 102 |
| 2817 |
R_PPC64_DTPREL16_HIGHER R_PPC64 = 103 |
| 2818 |
R_PPC64_DTPREL16_HIGHERA R_PPC64 = 104 |
| 2819 |
R_PPC64_DTPREL16_HIGHEST R_PPC64 = 105 |
| 2820 |
R_PPC64_DTPREL16_HIGHESTA R_PPC64 = 106 |
| 2821 |
R_PPC64_TLSGD R_PPC64 = 107 |
| 2822 |
R_PPC64_TLSLD R_PPC64 = 108 |
| 2823 |
R_PPC64_TOCSAVE R_PPC64 = 109 |
| 2824 |
R_PPC64_ADDR16_HIGH R_PPC64 = 110 |
| 2825 |
R_PPC64_ADDR16_HIGHA R_PPC64 = 111 |
| 2826 |
R_PPC64_TPREL16_HIGH R_PPC64 = 112 |
| 2827 |
R_PPC64_TPREL16_HIGHA R_PPC64 = 113 |
| 2828 |
R_PPC64_DTPREL16_HIGH R_PPC64 = 114 |
| 2829 |
R_PPC64_DTPREL16_HIGHA R_PPC64 = 115 |
| 2830 |
R_PPC64_REL24_NOTOC R_PPC64 = 116 |
| 2831 |
R_PPC64_ADDR64_LOCAL R_PPC64 = 117 |
| 2832 |
R_PPC64_ENTRY R_PPC64 = 118 |
| 2833 |
R_PPC64_PLTSEQ R_PPC64 = 119 |
| 2834 |
R_PPC64_PLTCALL R_PPC64 = 120 |
| 2835 |
R_PPC64_PLTSEQ_NOTOC R_PPC64 = 121 |
| 2836 |
R_PPC64_PLTCALL_NOTOC R_PPC64 = 122 |
| 2837 |
R_PPC64_PCREL_OPT R_PPC64 = 123 |
| 2838 |
R_PPC64_REL24_P9NOTOC R_PPC64 = 124 |
| 2839 |
R_PPC64_D34 R_PPC64 = 128 |
| 2840 |
R_PPC64_D34_LO R_PPC64 = 129 |
| 2841 |
R_PPC64_D34_HI30 R_PPC64 = 130 |
| 2842 |
R_PPC64_D34_HA30 R_PPC64 = 131 |
| 2843 |
R_PPC64_PCREL34 R_PPC64 = 132 |
| 2844 |
R_PPC64_GOT_PCREL34 R_PPC64 = 133 |
| 2845 |
R_PPC64_PLT_PCREL34 R_PPC64 = 134 |
| 2846 |
R_PPC64_PLT_PCREL34_NOTOC R_PPC64 = 135 |
| 2847 |
R_PPC64_ADDR16_HIGHER34 R_PPC64 = 136 |
| 2848 |
R_PPC64_ADDR16_HIGHERA34 R_PPC64 = 137 |
| 2849 |
R_PPC64_ADDR16_HIGHEST34 R_PPC64 = 138 |
| 2850 |
R_PPC64_ADDR16_HIGHESTA34 R_PPC64 = 139 |
| 2851 |
R_PPC64_REL16_HIGHER34 R_PPC64 = 140 |
| 2852 |
R_PPC64_REL16_HIGHERA34 R_PPC64 = 141 |
| 2853 |
R_PPC64_REL16_HIGHEST34 R_PPC64 = 142 |
| 2854 |
R_PPC64_REL16_HIGHESTA34 R_PPC64 = 143 |
| 2855 |
R_PPC64_D28 R_PPC64 = 144 |
| 2856 |
R_PPC64_PCREL28 R_PPC64 = 145 |
| 2857 |
R_PPC64_TPREL34 R_PPC64 = 146 |
| 2858 |
R_PPC64_DTPREL34 R_PPC64 = 147 |
| 2859 |
R_PPC64_GOT_TLSGD_PCREL34 R_PPC64 = 148 |
| 2860 |
R_PPC64_GOT_TLSLD_PCREL34 R_PPC64 = 149 |
| 2861 |
R_PPC64_GOT_TPREL_PCREL34 R_PPC64 = 150 |
| 2862 |
R_PPC64_GOT_DTPREL_PCREL34 R_PPC64 = 151 |
| 2863 |
R_PPC64_REL16_HIGH R_PPC64 = 240 |
| 2864 |
R_PPC64_REL16_HIGHA R_PPC64 = 241 |
| 2865 |
R_PPC64_REL16_HIGHER R_PPC64 = 242 |
| 2866 |
R_PPC64_REL16_HIGHERA R_PPC64 = 243 |
| 2867 |
R_PPC64_REL16_HIGHEST R_PPC64 = 244 |
| 2868 |
R_PPC64_REL16_HIGHESTA R_PPC64 = 245 |
| 2869 |
R_PPC64_REL16DX_HA R_PPC64 = 246 // R_POWERPC_REL16DX_HA |
| 2870 |
R_PPC64_JMP_IREL R_PPC64 = 247 |
| 2871 |
R_PPC64_IRELATIVE R_PPC64 = 248 // R_POWERPC_IRELATIVE |
| 2872 |
R_PPC64_REL16 R_PPC64 = 249 // R_POWERPC_REL16 |
| 2873 |
R_PPC64_REL16_LO R_PPC64 = 250 // R_POWERPC_REL16_LO |
| 2874 |
R_PPC64_REL16_HI R_PPC64 = 251 // R_POWERPC_REL16_HI |
| 2875 |
R_PPC64_REL16_HA R_PPC64 = 252 // R_POWERPC_REL16_HA |
| 2876 |
R_PPC64_GNU_VTINHERIT R_PPC64 = 253 |
| 2877 |
R_PPC64_GNU_VTENTRY R_PPC64 = 254 |
| 2878 |
) |
| 2879 |
|
| 2880 |
var rppc64Strings = []intName{ |
| 2881 |
{0, "R_PPC64_NONE"}, |
| 2882 |
{1, "R_PPC64_ADDR32"}, |
| 2883 |
{2, "R_PPC64_ADDR24"}, |
| 2884 |
{3, "R_PPC64_ADDR16"}, |
| 2885 |
{4, "R_PPC64_ADDR16_LO"}, |
| 2886 |
{5, "R_PPC64_ADDR16_HI"}, |
| 2887 |
{6, "R_PPC64_ADDR16_HA"}, |
| 2888 |
{7, "R_PPC64_ADDR14"}, |
| 2889 |
{8, "R_PPC64_ADDR14_BRTAKEN"}, |
| 2890 |
{9, "R_PPC64_ADDR14_BRNTAKEN"}, |
| 2891 |
{10, "R_PPC64_REL24"}, |
| 2892 |
{11, "R_PPC64_REL14"}, |
| 2893 |
{12, "R_PPC64_REL14_BRTAKEN"}, |
| 2894 |
{13, "R_PPC64_REL14_BRNTAKEN"}, |
| 2895 |
{14, "R_PPC64_GOT16"}, |
| 2896 |
{15, "R_PPC64_GOT16_LO"}, |
| 2897 |
{16, "R_PPC64_GOT16_HI"}, |
| 2898 |
{17, "R_PPC64_GOT16_HA"}, |
| 2899 |
{19, "R_PPC64_COPY"}, |
| 2900 |
{20, "R_PPC64_GLOB_DAT"}, |
| 2901 |
{21, "R_PPC64_JMP_SLOT"}, |
| 2902 |
{22, "R_PPC64_RELATIVE"}, |
| 2903 |
{24, "R_PPC64_UADDR32"}, |
| 2904 |
{25, "R_PPC64_UADDR16"}, |
| 2905 |
{26, "R_PPC64_REL32"}, |
| 2906 |
{27, "R_PPC64_PLT32"}, |
| 2907 |
{28, "R_PPC64_PLTREL32"}, |
| 2908 |
{29, "R_PPC64_PLT16_LO"}, |
| 2909 |
{30, "R_PPC64_PLT16_HI"}, |
| 2910 |
{31, "R_PPC64_PLT16_HA"}, |
| 2911 |
{33, "R_PPC64_SECTOFF"}, |
| 2912 |
{34, "R_PPC64_SECTOFF_LO"}, |
| 2913 |
{35, "R_PPC64_SECTOFF_HI"}, |
| 2914 |
{36, "R_PPC64_SECTOFF_HA"}, |
| 2915 |
{37, "R_PPC64_REL30"}, |
| 2916 |
{38, "R_PPC64_ADDR64"}, |
| 2917 |
{39, "R_PPC64_ADDR16_HIGHER"}, |
| 2918 |
{40, "R_PPC64_ADDR16_HIGHERA"}, |
| 2919 |
{41, "R_PPC64_ADDR16_HIGHEST"}, |
| 2920 |
{42, "R_PPC64_ADDR16_HIGHESTA"}, |
| 2921 |
{43, "R_PPC64_UADDR64"}, |
| 2922 |
{44, "R_PPC64_REL64"}, |
| 2923 |
{45, "R_PPC64_PLT64"}, |
| 2924 |
{46, "R_PPC64_PLTREL64"}, |
| 2925 |
{47, "R_PPC64_TOC16"}, |
| 2926 |
{48, "R_PPC64_TOC16_LO"}, |
| 2927 |
{49, "R_PPC64_TOC16_HI"}, |
| 2928 |
{50, "R_PPC64_TOC16_HA"}, |
| 2929 |
{51, "R_PPC64_TOC"}, |
| 2930 |
{52, "R_PPC64_PLTGOT16"}, |
| 2931 |
{53, "R_PPC64_PLTGOT16_LO"}, |
| 2932 |
{54, "R_PPC64_PLTGOT16_HI"}, |
| 2933 |
{55, "R_PPC64_PLTGOT16_HA"}, |
| 2934 |
{56, "R_PPC64_ADDR16_DS"}, |
| 2935 |
{57, "R_PPC64_ADDR16_LO_DS"}, |
| 2936 |
{58, "R_PPC64_GOT16_DS"}, |
| 2937 |
{59, "R_PPC64_GOT16_LO_DS"}, |
| 2938 |
{60, "R_PPC64_PLT16_LO_DS"}, |
| 2939 |
{61, "R_PPC64_SECTOFF_DS"}, |
| 2940 |
{62, "R_PPC64_SECTOFF_LO_DS"}, |
| 2941 |
{63, "R_PPC64_TOC16_DS"}, |
| 2942 |
{64, "R_PPC64_TOC16_LO_DS"}, |
| 2943 |
{65, "R_PPC64_PLTGOT16_DS"}, |
| 2944 |
{66, "R_PPC64_PLTGOT_LO_DS"}, |
| 2945 |
{67, "R_PPC64_TLS"}, |
| 2946 |
{68, "R_PPC64_DTPMOD64"}, |
| 2947 |
{69, "R_PPC64_TPREL16"}, |
| 2948 |
{70, "R_PPC64_TPREL16_LO"}, |
| 2949 |
{71, "R_PPC64_TPREL16_HI"}, |
| 2950 |
{72, "R_PPC64_TPREL16_HA"}, |
| 2951 |
{73, "R_PPC64_TPREL64"}, |
| 2952 |
{74, "R_PPC64_DTPREL16"}, |
| 2953 |
{75, "R_PPC64_DTPREL16_LO"}, |
| 2954 |
{76, "R_PPC64_DTPREL16_HI"}, |
| 2955 |
{77, "R_PPC64_DTPREL16_HA"}, |
| 2956 |
{78, "R_PPC64_DTPREL64"}, |
| 2957 |
{79, "R_PPC64_GOT_TLSGD16"}, |
| 2958 |
{80, "R_PPC64_GOT_TLSGD16_LO"}, |
| 2959 |
{81, "R_PPC64_GOT_TLSGD16_HI"}, |
| 2960 |
{82, "R_PPC64_GOT_TLSGD16_HA"}, |
| 2961 |
{83, "R_PPC64_GOT_TLSLD16"}, |
| 2962 |
{84, "R_PPC64_GOT_TLSLD16_LO"}, |
| 2963 |
{85, "R_PPC64_GOT_TLSLD16_HI"}, |
| 2964 |
{86, "R_PPC64_GOT_TLSLD16_HA"}, |
| 2965 |
{87, "R_PPC64_GOT_TPREL16_DS"}, |
| 2966 |
{88, "R_PPC64_GOT_TPREL16_LO_DS"}, |
| 2967 |
{89, "R_PPC64_GOT_TPREL16_HI"}, |
| 2968 |
{90, "R_PPC64_GOT_TPREL16_HA"}, |
| 2969 |
{91, "R_PPC64_GOT_DTPREL16_DS"}, |
| 2970 |
{92, "R_PPC64_GOT_DTPREL16_LO_DS"}, |
| 2971 |
{93, "R_PPC64_GOT_DTPREL16_HI"}, |
| 2972 |
{94, "R_PPC64_GOT_DTPREL16_HA"}, |
| 2973 |
{95, "R_PPC64_TPREL16_DS"}, |
| 2974 |
{96, "R_PPC64_TPREL16_LO_DS"}, |
| 2975 |
{97, "R_PPC64_TPREL16_HIGHER"}, |
| 2976 |
{98, "R_PPC64_TPREL16_HIGHERA"}, |
| 2977 |
{99, "R_PPC64_TPREL16_HIGHEST"}, |
| 2978 |
{100, "R_PPC64_TPREL16_HIGHESTA"}, |
| 2979 |
{101, "R_PPC64_DTPREL16_DS"}, |
| 2980 |
{102, "R_PPC64_DTPREL16_LO_DS"}, |
| 2981 |
{103, "R_PPC64_DTPREL16_HIGHER"}, |
| 2982 |
{104, "R_PPC64_DTPREL16_HIGHERA"}, |
| 2983 |
{105, "R_PPC64_DTPREL16_HIGHEST"}, |
| 2984 |
{106, "R_PPC64_DTPREL16_HIGHESTA"}, |
| 2985 |
{107, "R_PPC64_TLSGD"}, |
| 2986 |
{108, "R_PPC64_TLSLD"}, |
| 2987 |
{109, "R_PPC64_TOCSAVE"}, |
| 2988 |
{110, "R_PPC64_ADDR16_HIGH"}, |
| 2989 |
{111, "R_PPC64_ADDR16_HIGHA"}, |
| 2990 |
{112, "R_PPC64_TPREL16_HIGH"}, |
| 2991 |
{113, "R_PPC64_TPREL16_HIGHA"}, |
| 2992 |
{114, "R_PPC64_DTPREL16_HIGH"}, |
| 2993 |
{115, "R_PPC64_DTPREL16_HIGHA"}, |
| 2994 |
{116, "R_PPC64_REL24_NOTOC"}, |
| 2995 |
{117, "R_PPC64_ADDR64_LOCAL"}, |
| 2996 |
{118, "R_PPC64_ENTRY"}, |
| 2997 |
{119, "R_PPC64_PLTSEQ"}, |
| 2998 |
{120, "R_PPC64_PLTCALL"}, |
| 2999 |
{121, "R_PPC64_PLTSEQ_NOTOC"}, |
| 3000 |
{122, "R_PPC64_PLTCALL_NOTOC"}, |
| 3001 |
{123, "R_PPC64_PCREL_OPT"}, |
| 3002 |
{124, "R_PPC64_REL24_P9NOTOC"}, |
| 3003 |
{128, "R_PPC64_D34"}, |
| 3004 |
{129, "R_PPC64_D34_LO"}, |
| 3005 |
{130, "R_PPC64_D34_HI30"}, |
| 3006 |
{131, "R_PPC64_D34_HA30"}, |
| 3007 |
{132, "R_PPC64_PCREL34"}, |
| 3008 |
{133, "R_PPC64_GOT_PCREL34"}, |
| 3009 |
{134, "R_PPC64_PLT_PCREL34"}, |
| 3010 |
{135, "R_PPC64_PLT_PCREL34_NOTOC"}, |
| 3011 |
{136, "R_PPC64_ADDR16_HIGHER34"}, |
| 3012 |
{137, "R_PPC64_ADDR16_HIGHERA34"}, |
| 3013 |
{138, "R_PPC64_ADDR16_HIGHEST34"}, |
| 3014 |
{139, "R_PPC64_ADDR16_HIGHESTA34"}, |
| 3015 |
{140, "R_PPC64_REL16_HIGHER34"}, |
| 3016 |
{141, "R_PPC64_REL16_HIGHERA34"}, |
| 3017 |
{142, "R_PPC64_REL16_HIGHEST34"}, |
| 3018 |
{143, "R_PPC64_REL16_HIGHESTA34"}, |
| 3019 |
{144, "R_PPC64_D28"}, |
| 3020 |
{145, "R_PPC64_PCREL28"}, |
| 3021 |
{146, "R_PPC64_TPREL34"}, |
| 3022 |
{147, "R_PPC64_DTPREL34"}, |
| 3023 |
{148, "R_PPC64_GOT_TLSGD_PCREL34"}, |
| 3024 |
{149, "R_PPC64_GOT_TLSLD_PCREL34"}, |
| 3025 |
{150, "R_PPC64_GOT_TPREL_PCREL34"}, |
| 3026 |
{151, "R_PPC64_GOT_DTPREL_PCREL34"}, |
| 3027 |
{240, "R_PPC64_REL16_HIGH"}, |
| 3028 |
{241, "R_PPC64_REL16_HIGHA"}, |
| 3029 |
{242, "R_PPC64_REL16_HIGHER"}, |
| 3030 |
{243, "R_PPC64_REL16_HIGHERA"}, |
| 3031 |
{244, "R_PPC64_REL16_HIGHEST"}, |
| 3032 |
{245, "R_PPC64_REL16_HIGHESTA"}, |
| 3033 |
{246, "R_PPC64_REL16DX_HA"}, |
| 3034 |
{247, "R_PPC64_JMP_IREL"}, |
| 3035 |
{248, "R_PPC64_IRELATIVE"}, |
| 3036 |
{249, "R_PPC64_REL16"}, |
| 3037 |
{250, "R_PPC64_REL16_LO"}, |
| 3038 |
{251, "R_PPC64_REL16_HI"}, |
| 3039 |
{252, "R_PPC64_REL16_HA"}, |
| 3040 |
{253, "R_PPC64_GNU_VTINHERIT"}, |
| 3041 |
{254, "R_PPC64_GNU_VTENTRY"}, |
| 3042 |
} |
| 3043 |
|
| 3044 |
func (i R_PPC64) String() string { return stringName(uint32(i), rppc64Strings, false) } |
| 3045 |
func (i R_PPC64) GoString() string { return stringName(uint32(i), rppc64Strings, true) } |
| 3046 |
|
| 3047 |
// Relocation types for RISC-V processors. |
| 3048 |
type R_RISCV int |
| 3049 |
|
| 3050 |
const ( |
| 3051 |
R_RISCV_NONE R_RISCV = 0 /* No relocation. */ |
| 3052 |
R_RISCV_32 R_RISCV = 1 /* Add 32 bit zero extended symbol value */ |
| 3053 |
R_RISCV_64 R_RISCV = 2 /* Add 64 bit symbol value. */ |
| 3054 |
R_RISCV_RELATIVE R_RISCV = 3 /* Add load address of shared object. */ |
| 3055 |
R_RISCV_COPY R_RISCV = 4 /* Copy data from shared object. */ |
| 3056 |
R_RISCV_JUMP_SLOT R_RISCV = 5 /* Set GOT entry to code address. */ |
| 3057 |
R_RISCV_TLS_DTPMOD32 R_RISCV = 6 /* 32 bit ID of module containing symbol */ |
| 3058 |
R_RISCV_TLS_DTPMOD64 R_RISCV = 7 /* ID of module containing symbol */ |
| 3059 |
R_RISCV_TLS_DTPREL32 R_RISCV = 8 /* 32 bit relative offset in TLS block */ |
| 3060 |
R_RISCV_TLS_DTPREL64 R_RISCV = 9 /* Relative offset in TLS block */ |
| 3061 |
R_RISCV_TLS_TPREL32 R_RISCV = 10 /* 32 bit relative offset in static TLS block */ |
| 3062 |
R_RISCV_TLS_TPREL64 R_RISCV = 11 /* Relative offset in static TLS block */ |
| 3063 |
R_RISCV_BRANCH R_RISCV = 16 /* PC-relative branch */ |
| 3064 |
R_RISCV_JAL R_RISCV = 17 /* PC-relative jump */ |
| 3065 |
R_RISCV_CALL R_RISCV = 18 /* PC-relative call */ |
| 3066 |
R_RISCV_CALL_PLT R_RISCV = 19 /* PC-relative call (PLT) */ |
| 3067 |
R_RISCV_GOT_HI20 R_RISCV = 20 /* PC-relative GOT reference */ |
| 3068 |
R_RISCV_TLS_GOT_HI20 R_RISCV = 21 /* PC-relative TLS IE GOT offset */ |
| 3069 |
R_RISCV_TLS_GD_HI20 R_RISCV = 22 /* PC-relative TLS GD reference */ |
| 3070 |
R_RISCV_PCREL_HI20 R_RISCV = 23 /* PC-relative reference */ |
| 3071 |
R_RISCV_PCREL_LO12_I R_RISCV = 24 /* PC-relative reference */ |
| 3072 |
R_RISCV_PCREL_LO12_S R_RISCV = 25 /* PC-relative reference */ |
| 3073 |
R_RISCV_HI20 R_RISCV = 26 /* Absolute address */ |
| 3074 |
R_RISCV_LO12_I R_RISCV = 27 /* Absolute address */ |
| 3075 |
R_RISCV_LO12_S R_RISCV = 28 /* Absolute address */ |
| 3076 |
R_RISCV_TPREL_HI20 R_RISCV = 29 /* TLS LE thread offset */ |
| 3077 |
R_RISCV_TPREL_LO12_I R_RISCV = 30 /* TLS LE thread offset */ |
| 3078 |
R_RISCV_TPREL_LO12_S R_RISCV = 31 /* TLS LE thread offset */ |
| 3079 |
R_RISCV_TPREL_ADD R_RISCV = 32 /* TLS LE thread usage */ |
| 3080 |
R_RISCV_ADD8 R_RISCV = 33 /* 8-bit label addition */ |
| 3081 |
R_RISCV_ADD16 R_RISCV = 34 /* 16-bit label addition */ |
| 3082 |
R_RISCV_ADD32 R_RISCV = 35 /* 32-bit label addition */ |
| 3083 |
R_RISCV_ADD64 R_RISCV = 36 /* 64-bit label addition */ |
| 3084 |
R_RISCV_SUB8 R_RISCV = 37 /* 8-bit label subtraction */ |
| 3085 |
R_RISCV_SUB16 R_RISCV = 38 /* 16-bit label subtraction */ |
| 3086 |
R_RISCV_SUB32 R_RISCV = 39 /* 32-bit label subtraction */ |
| 3087 |
R_RISCV_SUB64 R_RISCV = 40 /* 64-bit label subtraction */ |
| 3088 |
R_RISCV_GNU_VTINHERIT R_RISCV = 41 /* GNU C++ vtable hierarchy */ |
| 3089 |
R_RISCV_GNU_VTENTRY R_RISCV = 42 /* GNU C++ vtable member usage */ |
| 3090 |
R_RISCV_ALIGN R_RISCV = 43 /* Alignment statement */ |
| 3091 |
R_RISCV_RVC_BRANCH R_RISCV = 44 /* PC-relative branch offset */ |
| 3092 |
R_RISCV_RVC_JUMP R_RISCV = 45 /* PC-relative jump offset */ |
| 3093 |
R_RISCV_RVC_LUI R_RISCV = 46 /* Absolute address */ |
| 3094 |
R_RISCV_GPREL_I R_RISCV = 47 /* GP-relative reference */ |
| 3095 |
R_RISCV_GPREL_S R_RISCV = 48 /* GP-relative reference */ |
| 3096 |
R_RISCV_TPREL_I R_RISCV = 49 /* TP-relative TLS LE load */ |
| 3097 |
R_RISCV_TPREL_S R_RISCV = 50 /* TP-relative TLS LE store */ |
| 3098 |
R_RISCV_RELAX R_RISCV = 51 /* Instruction pair can be relaxed */ |
| 3099 |
R_RISCV_SUB6 R_RISCV = 52 /* Local label subtraction */ |
| 3100 |
R_RISCV_SET6 R_RISCV = 53 /* Local label subtraction */ |
| 3101 |
R_RISCV_SET8 R_RISCV = 54 /* Local label subtraction */ |
| 3102 |
R_RISCV_SET16 R_RISCV = 55 /* Local label subtraction */ |
| 3103 |
R_RISCV_SET32 R_RISCV = 56 /* Local label subtraction */ |
| 3104 |
R_RISCV_32_PCREL R_RISCV = 57 /* 32-bit PC relative */ |
| 3105 |
) |
| 3106 |
|
| 3107 |
var rriscvStrings = []intName{ |
| 3108 |
{0, "R_RISCV_NONE"}, |
| 3109 |
{1, "R_RISCV_32"}, |
| 3110 |
{2, "R_RISCV_64"}, |
| 3111 |
{3, "R_RISCV_RELATIVE"}, |
| 3112 |
{4, "R_RISCV_COPY"}, |
| 3113 |
{5, "R_RISCV_JUMP_SLOT"}, |
| 3114 |
{6, "R_RISCV_TLS_DTPMOD32"}, |
| 3115 |
{7, "R_RISCV_TLS_DTPMOD64"}, |
| 3116 |
{8, "R_RISCV_TLS_DTPREL32"}, |
| 3117 |
{9, "R_RISCV_TLS_DTPREL64"}, |
| 3118 |
{10, "R_RISCV_TLS_TPREL32"}, |
| 3119 |
{11, "R_RISCV_TLS_TPREL64"}, |
| 3120 |
{16, "R_RISCV_BRANCH"}, |
| 3121 |
{17, "R_RISCV_JAL"}, |
| 3122 |
{18, "R_RISCV_CALL"}, |
| 3123 |
{19, "R_RISCV_CALL_PLT"}, |
| 3124 |
{20, "R_RISCV_GOT_HI20"}, |
| 3125 |
{21, "R_RISCV_TLS_GOT_HI20"}, |
| 3126 |
{22, "R_RISCV_TLS_GD_HI20"}, |
| 3127 |
{23, "R_RISCV_PCREL_HI20"}, |
| 3128 |
{24, "R_RISCV_PCREL_LO12_I"}, |
| 3129 |
{25, "R_RISCV_PCREL_LO12_S"}, |
| 3130 |
{26, "R_RISCV_HI20"}, |
| 3131 |
{27, "R_RISCV_LO12_I"}, |
| 3132 |
{28, "R_RISCV_LO12_S"}, |
| 3133 |
{29, "R_RISCV_TPREL_HI20"}, |
| 3134 |
{30, "R_RISCV_TPREL_LO12_I"}, |
| 3135 |
{31, "R_RISCV_TPREL_LO12_S"}, |
| 3136 |
{32, "R_RISCV_TPREL_ADD"}, |
| 3137 |
{33, "R_RISCV_ADD8"}, |
| 3138 |
{34, "R_RISCV_ADD16"}, |
| 3139 |
{35, "R_RISCV_ADD32"}, |
| 3140 |
{36, "R_RISCV_ADD64"}, |
| 3141 |
{37, "R_RISCV_SUB8"}, |
| 3142 |
{38, "R_RISCV_SUB16"}, |
| 3143 |
{39, "R_RISCV_SUB32"}, |
| 3144 |
{40, "R_RISCV_SUB64"}, |
| 3145 |
{41, "R_RISCV_GNU_VTINHERIT"}, |
| 3146 |
{42, "R_RISCV_GNU_VTENTRY"}, |
| 3147 |
{43, "R_RISCV_ALIGN"}, |
| 3148 |
{44, "R_RISCV_RVC_BRANCH"}, |
| 3149 |
{45, "R_RISCV_RVC_JUMP"}, |
| 3150 |
{46, "R_RISCV_RVC_LUI"}, |
| 3151 |
{47, "R_RISCV_GPREL_I"}, |
| 3152 |
{48, "R_RISCV_GPREL_S"}, |
| 3153 |
{49, "R_RISCV_TPREL_I"}, |
| 3154 |
{50, "R_RISCV_TPREL_S"}, |
| 3155 |
{51, "R_RISCV_RELAX"}, |
| 3156 |
{52, "R_RISCV_SUB6"}, |
| 3157 |
{53, "R_RISCV_SET6"}, |
| 3158 |
{54, "R_RISCV_SET8"}, |
| 3159 |
{55, "R_RISCV_SET16"}, |
| 3160 |
{56, "R_RISCV_SET32"}, |
| 3161 |
{57, "R_RISCV_32_PCREL"}, |
| 3162 |
} |
| 3163 |
|
| 3164 |
func (i R_RISCV) String() string { return stringName(uint32(i), rriscvStrings, false) } |
| 3165 |
func (i R_RISCV) GoString() string { return stringName(uint32(i), rriscvStrings, true) } |
| 3166 |
|
| 3167 |
// Relocation types for s390x processors. |
| 3168 |
type R_390 int |
| 3169 |
|
| 3170 |
const ( |
| 3171 |
R_390_NONE R_390 = 0 |
| 3172 |
R_390_8 R_390 = 1 |
| 3173 |
R_390_12 R_390 = 2 |
| 3174 |
R_390_16 R_390 = 3 |
| 3175 |
R_390_32 R_390 = 4 |
| 3176 |
R_390_PC32 R_390 = 5 |
| 3177 |
R_390_GOT12 R_390 = 6 |
| 3178 |
R_390_GOT32 R_390 = 7 |
| 3179 |
R_390_PLT32 R_390 = 8 |
| 3180 |
R_390_COPY R_390 = 9 |
| 3181 |
R_390_GLOB_DAT R_390 = 10 |
| 3182 |
R_390_JMP_SLOT R_390 = 11 |
| 3183 |
R_390_RELATIVE R_390 = 12 |
| 3184 |
R_390_GOTOFF R_390 = 13 |
| 3185 |
R_390_GOTPC R_390 = 14 |
| 3186 |
R_390_GOT16 R_390 = 15 |
| 3187 |
R_390_PC16 R_390 = 16 |
| 3188 |
R_390_PC16DBL R_390 = 17 |
| 3189 |
R_390_PLT16DBL R_390 = 18 |
| 3190 |
R_390_PC32DBL R_390 = 19 |
| 3191 |
R_390_PLT32DBL R_390 = 20 |
| 3192 |
R_390_GOTPCDBL R_390 = 21 |
| 3193 |
R_390_64 R_390 = 22 |
| 3194 |
R_390_PC64 R_390 = 23 |
| 3195 |
R_390_GOT64 R_390 = 24 |
| 3196 |
R_390_PLT64 R_390 = 25 |
| 3197 |
R_390_GOTENT R_390 = 26 |
| 3198 |
R_390_GOTOFF16 R_390 = 27 |
| 3199 |
R_390_GOTOFF64 R_390 = 28 |
| 3200 |
R_390_GOTPLT12 R_390 = 29 |
| 3201 |
R_390_GOTPLT16 R_390 = 30 |
| 3202 |
R_390_GOTPLT32 R_390 = 31 |
| 3203 |
R_390_GOTPLT64 R_390 = 32 |
| 3204 |
R_390_GOTPLTENT R_390 = 33 |
| 3205 |
R_390_GOTPLTOFF16 R_390 = 34 |
| 3206 |
R_390_GOTPLTOFF32 R_390 = 35 |
| 3207 |
R_390_GOTPLTOFF64 R_390 = 36 |
| 3208 |
R_390_TLS_LOAD R_390 = 37 |
| 3209 |
R_390_TLS_GDCALL R_390 = 38 |
| 3210 |
R_390_TLS_LDCALL R_390 = 39 |
| 3211 |
R_390_TLS_GD32 R_390 = 40 |
| 3212 |
R_390_TLS_GD64 R_390 = 41 |
| 3213 |
R_390_TLS_GOTIE12 R_390 = 42 |
| 3214 |
R_390_TLS_GOTIE32 R_390 = 43 |
| 3215 |
R_390_TLS_GOTIE64 R_390 = 44 |
| 3216 |
R_390_TLS_LDM32 R_390 = 45 |
| 3217 |
R_390_TLS_LDM64 R_390 = 46 |
| 3218 |
R_390_TLS_IE32 R_390 = 47 |
| 3219 |
R_390_TLS_IE64 R_390 = 48 |
| 3220 |
R_390_TLS_IEENT R_390 = 49 |
| 3221 |
R_390_TLS_LE32 R_390 = 50 |
| 3222 |
R_390_TLS_LE64 R_390 = 51 |
| 3223 |
R_390_TLS_LDO32 R_390 = 52 |
| 3224 |
R_390_TLS_LDO64 R_390 = 53 |
| 3225 |
R_390_TLS_DTPMOD R_390 = 54 |
| 3226 |
R_390_TLS_DTPOFF R_390 = 55 |
| 3227 |
R_390_TLS_TPOFF R_390 = 56 |
| 3228 |
R_390_20 R_390 = 57 |
| 3229 |
R_390_GOT20 R_390 = 58 |
| 3230 |
R_390_GOTPLT20 R_390 = 59 |
| 3231 |
R_390_TLS_GOTIE20 R_390 = 60 |
| 3232 |
) |
| 3233 |
|
| 3234 |
var r390Strings = []intName{ |
| 3235 |
{0, "R_390_NONE"}, |
| 3236 |
{1, "R_390_8"}, |
| 3237 |
{2, "R_390_12"}, |
| 3238 |
{3, "R_390_16"}, |
| 3239 |
{4, "R_390_32"}, |
| 3240 |
{5, "R_390_PC32"}, |
| 3241 |
{6, "R_390_GOT12"}, |
| 3242 |
{7, "R_390_GOT32"}, |
| 3243 |
{8, "R_390_PLT32"}, |
| 3244 |
{9, "R_390_COPY"}, |
| 3245 |
{10, "R_390_GLOB_DAT"}, |
| 3246 |
{11, "R_390_JMP_SLOT"}, |
| 3247 |
{12, "R_390_RELATIVE"}, |
| 3248 |
{13, "R_390_GOTOFF"}, |
| 3249 |
{14, "R_390_GOTPC"}, |
| 3250 |
{15, "R_390_GOT16"}, |
| 3251 |
{16, "R_390_PC16"}, |
| 3252 |
{17, "R_390_PC16DBL"}, |
| 3253 |
{18, "R_390_PLT16DBL"}, |
| 3254 |
{19, "R_390_PC32DBL"}, |
| 3255 |
{20, "R_390_PLT32DBL"}, |
| 3256 |
{21, "R_390_GOTPCDBL"}, |
| 3257 |
{22, "R_390_64"}, |
| 3258 |
{23, "R_390_PC64"}, |
| 3259 |
{24, "R_390_GOT64"}, |
| 3260 |
{25, "R_390_PLT64"}, |
| 3261 |
{26, "R_390_GOTENT"}, |
| 3262 |
{27, "R_390_GOTOFF16"}, |
| 3263 |
{28, "R_390_GOTOFF64"}, |
| 3264 |
{29, "R_390_GOTPLT12"}, |
| 3265 |
{30, "R_390_GOTPLT16"}, |
| 3266 |
{31, "R_390_GOTPLT32"}, |
| 3267 |
{32, "R_390_GOTPLT64"}, |
| 3268 |
{33, "R_390_GOTPLTENT"}, |
| 3269 |
{34, "R_390_GOTPLTOFF16"}, |
| 3270 |
{35, "R_390_GOTPLTOFF32"}, |
| 3271 |
{36, "R_390_GOTPLTOFF64"}, |
| 3272 |
{37, "R_390_TLS_LOAD"}, |
| 3273 |
{38, "R_390_TLS_GDCALL"}, |
| 3274 |
{39, "R_390_TLS_LDCALL"}, |
| 3275 |
{40, "R_390_TLS_GD32"}, |
| 3276 |
{41, "R_390_TLS_GD64"}, |
| 3277 |
{42, "R_390_TLS_GOTIE12"}, |
| 3278 |
{43, "R_390_TLS_GOTIE32"}, |
| 3279 |
{44, "R_390_TLS_GOTIE64"}, |
| 3280 |
{45, "R_390_TLS_LDM32"}, |
| 3281 |
{46, "R_390_TLS_LDM64"}, |
| 3282 |
{47, "R_390_TLS_IE32"}, |
| 3283 |
{48, "R_390_TLS_IE64"}, |
| 3284 |
{49, "R_390_TLS_IEENT"}, |
| 3285 |
{50, "R_390_TLS_LE32"}, |
| 3286 |
{51, "R_390_TLS_LE64"}, |
| 3287 |
{52, "R_390_TLS_LDO32"}, |
| 3288 |
{53, "R_390_TLS_LDO64"}, |
| 3289 |
{54, "R_390_TLS_DTPMOD"}, |
| 3290 |
{55, "R_390_TLS_DTPOFF"}, |
| 3291 |
{56, "R_390_TLS_TPOFF"}, |
| 3292 |
{57, "R_390_20"}, |
| 3293 |
{58, "R_390_GOT20"}, |
| 3294 |
{59, "R_390_GOTPLT20"}, |
| 3295 |
{60, "R_390_TLS_GOTIE20"}, |
| 3296 |
} |
| 3297 |
|
| 3298 |
func (i R_390) String() string { return stringName(uint32(i), r390Strings, false) } |
| 3299 |
func (i R_390) GoString() string { return stringName(uint32(i), r390Strings, true) } |
| 3300 |
|
| 3301 |
// Relocation types for SPARC. |
| 3302 |
type R_SPARC int |
| 3303 |
|
| 3304 |
const ( |
| 3305 |
R_SPARC_NONE R_SPARC = 0 |
| 3306 |
R_SPARC_8 R_SPARC = 1 |
| 3307 |
R_SPARC_16 R_SPARC = 2 |
| 3308 |
R_SPARC_32 R_SPARC = 3 |
| 3309 |
R_SPARC_DISP8 R_SPARC = 4 |
| 3310 |
R_SPARC_DISP16 R_SPARC = 5 |
| 3311 |
R_SPARC_DISP32 R_SPARC = 6 |
| 3312 |
R_SPARC_WDISP30 R_SPARC = 7 |
| 3313 |
R_SPARC_WDISP22 R_SPARC = 8 |
| 3314 |
R_SPARC_HI22 R_SPARC = 9 |
| 3315 |
R_SPARC_22 R_SPARC = 10 |
| 3316 |
R_SPARC_13 R_SPARC = 11 |
| 3317 |
R_SPARC_LO10 R_SPARC = 12 |
| 3318 |
R_SPARC_GOT10 R_SPARC = 13 |
| 3319 |
R_SPARC_GOT13 R_SPARC = 14 |
| 3320 |
R_SPARC_GOT22 R_SPARC = 15 |
| 3321 |
R_SPARC_PC10 R_SPARC = 16 |
| 3322 |
R_SPARC_PC22 R_SPARC = 17 |
| 3323 |
R_SPARC_WPLT30 R_SPARC = 18 |
| 3324 |
R_SPARC_COPY R_SPARC = 19 |
| 3325 |
R_SPARC_GLOB_DAT R_SPARC = 20 |
| 3326 |
R_SPARC_JMP_SLOT R_SPARC = 21 |
| 3327 |
R_SPARC_RELATIVE R_SPARC = 22 |
| 3328 |
R_SPARC_UA32 R_SPARC = 23 |
| 3329 |
R_SPARC_PLT32 R_SPARC = 24 |
| 3330 |
R_SPARC_HIPLT22 R_SPARC = 25 |
| 3331 |
R_SPARC_LOPLT10 R_SPARC = 26 |
| 3332 |
R_SPARC_PCPLT32 R_SPARC = 27 |
| 3333 |
R_SPARC_PCPLT22 R_SPARC = 28 |
| 3334 |
R_SPARC_PCPLT10 R_SPARC = 29 |
| 3335 |
R_SPARC_10 R_SPARC = 30 |
| 3336 |
R_SPARC_11 R_SPARC = 31 |
| 3337 |
R_SPARC_64 R_SPARC = 32 |
| 3338 |
R_SPARC_OLO10 R_SPARC = 33 |
| 3339 |
R_SPARC_HH22 R_SPARC = 34 |
| 3340 |
R_SPARC_HM10 R_SPARC = 35 |
| 3341 |
R_SPARC_LM22 R_SPARC = 36 |
| 3342 |
R_SPARC_PC_HH22 R_SPARC = 37 |
| 3343 |
R_SPARC_PC_HM10 R_SPARC = 38 |
| 3344 |
R_SPARC_PC_LM22 R_SPARC = 39 |
| 3345 |
R_SPARC_WDISP16 R_SPARC = 40 |
| 3346 |
R_SPARC_WDISP19 R_SPARC = 41 |
| 3347 |
R_SPARC_GLOB_JMP R_SPARC = 42 |
| 3348 |
R_SPARC_7 R_SPARC = 43 |
| 3349 |
R_SPARC_5 R_SPARC = 44 |
| 3350 |
R_SPARC_6 R_SPARC = 45 |
| 3351 |
R_SPARC_DISP64 R_SPARC = 46 |
| 3352 |
R_SPARC_PLT64 R_SPARC = 47 |
| 3353 |
R_SPARC_HIX22 R_SPARC = 48 |
| 3354 |
R_SPARC_LOX10 R_SPARC = 49 |
| 3355 |
R_SPARC_H44 R_SPARC = 50 |
| 3356 |
R_SPARC_M44 R_SPARC = 51 |
| 3357 |
R_SPARC_L44 R_SPARC = 52 |
| 3358 |
R_SPARC_REGISTER R_SPARC = 53 |
| 3359 |
R_SPARC_UA64 R_SPARC = 54 |
| 3360 |
R_SPARC_UA16 R_SPARC = 55 |
| 3361 |
) |
| 3362 |
|
| 3363 |
var rsparcStrings = []intName{ |
| 3364 |
{0, "R_SPARC_NONE"}, |
| 3365 |
{1, "R_SPARC_8"}, |
| 3366 |
{2, "R_SPARC_16"}, |
| 3367 |
{3, "R_SPARC_32"}, |
| 3368 |
{4, "R_SPARC_DISP8"}, |
| 3369 |
{5, "R_SPARC_DISP16"}, |
| 3370 |
{6, "R_SPARC_DISP32"}, |
| 3371 |
{7, "R_SPARC_WDISP30"}, |
| 3372 |
{8, "R_SPARC_WDISP22"}, |
| 3373 |
{9, "R_SPARC_HI22"}, |
| 3374 |
{10, "R_SPARC_22"}, |
| 3375 |
{11, "R_SPARC_13"}, |
| 3376 |
{12, "R_SPARC_LO10"}, |
| 3377 |
{13, "R_SPARC_GOT10"}, |
| 3378 |
{14, "R_SPARC_GOT13"}, |
| 3379 |
{15, "R_SPARC_GOT22"}, |
| 3380 |
{16, "R_SPARC_PC10"}, |
| 3381 |
{17, "R_SPARC_PC22"}, |
| 3382 |
{18, "R_SPARC_WPLT30"}, |
| 3383 |
{19, "R_SPARC_COPY"}, |
| 3384 |
{20, "R_SPARC_GLOB_DAT"}, |
| 3385 |
{21, "R_SPARC_JMP_SLOT"}, |
| 3386 |
{22, "R_SPARC_RELATIVE"}, |
| 3387 |
{23, "R_SPARC_UA32"}, |
| 3388 |
{24, "R_SPARC_PLT32"}, |
| 3389 |
{25, "R_SPARC_HIPLT22"}, |
| 3390 |
{26, "R_SPARC_LOPLT10"}, |
| 3391 |
{27, "R_SPARC_PCPLT32"}, |
| 3392 |
{28, "R_SPARC_PCPLT22"}, |
| 3393 |
{29, "R_SPARC_PCPLT10"}, |
| 3394 |
{30, "R_SPARC_10"}, |
| 3395 |
{31, "R_SPARC_11"}, |
| 3396 |
{32, "R_SPARC_64"}, |
| 3397 |
{33, "R_SPARC_OLO10"}, |
| 3398 |
{34, "R_SPARC_HH22"}, |
| 3399 |
{35, "R_SPARC_HM10"}, |
| 3400 |
{36, "R_SPARC_LM22"}, |
| 3401 |
{37, "R_SPARC_PC_HH22"}, |
| 3402 |
{38, "R_SPARC_PC_HM10"}, |
| 3403 |
{39, "R_SPARC_PC_LM22"}, |
| 3404 |
{40, "R_SPARC_WDISP16"}, |
| 3405 |
{41, "R_SPARC_WDISP19"}, |
| 3406 |
{42, "R_SPARC_GLOB_JMP"}, |
| 3407 |
{43, "R_SPARC_7"}, |
| 3408 |
{44, "R_SPARC_5"}, |
| 3409 |
{45, "R_SPARC_6"}, |
| 3410 |
{46, "R_SPARC_DISP64"}, |
| 3411 |
{47, "R_SPARC_PLT64"}, |
| 3412 |
{48, "R_SPARC_HIX22"}, |
| 3413 |
{49, "R_SPARC_LOX10"}, |
| 3414 |
{50, "R_SPARC_H44"}, |
| 3415 |
{51, "R_SPARC_M44"}, |
| 3416 |
{52, "R_SPARC_L44"}, |
| 3417 |
{53, "R_SPARC_REGISTER"}, |
| 3418 |
{54, "R_SPARC_UA64"}, |
| 3419 |
{55, "R_SPARC_UA16"}, |
| 3420 |
} |
| 3421 |
|
| 3422 |
func (i R_SPARC) String() string { return stringName(uint32(i), rsparcStrings, false) } |
| 3423 |
func (i R_SPARC) GoString() string { return stringName(uint32(i), rsparcStrings, true) } |
| 3424 |
|
| 3425 |
// Magic number for the elf trampoline, chosen wisely to be an immediate value. |
| 3426 |
const ARM_MAGIC_TRAMP_NUMBER = 0x5c000003 |
| 3427 |
|
| 3428 |
// ELF32 File header. |
| 3429 |
type Header32 struct { |
| 3430 |
Ident [EI_NIDENT]byte /* File identification. */ |
| 3431 |
Type uint16 /* File type. */ |
| 3432 |
Machine uint16 /* Machine architecture. */ |
| 3433 |
Version uint32 /* ELF format version. */ |
| 3434 |
Entry uint32 /* Entry point. */ |
| 3435 |
Phoff uint32 /* Program header file offset. */ |
| 3436 |
Shoff uint32 /* Section header file offset. */ |
| 3437 |
Flags uint32 /* Architecture-specific flags. */ |
| 3438 |
Ehsize uint16 /* Size of ELF header in bytes. */ |
| 3439 |
Phentsize uint16 /* Size of program header entry. */ |
| 3440 |
Phnum uint16 /* Number of program header entries. */ |
| 3441 |
Shentsize uint16 /* Size of section header entry. */ |
| 3442 |
Shnum uint16 /* Number of section header entries. */ |
| 3443 |
Shstrndx uint16 /* Section name strings section. */ |
| 3444 |
} |
| 3445 |
|
| 3446 |
// ELF32 Section header. |
| 3447 |
type Section32 struct { |
| 3448 |
Name uint32 /* Section name (index into the section header string table). */ |
| 3449 |
Type uint32 /* Section type. */ |
| 3450 |
Flags uint32 /* Section flags. */ |
| 3451 |
Addr uint32 /* Address in memory image. */ |
| 3452 |
Off uint32 /* Offset in file. */ |
| 3453 |
Size uint32 /* Size in bytes. */ |
| 3454 |
Link uint32 /* Index of a related section. */ |
| 3455 |
Info uint32 /* Depends on section type. */ |
| 3456 |
Addralign uint32 /* Alignment in bytes. */ |
| 3457 |
Entsize uint32 /* Size of each entry in section. */ |
| 3458 |
} |
| 3459 |
|
| 3460 |
// ELF32 Program header. |
| 3461 |
type Prog32 struct { |
| 3462 |
Type uint32 /* Entry type. */ |
| 3463 |
Off uint32 /* File offset of contents. */ |
| 3464 |
Vaddr uint32 /* Virtual address in memory image. */ |
| 3465 |
Paddr uint32 /* Physical address (not used). */ |
| 3466 |
Filesz uint32 /* Size of contents in file. */ |
| 3467 |
Memsz uint32 /* Size of contents in memory. */ |
| 3468 |
Flags uint32 /* Access permission flags. */ |
| 3469 |
Align uint32 /* Alignment in memory and file. */ |
| 3470 |
} |
| 3471 |
|
| 3472 |
// ELF32 Dynamic structure. The ".dynamic" section contains an array of them. |
| 3473 |
type Dyn32 struct { |
| 3474 |
Tag int32 /* Entry type. */ |
| 3475 |
Val uint32 /* Integer/Address value. */ |
| 3476 |
} |
| 3477 |
|
| 3478 |
// ELF32 Compression header. |
| 3479 |
type Chdr32 struct { |
| 3480 |
Type uint32 |
| 3481 |
Size uint32 |
| 3482 |
Addralign uint32 |
| 3483 |
} |
| 3484 |
|
| 3485 |
/* |
| 3486 |
* Relocation entries. |
| 3487 |
*/ |
| 3488 |
|
| 3489 |
// ELF32 Relocations that don't need an addend field. |
| 3490 |
type Rel32 struct { |
| 3491 |
Off uint32 /* Location to be relocated. */ |
| 3492 |
Info uint32 /* Relocation type and symbol index. */ |
| 3493 |
} |
| 3494 |
|
| 3495 |
// ELF32 Relocations that need an addend field. |
| 3496 |
type Rela32 struct { |
| 3497 |
Off uint32 /* Location to be relocated. */ |
| 3498 |
Info uint32 /* Relocation type and symbol index. */ |
| 3499 |
Addend int32 /* Addend. */ |
| 3500 |
} |
| 3501 |
|
| 3502 |
func R_SYM32(info uint32) uint32 { return info >> 8 } |
| 3503 |
func R_TYPE32(info uint32) uint32 { return info & 0xff } |
| 3504 |
func R_INFO32(sym, typ uint32) uint32 { return sym<<8 | typ } |
| 3505 |
|
| 3506 |
// ELF32 Symbol. |
| 3507 |
type Sym32 struct { |
| 3508 |
Name uint32 |
| 3509 |
Value uint32 |
| 3510 |
Size uint32 |
| 3511 |
Info uint8 |
| 3512 |
Other uint8 |
| 3513 |
Shndx uint16 |
| 3514 |
} |
| 3515 |
|
| 3516 |
const Sym32Size = 16 |
| 3517 |
|
| 3518 |
func ST_BIND(info uint8) SymBind { return SymBind(info >> 4) } |
| 3519 |
func ST_TYPE(info uint8) SymType { return SymType(info & 0xF) } |
| 3520 |
func ST_INFO(bind SymBind, typ SymType) uint8 { |
| 3521 |
return uint8(bind)<<4 | uint8(typ)&0xf |
| 3522 |
} |
| 3523 |
func ST_VISIBILITY(other uint8) SymVis { return SymVis(other & 3) } |
| 3524 |
|
| 3525 |
/* |
| 3526 |
* ELF64 |
| 3527 |
*/ |
| 3528 |
|
| 3529 |
// ELF64 file header. |
| 3530 |
type Header64 struct { |
| 3531 |
Ident [EI_NIDENT]byte /* File identification. */ |
| 3532 |
Type uint16 /* File type. */ |
| 3533 |
Machine uint16 /* Machine architecture. */ |
| 3534 |
Version uint32 /* ELF format version. */ |
| 3535 |
Entry uint64 /* Entry point. */ |
| 3536 |
Phoff uint64 /* Program header file offset. */ |
| 3537 |
Shoff uint64 /* Section header file offset. */ |
| 3538 |
Flags uint32 /* Architecture-specific flags. */ |
| 3539 |
Ehsize uint16 /* Size of ELF header in bytes. */ |
| 3540 |
Phentsize uint16 /* Size of program header entry. */ |
| 3541 |
Phnum uint16 /* Number of program header entries. */ |
| 3542 |
Shentsize uint16 /* Size of section header entry. */ |
| 3543 |
Shnum uint16 /* Number of section header entries. */ |
| 3544 |
Shstrndx uint16 /* Section name strings section. */ |
| 3545 |
} |
| 3546 |
|
| 3547 |
// ELF64 Section header. |
| 3548 |
type Section64 struct { |
| 3549 |
Name uint32 /* Section name (index into the section header string table). */ |
| 3550 |
Type uint32 /* Section type. */ |
| 3551 |
Flags uint64 /* Section flags. */ |
| 3552 |
Addr uint64 /* Address in memory image. */ |
| 3553 |
Off uint64 /* Offset in file. */ |
| 3554 |
Size uint64 /* Size in bytes. */ |
| 3555 |
Link uint32 /* Index of a related section. */ |
| 3556 |
Info uint32 /* Depends on section type. */ |
| 3557 |
Addralign uint64 /* Alignment in bytes. */ |
| 3558 |
Entsize uint64 /* Size of each entry in section. */ |
| 3559 |
} |
| 3560 |
|
| 3561 |
// ELF64 Program header. |
| 3562 |
type Prog64 struct { |
| 3563 |
Type uint32 /* Entry type. */ |
| 3564 |
Flags uint32 /* Access permission flags. */ |
| 3565 |
Off uint64 /* File offset of contents. */ |
| 3566 |
Vaddr uint64 /* Virtual address in memory image. */ |
| 3567 |
Paddr uint64 /* Physical address (not used). */ |
| 3568 |
Filesz uint64 /* Size of contents in file. */ |
| 3569 |
Memsz uint64 /* Size of contents in memory. */ |
| 3570 |
Align uint64 /* Alignment in memory and file. */ |
| 3571 |
} |
| 3572 |
|
| 3573 |
// ELF64 Dynamic structure. The ".dynamic" section contains an array of them. |
| 3574 |
type Dyn64 struct { |
| 3575 |
Tag int64 /* Entry type. */ |
| 3576 |
Val uint64 /* Integer/address value */ |
| 3577 |
} |
| 3578 |
|
| 3579 |
// ELF64 Compression header. |
| 3580 |
type Chdr64 struct { |
| 3581 |
Type uint32 |
| 3582 |
_ uint32 /* Reserved. */ |
| 3583 |
Size uint64 |
| 3584 |
Addralign uint64 |
| 3585 |
} |
| 3586 |
|
| 3587 |
/* |
| 3588 |
* Relocation entries. |
| 3589 |
*/ |
| 3590 |
|
| 3591 |
/* ELF64 relocations that don't need an addend field. */ |
| 3592 |
type Rel64 struct { |
| 3593 |
Off uint64 /* Location to be relocated. */ |
| 3594 |
Info uint64 /* Relocation type and symbol index. */ |
| 3595 |
} |
| 3596 |
|
| 3597 |
/* ELF64 relocations that need an addend field. */ |
| 3598 |
type Rela64 struct { |
| 3599 |
Off uint64 /* Location to be relocated. */ |
| 3600 |
Info uint64 /* Relocation type and symbol index. */ |
| 3601 |
Addend int64 /* Addend. */ |
| 3602 |
} |
| 3603 |
|
| 3604 |
func R_SYM64(info uint64) uint32 { return uint32(info >> 32) } |
| 3605 |
func R_TYPE64(info uint64) uint32 { return uint32(info) } |
| 3606 |
func R_INFO(sym, typ uint32) uint64 { return uint64(sym)<<32 | uint64(typ) } |
| 3607 |
|
| 3608 |
// ELF64 symbol table entries. |
| 3609 |
type Sym64 struct { |
| 3610 |
Name uint32 /* String table index of name. */ |
| 3611 |
Info uint8 /* Type and binding information. */ |
| 3612 |
Other uint8 /* Reserved (not used). */ |
| 3613 |
Shndx uint16 /* Section index of symbol. */ |
| 3614 |
Value uint64 /* Symbol value. */ |
| 3615 |
Size uint64 /* Size of associated object. */ |
| 3616 |
} |
| 3617 |
|
| 3618 |
const Sym64Size = 24 |
| 3619 |
|
| 3620 |
type intName struct { |
| 3621 |
i uint32 |
| 3622 |
s string |
| 3623 |
} |
| 3624 |
|
| 3625 |
// Dynamic version flags. |
| 3626 |
type DynamicVersionFlag uint16 |
| 3627 |
|
| 3628 |
const ( |
| 3629 |
VER_FLG_BASE DynamicVersionFlag = 0x1 /* Version definition of the file. */ |
| 3630 |
VER_FLG_WEAK DynamicVersionFlag = 0x2 /* Weak version identifier. */ |
| 3631 |
VER_FLG_INFO DynamicVersionFlag = 0x4 /* Reference exists for informational purposes. */ |
| 3632 |
) |
| 3633 |
|
| 3634 |
func stringName(i uint32, names []intName, goSyntax bool) string { |
| 3635 |
for _, n := range names { |
| 3636 |
if n.i == i { |
| 3637 |
if goSyntax { |
| 3638 |
return "elf." + n.s |
| 3639 |
} |
| 3640 |
return n.s |
| 3641 |
} |
| 3642 |
} |
| 3643 |
|
| 3644 |
// second pass - look for smaller to add with. |
| 3645 |
// assume sorted already |
| 3646 |
for j := len(names) - 1; j >= 0; j-- { |
| 3647 |
n := names[j] |
| 3648 |
if n.i < i { |
| 3649 |
s := n.s |
| 3650 |
if goSyntax { |
| 3651 |
s = "elf." + s |
| 3652 |
} |
| 3653 |
return s + "+" + strconv.FormatUint(uint64(i-n.i), 10) |
| 3654 |
} |
| 3655 |
} |
| 3656 |
|
| 3657 |
return strconv.FormatUint(uint64(i), 10) |
| 3658 |
} |
| 3659 |
|
| 3660 |
func flagName(i uint32, names []intName, goSyntax bool) string { |
| 3661 |
s := "" |
| 3662 |
for _, n := range names { |
| 3663 |
if n.i&i == n.i { |
| 3664 |
if len(s) > 0 { |
| 3665 |
s += "+" |
| 3666 |
} |
| 3667 |
if goSyntax { |
| 3668 |
s += "elf." |
| 3669 |
} |
| 3670 |
s += n.s |
| 3671 |
i -= n.i |
| 3672 |
} |
| 3673 |
} |
| 3674 |
if len(s) == 0 { |
| 3675 |
return "0x" + strconv.FormatUint(uint64(i), 16) |
| 3676 |
} |
| 3677 |
if i != 0 { |
| 3678 |
s += "+0x" + strconv.FormatUint(uint64(i), 16) |
| 3679 |
} |
| 3680 |
return s |
| 3681 |
} |