Home | History | Annotate | Download | only in elf
      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  * "ELF for the ARM 64-bit Architecture (AArch64)" (ARM IHI 0056B)
     15  *
     16  * Copyright (c) 1996-1998 John D. Polstra.  All rights reserved.
     17  * Copyright (c) 2001 David E. O'Brien
     18  * Portions Copyright 2009 The Go Authors. All rights reserved.
     19  *
     20  * Redistribution and use in source and binary forms, with or without
     21  * modification, are permitted provided that the following conditions
     22  * are met:
     23  * 1. Redistributions of source code must retain the above copyright
     24  *    notice, this list of conditions and the following disclaimer.
     25  * 2. Redistributions in binary form must reproduce the above copyright
     26  *    notice, this list of conditions and the following disclaimer in the
     27  *    documentation and/or other materials provided with the distribution.
     28  *
     29  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     30  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     31  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     32  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     33  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     34  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     35  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     36  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     37  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     38  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     39  * SUCH DAMAGE.
     40  */
     41 
     42 package elf
     43 
     44 import "strconv"
     45 
     46 /*
     47  * Constants
     48  */
     49 
     50 // Indexes into the Header.Ident array.
     51 const (
     52 	EI_CLASS      = 4  /* Class of machine. */
     53 	EI_DATA       = 5  /* Data format. */
     54 	EI_VERSION    = 6  /* ELF format version. */
     55 	EI_OSABI      = 7  /* Operating system / ABI identification */
     56 	EI_ABIVERSION = 8  /* ABI version */
     57 	EI_PAD        = 9  /* Start of padding (per SVR4 ABI). */
     58 	EI_NIDENT     = 16 /* Size of e_ident array. */
     59 )
     60 
     61 // Initial magic number for ELF files.
     62 const ELFMAG = "\177ELF"
     63 
     64 // Version is found in Header.Ident[EI_VERSION] and Header.Version.
     65 type Version byte
     66 
     67 const (
     68 	EV_NONE    Version = 0
     69 	EV_CURRENT Version = 1
     70 )
     71 
     72 var versionStrings = []intName{
     73 	{0, "EV_NONE"},
     74 	{1, "EV_CURRENT"},
     75 }
     76 
     77 func (i Version) String() string   { return stringName(uint32(i), versionStrings, false) }
     78 func (i Version) GoString() string { return stringName(uint32(i), versionStrings, true) }
     79 
     80 // Class is found in Header.Ident[EI_CLASS] and Header.Class.
     81 type Class byte
     82 
     83 const (
     84 	ELFCLASSNONE Class = 0 /* Unknown class. */
     85 	ELFCLASS32   Class = 1 /* 32-bit architecture. */
     86 	ELFCLASS64   Class = 2 /* 64-bit architecture. */
     87 )
     88 
     89 var classStrings = []intName{
     90 	{0, "ELFCLASSNONE"},
     91 	{1, "ELFCLASS32"},
     92 	{2, "ELFCLASS64"},
     93 }
     94 
     95 func (i Class) String() string   { return stringName(uint32(i), classStrings, false) }
     96 func (i Class) GoString() string { return stringName(uint32(i), classStrings, true) }
     97 
     98 // Data is found in Header.Ident[EI_DATA] and Header.Data.
     99 type Data byte
    100 
    101 const (
    102 	ELFDATANONE Data = 0 /* Unknown data format. */
    103 	ELFDATA2LSB Data = 1 /* 2's complement little-endian. */
    104 	ELFDATA2MSB Data = 2 /* 2's complement big-endian. */
    105 )
    106 
    107 var dataStrings = []intName{
    108 	{0, "ELFDATANONE"},
    109 	{1, "ELFDATA2LSB"},
    110 	{2, "ELFDATA2MSB"},
    111 }
    112 
    113 func (i Data) String() string   { return stringName(uint32(i), dataStrings, false) }
    114 func (i Data) GoString() string { return stringName(uint32(i), dataStrings, true) }
    115 
    116 // OSABI is found in Header.Ident[EI_OSABI] and Header.OSABI.
    117 type OSABI byte
    118 
    119 const (
    120 	ELFOSABI_NONE       OSABI = 0   /* UNIX System V ABI */
    121 	ELFOSABI_HPUX       OSABI = 1   /* HP-UX operating system */
    122 	ELFOSABI_NETBSD     OSABI = 2   /* NetBSD */
    123 	ELFOSABI_LINUX      OSABI = 3   /* GNU/Linux */
    124 	ELFOSABI_HURD       OSABI = 4   /* GNU/Hurd */
    125 	ELFOSABI_86OPEN     OSABI = 5   /* 86Open common IA32 ABI */
    126 	ELFOSABI_SOLARIS    OSABI = 6   /* Solaris */
    127 	ELFOSABI_AIX        OSABI = 7   /* AIX */
    128 	ELFOSABI_IRIX       OSABI = 8   /* IRIX */
    129 	ELFOSABI_FREEBSD    OSABI = 9   /* FreeBSD */
    130 	ELFOSABI_TRU64      OSABI = 10  /* TRU64 UNIX */
    131 	ELFOSABI_MODESTO    OSABI = 11  /* Novell Modesto */
    132 	ELFOSABI_OPENBSD    OSABI = 12  /* OpenBSD */
    133 	ELFOSABI_OPENVMS    OSABI = 13  /* Open VMS */
    134 	ELFOSABI_NSK        OSABI = 14  /* HP Non-Stop Kernel */
    135 	ELFOSABI_ARM        OSABI = 97  /* ARM */
    136 	ELFOSABI_STANDALONE OSABI = 255 /* Standalone (embedded) application */
    137 )
    138 
    139 var osabiStrings = []intName{
    140 	{0, "ELFOSABI_NONE"},
    141 	{1, "ELFOSABI_HPUX"},
    142 	{2, "ELFOSABI_NETBSD"},
    143 	{3, "ELFOSABI_LINUX"},
    144 	{4, "ELFOSABI_HURD"},
    145 	{5, "ELFOSABI_86OPEN"},
    146 	{6, "ELFOSABI_SOLARIS"},
    147 	{7, "ELFOSABI_AIX"},
    148 	{8, "ELFOSABI_IRIX"},
    149 	{9, "ELFOSABI_FREEBSD"},
    150 	{10, "ELFOSABI_TRU64"},
    151 	{11, "ELFOSABI_MODESTO"},
    152 	{12, "ELFOSABI_OPENBSD"},
    153 	{13, "ELFOSABI_OPENVMS"},
    154 	{14, "ELFOSABI_NSK"},
    155 	{97, "ELFOSABI_ARM"},
    156 	{255, "ELFOSABI_STANDALONE"},
    157 }
    158 
    159 func (i OSABI) String() string   { return stringName(uint32(i), osabiStrings, false) }
    160 func (i OSABI) GoString() string { return stringName(uint32(i), osabiStrings, true) }
    161 
    162 // Type is found in Header.Type.
    163 type Type uint16
    164 
    165 const (
    166 	ET_NONE   Type = 0      /* Unknown type. */
    167 	ET_REL    Type = 1      /* Relocatable. */
    168 	ET_EXEC   Type = 2      /* Executable. */
    169 	ET_DYN    Type = 3      /* Shared object. */
    170 	ET_CORE   Type = 4      /* Core file. */
    171 	ET_LOOS   Type = 0xfe00 /* First operating system specific. */
    172 	ET_HIOS   Type = 0xfeff /* Last operating system-specific. */
    173 	ET_LOPROC Type = 0xff00 /* First processor-specific. */
    174 	ET_HIPROC Type = 0xffff /* Last processor-specific. */
    175 )
    176 
    177 var typeStrings = []intName{
    178 	{0, "ET_NONE"},
    179 	{1, "ET_REL"},
    180 	{2, "ET_EXEC"},
    181 	{3, "ET_DYN"},
    182 	{4, "ET_CORE"},
    183 	{0xfe00, "ET_LOOS"},
    184 	{0xfeff, "ET_HIOS"},
    185 	{0xff00, "ET_LOPROC"},
    186 	{0xffff, "ET_HIPROC"},
    187 }
    188 
    189 func (i Type) String() string   { return stringName(uint32(i), typeStrings, false) }
    190 func (i Type) GoString() string { return stringName(uint32(i), typeStrings, true) }
    191 
    192 // Machine is found in Header.Machine.
    193 type Machine uint16
    194 
    195 const (
    196 	EM_NONE        Machine = 0   /* Unknown machine. */
    197 	EM_M32         Machine = 1   /* AT&T WE32100. */
    198 	EM_SPARC       Machine = 2   /* Sun SPARC. */
    199 	EM_386         Machine = 3   /* Intel i386. */
    200 	EM_68K         Machine = 4   /* Motorola 68000. */
    201 	EM_88K         Machine = 5   /* Motorola 88000. */
    202 	EM_860         Machine = 7   /* Intel i860. */
    203 	EM_MIPS        Machine = 8   /* MIPS R3000 Big-Endian only. */
    204 	EM_S370        Machine = 9   /* IBM System/370. */
    205 	EM_MIPS_RS3_LE Machine = 10  /* MIPS R3000 Little-Endian. */
    206 	EM_PARISC      Machine = 15  /* HP PA-RISC. */
    207 	EM_VPP500      Machine = 17  /* Fujitsu VPP500. */
    208 	EM_SPARC32PLUS Machine = 18  /* SPARC v8plus. */
    209 	EM_960         Machine = 19  /* Intel 80960. */
    210 	EM_PPC         Machine = 20  /* PowerPC 32-bit. */
    211 	EM_PPC64       Machine = 21  /* PowerPC 64-bit. */
    212 	EM_S390        Machine = 22  /* IBM System/390. */
    213 	EM_V800        Machine = 36  /* NEC V800. */
    214 	EM_FR20        Machine = 37  /* Fujitsu FR20. */
    215 	EM_RH32        Machine = 38  /* TRW RH-32. */
    216 	EM_RCE         Machine = 39  /* Motorola RCE. */
    217 	EM_ARM         Machine = 40  /* ARM. */
    218 	EM_SH          Machine = 42  /* Hitachi SH. */
    219 	EM_SPARCV9     Machine = 43  /* SPARC v9 64-bit. */
    220 	EM_TRICORE     Machine = 44  /* Siemens TriCore embedded processor. */
    221 	EM_ARC         Machine = 45  /* Argonaut RISC Core. */
    222 	EM_H8_300      Machine = 46  /* Hitachi H8/300. */
    223 	EM_H8_300H     Machine = 47  /* Hitachi H8/300H. */
    224 	EM_H8S         Machine = 48  /* Hitachi H8S. */
    225 	EM_H8_500      Machine = 49  /* Hitachi H8/500. */
    226 	EM_IA_64       Machine = 50  /* Intel IA-64 Processor. */
    227 	EM_MIPS_X      Machine = 51  /* Stanford MIPS-X. */
    228 	EM_COLDFIRE    Machine = 52  /* Motorola ColdFire. */
    229 	EM_68HC12      Machine = 53  /* Motorola M68HC12. */
    230 	EM_MMA         Machine = 54  /* Fujitsu MMA. */
    231 	EM_PCP         Machine = 55  /* Siemens PCP. */
    232 	EM_NCPU        Machine = 56  /* Sony nCPU. */
    233 	EM_NDR1        Machine = 57  /* Denso NDR1 microprocessor. */
    234 	EM_STARCORE    Machine = 58  /* Motorola Star*Core processor. */
    235 	EM_ME16        Machine = 59  /* Toyota ME16 processor. */
    236 	EM_ST100       Machine = 60  /* STMicroelectronics ST100 processor. */
    237 	EM_TINYJ       Machine = 61  /* Advanced Logic Corp. TinyJ processor. */
    238 	EM_X86_64      Machine = 62  /* Advanced Micro Devices x86-64 */
    239 	EM_AARCH64     Machine = 183 /* ARM 64-bit Architecture (AArch64) */
    240 
    241 	/* Non-standard or deprecated. */
    242 	EM_486         Machine = 6      /* Intel i486. */
    243 	EM_MIPS_RS4_BE Machine = 10     /* MIPS R4000 Big-Endian */
    244 	EM_ALPHA_STD   Machine = 41     /* Digital Alpha (standard value). */
    245 	EM_ALPHA       Machine = 0x9026 /* Alpha (written in the absence of an ABI) */
    246 )
    247 
    248 var machineStrings = []intName{
    249 	{0, "EM_NONE"},
    250 	{1, "EM_M32"},
    251 	{2, "EM_SPARC"},
    252 	{3, "EM_386"},
    253 	{4, "EM_68K"},
    254 	{5, "EM_88K"},
    255 	{7, "EM_860"},
    256 	{8, "EM_MIPS"},
    257 	{9, "EM_S370"},
    258 	{10, "EM_MIPS_RS3_LE"},
    259 	{15, "EM_PARISC"},
    260 	{17, "EM_VPP500"},
    261 	{18, "EM_SPARC32PLUS"},
    262 	{19, "EM_960"},
    263 	{20, "EM_PPC"},
    264 	{21, "EM_PPC64"},
    265 	{22, "EM_S390"},
    266 	{36, "EM_V800"},
    267 	{37, "EM_FR20"},
    268 	{38, "EM_RH32"},
    269 	{39, "EM_RCE"},
    270 	{40, "EM_ARM"},
    271 	{42, "EM_SH"},
    272 	{43, "EM_SPARCV9"},
    273 	{44, "EM_TRICORE"},
    274 	{45, "EM_ARC"},
    275 	{46, "EM_H8_300"},
    276 	{47, "EM_H8_300H"},
    277 	{48, "EM_H8S"},
    278 	{49, "EM_H8_500"},
    279 	{50, "EM_IA_64"},
    280 	{51, "EM_MIPS_X"},
    281 	{52, "EM_COLDFIRE"},
    282 	{53, "EM_68HC12"},
    283 	{54, "EM_MMA"},
    284 	{55, "EM_PCP"},
    285 	{56, "EM_NCPU"},
    286 	{57, "EM_NDR1"},
    287 	{58, "EM_STARCORE"},
    288 	{59, "EM_ME16"},
    289 	{60, "EM_ST100"},
    290 	{61, "EM_TINYJ"},
    291 	{62, "EM_X86_64"},
    292 
    293 	/* Non-standard or deprecated. */
    294 	{6, "EM_486"},
    295 	{10, "EM_MIPS_RS4_BE"},
    296 	{41, "EM_ALPHA_STD"},
    297 	{0x9026, "EM_ALPHA"},
    298 }
    299 
    300 func (i Machine) String() string   { return stringName(uint32(i), machineStrings, false) }
    301 func (i Machine) GoString() string { return stringName(uint32(i), machineStrings, true) }
    302 
    303 // Special section indices.
    304 type SectionIndex int
    305 
    306 const (
    307 	SHN_UNDEF     SectionIndex = 0      /* Undefined, missing, irrelevant. */
    308 	SHN_LORESERVE SectionIndex = 0xff00 /* First of reserved range. */
    309 	SHN_LOPROC    SectionIndex = 0xff00 /* First processor-specific. */
    310 	SHN_HIPROC    SectionIndex = 0xff1f /* Last processor-specific. */
    311 	SHN_LOOS      SectionIndex = 0xff20 /* First operating system-specific. */
    312 	SHN_HIOS      SectionIndex = 0xff3f /* Last operating system-specific. */
    313 	SHN_ABS       SectionIndex = 0xfff1 /* Absolute values. */
    314 	SHN_COMMON    SectionIndex = 0xfff2 /* Common data. */
    315 	SHN_XINDEX    SectionIndex = 0xffff /* Escape; index stored elsewhere. */
    316 	SHN_HIRESERVE SectionIndex = 0xffff /* Last of reserved range. */
    317 )
    318 
    319 var shnStrings = []intName{
    320 	{0, "SHN_UNDEF"},
    321 	{0xff00, "SHN_LOPROC"},
    322 	{0xff20, "SHN_LOOS"},
    323 	{0xfff1, "SHN_ABS"},
    324 	{0xfff2, "SHN_COMMON"},
    325 	{0xffff, "SHN_XINDEX"},
    326 }
    327 
    328 func (i SectionIndex) String() string   { return stringName(uint32(i), shnStrings, false) }
    329 func (i SectionIndex) GoString() string { return stringName(uint32(i), shnStrings, true) }
    330 
    331 // Section type.
    332 type SectionType uint32
    333 
    334 const (
    335 	SHT_NULL           SectionType = 0          /* inactive */
    336 	SHT_PROGBITS       SectionType = 1          /* program defined information */
    337 	SHT_SYMTAB         SectionType = 2          /* symbol table section */
    338 	SHT_STRTAB         SectionType = 3          /* string table section */
    339 	SHT_RELA           SectionType = 4          /* relocation section with addends */
    340 	SHT_HASH           SectionType = 5          /* symbol hash table section */
    341 	SHT_DYNAMIC        SectionType = 6          /* dynamic section */
    342 	SHT_NOTE           SectionType = 7          /* note section */
    343 	SHT_NOBITS         SectionType = 8          /* no space section */
    344 	SHT_REL            SectionType = 9          /* relocation section - no addends */
    345 	SHT_SHLIB          SectionType = 10         /* reserved - purpose unknown */
    346 	SHT_DYNSYM         SectionType = 11         /* dynamic symbol table section */
    347 	SHT_INIT_ARRAY     SectionType = 14         /* Initialization function pointers. */
    348 	SHT_FINI_ARRAY     SectionType = 15         /* Termination function pointers. */
    349 	SHT_PREINIT_ARRAY  SectionType = 16         /* Pre-initialization function ptrs. */
    350 	SHT_GROUP          SectionType = 17         /* Section group. */
    351 	SHT_SYMTAB_SHNDX   SectionType = 18         /* Section indexes (see SHN_XINDEX). */
    352 	SHT_LOOS           SectionType = 0x60000000 /* First of OS specific semantics */
    353 	SHT_GNU_ATTRIBUTES SectionType = 0x6ffffff5 /* GNU object attributes */
    354 	SHT_GNU_HASH       SectionType = 0x6ffffff6 /* GNU hash table */
    355 	SHT_GNU_LIBLIST    SectionType = 0x6ffffff7 /* GNU prelink library list */
    356 	SHT_GNU_VERDEF     SectionType = 0x6ffffffd /* GNU version definition section */
    357 	SHT_GNU_VERNEED    SectionType = 0x6ffffffe /* GNU version needs section */
    358 	SHT_GNU_VERSYM     SectionType = 0x6fffffff /* GNU version symbol table */
    359 	SHT_HIOS           SectionType = 0x6fffffff /* Last of OS specific semantics */
    360 	SHT_LOPROC         SectionType = 0x70000000 /* reserved range for processor */
    361 	SHT_HIPROC         SectionType = 0x7fffffff /* specific section header types */
    362 	SHT_LOUSER         SectionType = 0x80000000 /* reserved range for application */
    363 	SHT_HIUSER         SectionType = 0xffffffff /* specific indexes */
    364 )
    365 
    366 var shtStrings = []intName{
    367 	{0, "SHT_NULL"},
    368 	{1, "SHT_PROGBITS"},
    369 	{2, "SHT_SYMTAB"},
    370 	{3, "SHT_STRTAB"},
    371 	{4, "SHT_RELA"},
    372 	{5, "SHT_HASH"},
    373 	{6, "SHT_DYNAMIC"},
    374 	{7, "SHT_NOTE"},
    375 	{8, "SHT_NOBITS"},
    376 	{9, "SHT_REL"},
    377 	{10, "SHT_SHLIB"},
    378 	{11, "SHT_DYNSYM"},
    379 	{14, "SHT_INIT_ARRAY"},
    380 	{15, "SHT_FINI_ARRAY"},
    381 	{16, "SHT_PREINIT_ARRAY"},
    382 	{17, "SHT_GROUP"},
    383 	{18, "SHT_SYMTAB_SHNDX"},
    384 	{0x60000000, "SHT_LOOS"},
    385 	{0x6ffffff5, "SHT_GNU_ATTRIBUTES"},
    386 	{0x6ffffff6, "SHT_GNU_HASH"},
    387 	{0x6ffffff7, "SHT_GNU_LIBLIST"},
    388 	{0x6ffffffd, "SHT_GNU_VERDEF"},
    389 	{0x6ffffffe, "SHT_GNU_VERNEED"},
    390 	{0x6fffffff, "SHT_GNU_VERSYM"},
    391 	{0x70000000, "SHT_LOPROC"},
    392 	{0x7fffffff, "SHT_HIPROC"},
    393 	{0x80000000, "SHT_LOUSER"},
    394 	{0xffffffff, "SHT_HIUSER"},
    395 }
    396 
    397 func (i SectionType) String() string   { return stringName(uint32(i), shtStrings, false) }
    398 func (i SectionType) GoString() string { return stringName(uint32(i), shtStrings, true) }
    399 
    400 // Section flags.
    401 type SectionFlag uint32
    402 
    403 const (
    404 	SHF_WRITE            SectionFlag = 0x1        /* Section contains writable data. */
    405 	SHF_ALLOC            SectionFlag = 0x2        /* Section occupies memory. */
    406 	SHF_EXECINSTR        SectionFlag = 0x4        /* Section contains instructions. */
    407 	SHF_MERGE            SectionFlag = 0x10       /* Section may be merged. */
    408 	SHF_STRINGS          SectionFlag = 0x20       /* Section contains strings. */
    409 	SHF_INFO_LINK        SectionFlag = 0x40       /* sh_info holds section index. */
    410 	SHF_LINK_ORDER       SectionFlag = 0x80       /* Special ordering requirements. */
    411 	SHF_OS_NONCONFORMING SectionFlag = 0x100      /* OS-specific processing required. */
    412 	SHF_GROUP            SectionFlag = 0x200      /* Member of section group. */
    413 	SHF_TLS              SectionFlag = 0x400      /* Section contains TLS data. */
    414 	SHF_COMPRESSED       SectionFlag = 0x800      /* Section is compressed. */
    415 	SHF_MASKOS           SectionFlag = 0x0ff00000 /* OS-specific semantics. */
    416 	SHF_MASKPROC         SectionFlag = 0xf0000000 /* Processor-specific semantics. */
    417 )
    418 
    419 var shfStrings = []intName{
    420 	{0x1, "SHF_WRITE"},
    421 	{0x2, "SHF_ALLOC"},
    422 	{0x4, "SHF_EXECINSTR"},
    423 	{0x10, "SHF_MERGE"},
    424 	{0x20, "SHF_STRINGS"},
    425 	{0x40, "SHF_INFO_LINK"},
    426 	{0x80, "SHF_LINK_ORDER"},
    427 	{0x100, "SHF_OS_NONCONFORMING"},
    428 	{0x200, "SHF_GROUP"},
    429 	{0x400, "SHF_TLS"},
    430 	{0x800, "SHF_COMPRESSED"},
    431 }
    432 
    433 func (i SectionFlag) String() string   { return flagName(uint32(i), shfStrings, false) }
    434 func (i SectionFlag) GoString() string { return flagName(uint32(i), shfStrings, true) }
    435 
    436 // Section compression type.
    437 type CompressionType int
    438 
    439 const (
    440 	COMPRESS_ZLIB   CompressionType = 1          /* ZLIB compression. */
    441 	COMPRESS_LOOS   CompressionType = 0x60000000 /* First OS-specific. */
    442 	COMPRESS_HIOS   CompressionType = 0x6fffffff /* Last OS-specific. */
    443 	COMPRESS_LOPROC CompressionType = 0x70000000 /* First processor-specific type. */
    444 	COMPRESS_HIPROC CompressionType = 0x7fffffff /* Last processor-specific type. */
    445 )
    446 
    447 var compressionStrings = []intName{
    448 	{0, "COMPRESS_ZLIB"},
    449 	{0x60000000, "COMPRESS_LOOS"},
    450 	{0x6fffffff, "COMPRESS_HIOS"},
    451 	{0x70000000, "COMPRESS_LOPROC"},
    452 	{0x7fffffff, "COMPRESS_HIPROC"},
    453 }
    454 
    455 func (i CompressionType) String() string   { return stringName(uint32(i), compressionStrings, false) }
    456 func (i CompressionType) GoString() string { return stringName(uint32(i), compressionStrings, true) }
    457 
    458 // Prog.Type
    459 type ProgType int
    460 
    461 const (
    462 	PT_NULL    ProgType = 0          /* Unused entry. */
    463 	PT_LOAD    ProgType = 1          /* Loadable segment. */
    464 	PT_DYNAMIC ProgType = 2          /* Dynamic linking information segment. */
    465 	PT_INTERP  ProgType = 3          /* Pathname of interpreter. */
    466 	PT_NOTE    ProgType = 4          /* Auxiliary information. */
    467 	PT_SHLIB   ProgType = 5          /* Reserved (not used). */
    468 	PT_PHDR    ProgType = 6          /* Location of program header itself. */
    469 	PT_TLS     ProgType = 7          /* Thread local storage segment */
    470 	PT_LOOS    ProgType = 0x60000000 /* First OS-specific. */
    471 	PT_HIOS    ProgType = 0x6fffffff /* Last OS-specific. */
    472 	PT_LOPROC  ProgType = 0x70000000 /* First processor-specific type. */
    473 	PT_HIPROC  ProgType = 0x7fffffff /* Last processor-specific type. */
    474 )
    475 
    476 var ptStrings = []intName{
    477 	{0, "PT_NULL"},
    478 	{1, "PT_LOAD"},
    479 	{2, "PT_DYNAMIC"},
    480 	{3, "PT_INTERP"},
    481 	{4, "PT_NOTE"},
    482 	{5, "PT_SHLIB"},
    483 	{6, "PT_PHDR"},
    484 	{7, "PT_TLS"},
    485 	{0x60000000, "PT_LOOS"},
    486 	{0x6fffffff, "PT_HIOS"},
    487 	{0x70000000, "PT_LOPROC"},
    488 	{0x7fffffff, "PT_HIPROC"},
    489 }
    490 
    491 func (i ProgType) String() string   { return stringName(uint32(i), ptStrings, false) }
    492 func (i ProgType) GoString() string { return stringName(uint32(i), ptStrings, true) }
    493 
    494 // Prog.Flag
    495 type ProgFlag uint32
    496 
    497 const (
    498 	PF_X        ProgFlag = 0x1        /* Executable. */
    499 	PF_W        ProgFlag = 0x2        /* Writable. */
    500 	PF_R        ProgFlag = 0x4        /* Readable. */
    501 	PF_MASKOS   ProgFlag = 0x0ff00000 /* Operating system-specific. */
    502 	PF_MASKPROC ProgFlag = 0xf0000000 /* Processor-specific. */
    503 )
    504 
    505 var pfStrings = []intName{
    506 	{0x1, "PF_X"},
    507 	{0x2, "PF_W"},
    508 	{0x4, "PF_R"},
    509 }
    510 
    511 func (i ProgFlag) String() string   { return flagName(uint32(i), pfStrings, false) }
    512 func (i ProgFlag) GoString() string { return flagName(uint32(i), pfStrings, true) }
    513 
    514 // Dyn.Tag
    515 type DynTag int
    516 
    517 const (
    518 	DT_NULL         DynTag = 0  /* Terminating entry. */
    519 	DT_NEEDED       DynTag = 1  /* String table offset of a needed shared library. */
    520 	DT_PLTRELSZ     DynTag = 2  /* Total size in bytes of PLT relocations. */
    521 	DT_PLTGOT       DynTag = 3  /* Processor-dependent address. */
    522 	DT_HASH         DynTag = 4  /* Address of symbol hash table. */
    523 	DT_STRTAB       DynTag = 5  /* Address of string table. */
    524 	DT_SYMTAB       DynTag = 6  /* Address of symbol table. */
    525 	DT_RELA         DynTag = 7  /* Address of ElfNN_Rela relocations. */
    526 	DT_RELASZ       DynTag = 8  /* Total size of ElfNN_Rela relocations. */
    527 	DT_RELAENT      DynTag = 9  /* Size of each ElfNN_Rela relocation entry. */
    528 	DT_STRSZ        DynTag = 10 /* Size of string table. */
    529 	DT_SYMENT       DynTag = 11 /* Size of each symbol table entry. */
    530 	DT_INIT         DynTag = 12 /* Address of initialization function. */
    531 	DT_FINI         DynTag = 13 /* Address of finalization function. */
    532 	DT_SONAME       DynTag = 14 /* String table offset of shared object name. */
    533 	DT_RPATH        DynTag = 15 /* String table offset of library path. [sup] */
    534 	DT_SYMBOLIC     DynTag = 16 /* Indicates "symbolic" linking. [sup] */
    535 	DT_REL          DynTag = 17 /* Address of ElfNN_Rel relocations. */
    536 	DT_RELSZ        DynTag = 18 /* Total size of ElfNN_Rel relocations. */
    537 	DT_RELENT       DynTag = 19 /* Size of each ElfNN_Rel relocation. */
    538 	DT_PLTREL       DynTag = 20 /* Type of relocation used for PLT. */
    539 	DT_DEBUG        DynTag = 21 /* Reserved (not used). */
    540 	DT_TEXTREL      DynTag = 22 /* Indicates there may be relocations in non-writable segments. [sup] */
    541 	DT_JMPREL       DynTag = 23 /* Address of PLT relocations. */
    542 	DT_BIND_NOW     DynTag = 24 /* [sup] */
    543 	DT_INIT_ARRAY   DynTag = 25 /* Address of the array of pointers to initialization functions */
    544 	DT_FINI_ARRAY   DynTag = 26 /* Address of the array of pointers to termination functions */
    545 	DT_INIT_ARRAYSZ DynTag = 27 /* Size in bytes of the array of initialization functions. */
    546 	DT_FINI_ARRAYSZ DynTag = 28 /* Size in bytes of the array of termination functions. */
    547 	DT_RUNPATH      DynTag = 29 /* String table offset of a null-terminated library search path string. */
    548 	DT_FLAGS        DynTag = 30 /* Object specific flag values. */
    549 	DT_ENCODING     DynTag = 32 /* Values greater than or equal to DT_ENCODING
    550 	   and less than DT_LOOS follow the rules for
    551 	   the interpretation of the d_un union
    552 	   as follows: even == 'd_ptr', even == 'd_val'
    553 	   or none */
    554 	DT_PREINIT_ARRAY   DynTag = 32         /* Address of the array of pointers to pre-initialization functions. */
    555 	DT_PREINIT_ARRAYSZ DynTag = 33         /* Size in bytes of the array of pre-initialization functions. */
    556 	DT_LOOS            DynTag = 0x6000000d /* First OS-specific */
    557 	DT_HIOS            DynTag = 0x6ffff000 /* Last OS-specific */
    558 	DT_VERSYM          DynTag = 0x6ffffff0
    559 	DT_VERNEED         DynTag = 0x6ffffffe
    560 	DT_VERNEEDNUM      DynTag = 0x6fffffff
    561 	DT_LOPROC          DynTag = 0x70000000 /* First processor-specific type. */
    562 	DT_HIPROC          DynTag = 0x7fffffff /* Last processor-specific type. */
    563 )
    564 
    565 var dtStrings = []intName{
    566 	{0, "DT_NULL"},
    567 	{1, "DT_NEEDED"},
    568 	{2, "DT_PLTRELSZ"},
    569 	{3, "DT_PLTGOT"},
    570 	{4, "DT_HASH"},
    571 	{5, "DT_STRTAB"},
    572 	{6, "DT_SYMTAB"},
    573 	{7, "DT_RELA"},
    574 	{8, "DT_RELASZ"},
    575 	{9, "DT_RELAENT"},
    576 	{10, "DT_STRSZ"},
    577 	{11, "DT_SYMENT"},
    578 	{12, "DT_INIT"},
    579 	{13, "DT_FINI"},
    580 	{14, "DT_SONAME"},
    581 	{15, "DT_RPATH"},
    582 	{16, "DT_SYMBOLIC"},
    583 	{17, "DT_REL"},
    584 	{18, "DT_RELSZ"},
    585 	{19, "DT_RELENT"},
    586 	{20, "DT_PLTREL"},
    587 	{21, "DT_DEBUG"},
    588 	{22, "DT_TEXTREL"},
    589 	{23, "DT_JMPREL"},
    590 	{24, "DT_BIND_NOW"},
    591 	{25, "DT_INIT_ARRAY"},
    592 	{26, "DT_FINI_ARRAY"},
    593 	{27, "DT_INIT_ARRAYSZ"},
    594 	{28, "DT_FINI_ARRAYSZ"},
    595 	{29, "DT_RUNPATH"},
    596 	{30, "DT_FLAGS"},
    597 	{32, "DT_ENCODING"},
    598 	{32, "DT_PREINIT_ARRAY"},
    599 	{33, "DT_PREINIT_ARRAYSZ"},
    600 	{0x6000000d, "DT_LOOS"},
    601 	{0x6ffff000, "DT_HIOS"},
    602 	{0x6ffffff0, "DT_VERSYM"},
    603 	{0x6ffffffe, "DT_VERNEED"},
    604 	{0x6fffffff, "DT_VERNEEDNUM"},
    605 	{0x70000000, "DT_LOPROC"},
    606 	{0x7fffffff, "DT_HIPROC"},
    607 }
    608 
    609 func (i DynTag) String() string   { return stringName(uint32(i), dtStrings, false) }
    610 func (i DynTag) GoString() string { return stringName(uint32(i), dtStrings, true) }
    611 
    612 // DT_FLAGS values.
    613 type DynFlag int
    614 
    615 const (
    616 	DF_ORIGIN DynFlag = 0x0001 /* Indicates that the object being loaded may
    617 	   make reference to the
    618 	   $ORIGIN substitution string */
    619 	DF_SYMBOLIC DynFlag = 0x0002 /* Indicates "symbolic" linking. */
    620 	DF_TEXTREL  DynFlag = 0x0004 /* Indicates there may be relocations in non-writable segments. */
    621 	DF_BIND_NOW DynFlag = 0x0008 /* Indicates that the dynamic linker should
    622 	   process all relocations for the object
    623 	   containing this entry before transferring
    624 	   control to the program. */
    625 	DF_STATIC_TLS DynFlag = 0x0010 /* Indicates that the shared object or
    626 	   executable contains code using a static
    627 	   thread-local storage scheme. */
    628 )
    629 
    630 var dflagStrings = []intName{
    631 	{0x0001, "DF_ORIGIN"},
    632 	{0x0002, "DF_SYMBOLIC"},
    633 	{0x0004, "DF_TEXTREL"},
    634 	{0x0008, "DF_BIND_NOW"},
    635 	{0x0010, "DF_STATIC_TLS"},
    636 }
    637 
    638 func (i DynFlag) String() string   { return flagName(uint32(i), dflagStrings, false) }
    639 func (i DynFlag) GoString() string { return flagName(uint32(i), dflagStrings, true) }
    640 
    641 // NType values; used in core files.
    642 type NType int
    643 
    644 const (
    645 	NT_PRSTATUS NType = 1 /* Process status. */
    646 	NT_FPREGSET NType = 2 /* Floating point registers. */
    647 	NT_PRPSINFO NType = 3 /* Process state info. */
    648 )
    649 
    650 var ntypeStrings = []intName{
    651 	{1, "NT_PRSTATUS"},
    652 	{2, "NT_FPREGSET"},
    653 	{3, "NT_PRPSINFO"},
    654 }
    655 
    656 func (i NType) String() string   { return stringName(uint32(i), ntypeStrings, false) }
    657 func (i NType) GoString() string { return stringName(uint32(i), ntypeStrings, true) }
    658 
    659 /* Symbol Binding - ELFNN_ST_BIND - st_info */
    660 type SymBind int
    661 
    662 const (
    663 	STB_LOCAL  SymBind = 0  /* Local symbol */
    664 	STB_GLOBAL SymBind = 1  /* Global symbol */
    665 	STB_WEAK   SymBind = 2  /* like global - lower precedence */
    666 	STB_LOOS   SymBind = 10 /* Reserved range for operating system */
    667 	STB_HIOS   SymBind = 12 /*   specific semantics. */
    668 	STB_LOPROC SymBind = 13 /* reserved range for processor */
    669 	STB_HIPROC SymBind = 15 /*   specific semantics. */
    670 )
    671 
    672 var stbStrings = []intName{
    673 	{0, "STB_LOCAL"},
    674 	{1, "STB_GLOBAL"},
    675 	{2, "STB_WEAK"},
    676 	{10, "STB_LOOS"},
    677 	{12, "STB_HIOS"},
    678 	{13, "STB_LOPROC"},
    679 	{15, "STB_HIPROC"},
    680 }
    681 
    682 func (i SymBind) String() string   { return stringName(uint32(i), stbStrings, false) }
    683 func (i SymBind) GoString() string { return stringName(uint32(i), stbStrings, true) }
    684 
    685 /* Symbol type - ELFNN_ST_TYPE - st_info */
    686 type SymType int
    687 
    688 const (
    689 	STT_NOTYPE  SymType = 0  /* Unspecified type. */
    690 	STT_OBJECT  SymType = 1  /* Data object. */
    691 	STT_FUNC    SymType = 2  /* Function. */
    692 	STT_SECTION SymType = 3  /* Section. */
    693 	STT_FILE    SymType = 4  /* Source file. */
    694 	STT_COMMON  SymType = 5  /* Uninitialized common block. */
    695 	STT_TLS     SymType = 6  /* TLS object. */
    696 	STT_LOOS    SymType = 10 /* Reserved range for operating system */
    697 	STT_HIOS    SymType = 12 /*   specific semantics. */
    698 	STT_LOPROC  SymType = 13 /* reserved range for processor */
    699 	STT_HIPROC  SymType = 15 /*   specific semantics. */
    700 )
    701 
    702 var sttStrings = []intName{
    703 	{0, "STT_NOTYPE"},
    704 	{1, "STT_OBJECT"},
    705 	{2, "STT_FUNC"},
    706 	{3, "STT_SECTION"},
    707 	{4, "STT_FILE"},
    708 	{5, "STT_COMMON"},
    709 	{6, "STT_TLS"},
    710 	{10, "STT_LOOS"},
    711 	{12, "STT_HIOS"},
    712 	{13, "STT_LOPROC"},
    713 	{15, "STT_HIPROC"},
    714 }
    715 
    716 func (i SymType) String() string   { return stringName(uint32(i), sttStrings, false) }
    717 func (i SymType) GoString() string { return stringName(uint32(i), sttStrings, true) }
    718 
    719 /* Symbol visibility - ELFNN_ST_VISIBILITY - st_other */
    720 type SymVis int
    721 
    722 const (
    723 	STV_DEFAULT   SymVis = 0x0 /* Default visibility (see binding). */
    724 	STV_INTERNAL  SymVis = 0x1 /* Special meaning in relocatable objects. */
    725 	STV_HIDDEN    SymVis = 0x2 /* Not visible. */
    726 	STV_PROTECTED SymVis = 0x3 /* Visible but not preemptible. */
    727 )
    728 
    729 var stvStrings = []intName{
    730 	{0x0, "STV_DEFAULT"},
    731 	{0x1, "STV_INTERNAL"},
    732 	{0x2, "STV_HIDDEN"},
    733 	{0x3, "STV_PROTECTED"},
    734 }
    735 
    736 func (i SymVis) String() string   { return stringName(uint32(i), stvStrings, false) }
    737 func (i SymVis) GoString() string { return stringName(uint32(i), stvStrings, true) }
    738 
    739 /*
    740  * Relocation types.
    741  */
    742 
    743 // Relocation types for x86-64.
    744 type R_X86_64 int
    745 
    746 const (
    747 	R_X86_64_NONE            R_X86_64 = 0  /* No relocation. */
    748 	R_X86_64_64              R_X86_64 = 1  /* Add 64 bit symbol value. */
    749 	R_X86_64_PC32            R_X86_64 = 2  /* PC-relative 32 bit signed sym value. */
    750 	R_X86_64_GOT32           R_X86_64 = 3  /* PC-relative 32 bit GOT offset. */
    751 	R_X86_64_PLT32           R_X86_64 = 4  /* PC-relative 32 bit PLT offset. */
    752 	R_X86_64_COPY            R_X86_64 = 5  /* Copy data from shared object. */
    753 	R_X86_64_GLOB_DAT        R_X86_64 = 6  /* Set GOT entry to data address. */
    754 	R_X86_64_JMP_SLOT        R_X86_64 = 7  /* Set GOT entry to code address. */
    755 	R_X86_64_RELATIVE        R_X86_64 = 8  /* Add load address of shared object. */
    756 	R_X86_64_GOTPCREL        R_X86_64 = 9  /* Add 32 bit signed pcrel offset to GOT. */
    757 	R_X86_64_32              R_X86_64 = 10 /* Add 32 bit zero extended symbol value */
    758 	R_X86_64_32S             R_X86_64 = 11 /* Add 32 bit sign extended symbol value */
    759 	R_X86_64_16              R_X86_64 = 12 /* Add 16 bit zero extended symbol value */
    760 	R_X86_64_PC16            R_X86_64 = 13 /* Add 16 bit signed extended pc relative symbol value */
    761 	R_X86_64_8               R_X86_64 = 14 /* Add 8 bit zero extended symbol value */
    762 	R_X86_64_PC8             R_X86_64 = 15 /* Add 8 bit signed extended pc relative symbol value */
    763 	R_X86_64_DTPMOD64        R_X86_64 = 16 /* ID of module containing symbol */
    764 	R_X86_64_DTPOFF64        R_X86_64 = 17 /* Offset in TLS block */
    765 	R_X86_64_TPOFF64         R_X86_64 = 18 /* Offset in static TLS block */
    766 	R_X86_64_TLSGD           R_X86_64 = 19 /* PC relative offset to GD GOT entry */
    767 	R_X86_64_TLSLD           R_X86_64 = 20 /* PC relative offset to LD GOT entry */
    768 	R_X86_64_DTPOFF32        R_X86_64 = 21 /* Offset in TLS block */
    769 	R_X86_64_GOTTPOFF        R_X86_64 = 22 /* PC relative offset to IE GOT entry */
    770 	R_X86_64_TPOFF32         R_X86_64 = 23 /* Offset in static TLS block */
    771 	R_X86_64_PC64            R_X86_64 = 24 /* PC relative 64-bit sign extended symbol value. */
    772 	R_X86_64_GOTOFF64        R_X86_64 = 25
    773 	R_X86_64_GOTPC32         R_X86_64 = 26
    774 	R_X86_64_GOT64           R_X86_64 = 27
    775 	R_X86_64_GOTPCREL64      R_X86_64 = 28
    776 	R_X86_64_GOTPC64         R_X86_64 = 29
    777 	R_X86_64_GOTPLT64        R_X86_64 = 30
    778 	R_X86_64_PLTOFF64        R_X86_64 = 31
    779 	R_X86_64_SIZE32          R_X86_64 = 32
    780 	R_X86_64_SIZE64          R_X86_64 = 33
    781 	R_X86_64_GOTPC32_TLSDESC R_X86_64 = 34
    782 	R_X86_64_TLSDESC_CALL    R_X86_64 = 35
    783 	R_X86_64_TLSDESC         R_X86_64 = 36
    784 	R_X86_64_IRELATIVE       R_X86_64 = 37
    785 	R_X86_64_RELATIVE64      R_X86_64 = 38
    786 	R_X86_64_PC32_BND        R_X86_64 = 39
    787 	R_X86_64_PLT32_BND       R_X86_64 = 40
    788 	R_X86_64_GOTPCRELX       R_X86_64 = 41
    789 	R_X86_64_REX_GOTPCRELX   R_X86_64 = 42
    790 )
    791 
    792 var rx86_64Strings = []intName{
    793 	{0, "R_X86_64_NONE"},
    794 	{1, "R_X86_64_64"},
    795 	{2, "R_X86_64_PC32"},
    796 	{3, "R_X86_64_GOT32"},
    797 	{4, "R_X86_64_PLT32"},
    798 	{5, "R_X86_64_COPY"},
    799 	{6, "R_X86_64_GLOB_DAT"},
    800 	{7, "R_X86_64_JMP_SLOT"},
    801 	{8, "R_X86_64_RELATIVE"},
    802 	{9, "R_X86_64_GOTPCREL"},
    803 	{10, "R_X86_64_32"},
    804 	{11, "R_X86_64_32S"},
    805 	{12, "R_X86_64_16"},
    806 	{13, "R_X86_64_PC16"},
    807 	{14, "R_X86_64_8"},
    808 	{15, "R_X86_64_PC8"},
    809 	{16, "R_X86_64_DTPMOD64"},
    810 	{17, "R_X86_64_DTPOFF64"},
    811 	{18, "R_X86_64_TPOFF64"},
    812 	{19, "R_X86_64_TLSGD"},
    813 	{20, "R_X86_64_TLSLD"},
    814 	{21, "R_X86_64_DTPOFF32"},
    815 	{22, "R_X86_64_GOTTPOFF"},
    816 	{23, "R_X86_64_TPOFF32"},
    817 	{24, "R_X86_64_PC64"},
    818 	{25, "R_X86_64_GOTOFF64"},
    819 	{26, "R_X86_64_GOTPC32"},
    820 	{27, "R_X86_64_GOT64"},
    821 	{28, "R_X86_64_GOTPCREL64"},
    822 	{29, "R_X86_64_GOTPC64"},
    823 	{30, "R_X86_64_GOTPLT64"},
    824 	{31, "R_X86_64_PLTOFF64"},
    825 	{32, "R_X86_64_SIZE32"},
    826 	{33, "R_X86_64_SIZE64"},
    827 	{34, "R_X86_64_GOTPC32_TLSDESC"},
    828 	{35, "R_X86_64_TLSDESC_CALL"},
    829 	{36, "R_X86_64_TLSDESC"},
    830 	{37, "R_X86_64_IRELATIVE"},
    831 	{38, "R_X86_64_RELATIVE64"},
    832 	{39, "R_X86_64_PC32_BND"},
    833 	{40, "R_X86_64_PLT32_BND"},
    834 	{41, "R_X86_64_GOTPCRELX"},
    835 	{42, "R_X86_64_REX_GOTPCRELX"},
    836 }
    837 
    838 func (i R_X86_64) String() string   { return stringName(uint32(i), rx86_64Strings, false) }
    839 func (i R_X86_64) GoString() string { return stringName(uint32(i), rx86_64Strings, true) }
    840 
    841 // Relocation types for AArch64 (aka arm64)
    842 type R_AARCH64 int
    843 
    844 const (
    845 	R_AARCH64_NONE                            R_AARCH64 = 0
    846 	R_AARCH64_P32_ABS32                       R_AARCH64 = 1
    847 	R_AARCH64_P32_ABS16                       R_AARCH64 = 2
    848 	R_AARCH64_P32_PREL32                      R_AARCH64 = 3
    849 	R_AARCH64_P32_PREL16                      R_AARCH64 = 4
    850 	R_AARCH64_P32_MOVW_UABS_G0                R_AARCH64 = 5
    851 	R_AARCH64_P32_MOVW_UABS_G0_NC             R_AARCH64 = 6
    852 	R_AARCH64_P32_MOVW_UABS_G1                R_AARCH64 = 7
    853 	R_AARCH64_P32_MOVW_SABS_G0                R_AARCH64 = 8
    854 	R_AARCH64_P32_LD_PREL_LO19                R_AARCH64 = 9
    855 	R_AARCH64_P32_ADR_PREL_LO21               R_AARCH64 = 10
    856 	R_AARCH64_P32_ADR_PREL_PG_HI21            R_AARCH64 = 11
    857 	R_AARCH64_P32_ADD_ABS_LO12_NC             R_AARCH64 = 12
    858 	R_AARCH64_P32_LDST8_ABS_LO12_NC           R_AARCH64 = 13
    859 	R_AARCH64_P32_LDST16_ABS_LO12_NC          R_AARCH64 = 14
    860 	R_AARCH64_P32_LDST32_ABS_LO12_NC          R_AARCH64 = 15
    861 	R_AARCH64_P32_LDST64_ABS_LO12_NC          R_AARCH64 = 16
    862 	R_AARCH64_P32_LDST128_ABS_LO12_NC         R_AARCH64 = 17
    863 	R_AARCH64_P32_TSTBR14                     R_AARCH64 = 18
    864 	R_AARCH64_P32_CONDBR19                    R_AARCH64 = 19
    865 	R_AARCH64_P32_JUMP26                      R_AARCH64 = 20
    866 	R_AARCH64_P32_CALL26                      R_AARCH64 = 21
    867 	R_AARCH64_P32_GOT_LD_PREL19               R_AARCH64 = 25
    868 	R_AARCH64_P32_ADR_GOT_PAGE                R_AARCH64 = 26
    869 	R_AARCH64_P32_LD32_GOT_LO12_NC            R_AARCH64 = 27
    870 	R_AARCH64_P32_TLSGD_ADR_PAGE21            R_AARCH64 = 81
    871 	R_AARCH64_P32_TLSGD_ADD_LO12_NC           R_AARCH64 = 82
    872 	R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21   R_AARCH64 = 103
    873 	R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC R_AARCH64 = 104
    874 	R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19    R_AARCH64 = 105
    875 	R_AARCH64_P32_TLSLE_MOVW_TPREL_G1         R_AARCH64 = 106
    876 	R_AARCH64_P32_TLSLE_MOVW_TPREL_G0         R_AARCH64 = 107
    877 	R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC      R_AARCH64 = 108
    878 	R_AARCH64_P32_TLSLE_ADD_TPREL_HI12        R_AARCH64 = 109
    879 	R_AARCH64_P32_TLSLE_ADD_TPREL_LO12        R_AARCH64 = 110
    880 	R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC     R_AARCH64 = 111
    881 	R_AARCH64_P32_TLSDESC_LD_PREL19           R_AARCH64 = 122
    882 	R_AARCH64_P32_TLSDESC_ADR_PREL21          R_AARCH64 = 123
    883 	R_AARCH64_P32_TLSDESC_ADR_PAGE21          R_AARCH64 = 124
    884 	R_AARCH64_P32_TLSDESC_LD32_LO12_NC        R_AARCH64 = 125
    885 	R_AARCH64_P32_TLSDESC_ADD_LO12_NC         R_AARCH64 = 126
    886 	R_AARCH64_P32_TLSDESC_CALL                R_AARCH64 = 127
    887 	R_AARCH64_P32_COPY                        R_AARCH64 = 180
    888 	R_AARCH64_P32_GLOB_DAT                    R_AARCH64 = 181
    889 	R_AARCH64_P32_JUMP_SLOT                   R_AARCH64 = 182
    890 	R_AARCH64_P32_RELATIVE                    R_AARCH64 = 183
    891 	R_AARCH64_P32_TLS_DTPMOD                  R_AARCH64 = 184
    892 	R_AARCH64_P32_TLS_DTPREL                  R_AARCH64 = 185
    893 	R_AARCH64_P32_TLS_TPREL                   R_AARCH64 = 186
    894 	R_AARCH64_P32_TLSDESC                     R_AARCH64 = 187
    895 	R_AARCH64_P32_IRELATIVE                   R_AARCH64 = 188
    896 	R_AARCH64_NULL                            R_AARCH64 = 256
    897 	R_AARCH64_ABS64                           R_AARCH64 = 257
    898 	R_AARCH64_ABS32                           R_AARCH64 = 258
    899 	R_AARCH64_ABS16                           R_AARCH64 = 259
    900 	R_AARCH64_PREL64                          R_AARCH64 = 260
    901 	R_AARCH64_PREL32                          R_AARCH64 = 261
    902 	R_AARCH64_PREL16                          R_AARCH64 = 262
    903 	R_AARCH64_MOVW_UABS_G0                    R_AARCH64 = 263
    904 	R_AARCH64_MOVW_UABS_G0_NC                 R_AARCH64 = 264
    905 	R_AARCH64_MOVW_UABS_G1                    R_AARCH64 = 265
    906 	R_AARCH64_MOVW_UABS_G1_NC                 R_AARCH64 = 266
    907 	R_AARCH64_MOVW_UABS_G2                    R_AARCH64 = 267
    908 	R_AARCH64_MOVW_UABS_G2_NC                 R_AARCH64 = 268
    909 	R_AARCH64_MOVW_UABS_G3                    R_AARCH64 = 269
    910 	R_AARCH64_MOVW_SABS_G0                    R_AARCH64 = 270
    911 	R_AARCH64_MOVW_SABS_G1                    R_AARCH64 = 271
    912 	R_AARCH64_MOVW_SABS_G2                    R_AARCH64 = 272
    913 	R_AARCH64_LD_PREL_LO19                    R_AARCH64 = 273
    914 	R_AARCH64_ADR_PREL_LO21                   R_AARCH64 = 274
    915 	R_AARCH64_ADR_PREL_PG_HI21                R_AARCH64 = 275
    916 	R_AARCH64_ADR_PREL_PG_HI21_NC             R_AARCH64 = 276
    917 	R_AARCH64_ADD_ABS_LO12_NC                 R_AARCH64 = 277
    918 	R_AARCH64_LDST8_ABS_LO12_NC               R_AARCH64 = 278
    919 	R_AARCH64_TSTBR14                         R_AARCH64 = 279
    920 	R_AARCH64_CONDBR19                        R_AARCH64 = 280
    921 	R_AARCH64_JUMP26                          R_AARCH64 = 282
    922 	R_AARCH64_CALL26                          R_AARCH64 = 283
    923 	R_AARCH64_LDST16_ABS_LO12_NC              R_AARCH64 = 284
    924 	R_AARCH64_LDST32_ABS_LO12_NC              R_AARCH64 = 285
    925 	R_AARCH64_LDST64_ABS_LO12_NC              R_AARCH64 = 286
    926 	R_AARCH64_LDST128_ABS_LO12_NC             R_AARCH64 = 299
    927 	R_AARCH64_GOT_LD_PREL19                   R_AARCH64 = 309
    928 	R_AARCH64_LD64_GOTOFF_LO15                R_AARCH64 = 310
    929 	R_AARCH64_ADR_GOT_PAGE                    R_AARCH64 = 311
    930 	R_AARCH64_LD64_GOT_LO12_NC                R_AARCH64 = 312
    931 	R_AARCH64_LD64_GOTPAGE_LO15               R_AARCH64 = 313
    932 	R_AARCH64_TLSGD_ADR_PREL21                R_AARCH64 = 512
    933 	R_AARCH64_TLSGD_ADR_PAGE21                R_AARCH64 = 513
    934 	R_AARCH64_TLSGD_ADD_LO12_NC               R_AARCH64 = 514
    935 	R_AARCH64_TLSGD_MOVW_G1                   R_AARCH64 = 515
    936 	R_AARCH64_TLSGD_MOVW_G0_NC                R_AARCH64 = 516
    937 	R_AARCH64_TLSLD_ADR_PREL21                R_AARCH64 = 517
    938 	R_AARCH64_TLSLD_ADR_PAGE21                R_AARCH64 = 518
    939 	R_AARCH64_TLSIE_MOVW_GOTTPREL_G1          R_AARCH64 = 539
    940 	R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC       R_AARCH64 = 540
    941 	R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21       R_AARCH64 = 541
    942 	R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC     R_AARCH64 = 542
    943 	R_AARCH64_TLSIE_LD_GOTTPREL_PREL19        R_AARCH64 = 543
    944 	R_AARCH64_TLSLE_MOVW_TPREL_G2             R_AARCH64 = 544
    945 	R_AARCH64_TLSLE_MOVW_TPREL_G1             R_AARCH64 = 545
    946 	R_AARCH64_TLSLE_MOVW_TPREL_G1_NC          R_AARCH64 = 546
    947 	R_AARCH64_TLSLE_MOVW_TPREL_G0             R_AARCH64 = 547
    948 	R_AARCH64_TLSLE_MOVW_TPREL_G0_NC          R_AARCH64 = 548
    949 	R_AARCH64_TLSLE_ADD_TPREL_HI12            R_AARCH64 = 549
    950 	R_AARCH64_TLSLE_ADD_TPREL_LO12            R_AARCH64 = 550
    951 	R_AARCH64_TLSLE_ADD_TPREL_LO12_NC         R_AARCH64 = 551
    952 	R_AARCH64_TLSDESC_LD_PREL19               R_AARCH64 = 560
    953 	R_AARCH64_TLSDESC_ADR_PREL21              R_AARCH64 = 561
    954 	R_AARCH64_TLSDESC_ADR_PAGE21              R_AARCH64 = 562
    955 	R_AARCH64_TLSDESC_LD64_LO12_NC            R_AARCH64 = 563
    956 	R_AARCH64_TLSDESC_ADD_LO12_NC             R_AARCH64 = 564
    957 	R_AARCH64_TLSDESC_OFF_G1                  R_AARCH64 = 565
    958 	R_AARCH64_TLSDESC_OFF_G0_NC               R_AARCH64 = 566
    959 	R_AARCH64_TLSDESC_LDR                     R_AARCH64 = 567
    960 	R_AARCH64_TLSDESC_ADD                     R_AARCH64 = 568
    961 	R_AARCH64_TLSDESC_CALL                    R_AARCH64 = 569
    962 	R_AARCH64_TLSLE_LDST128_TPREL_LO12        R_AARCH64 = 570
    963 	R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC     R_AARCH64 = 571
    964 	R_AARCH64_TLSLD_LDST128_DTPREL_LO12       R_AARCH64 = 572
    965 	R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC    R_AARCH64 = 573
    966 	R_AARCH64_COPY                            R_AARCH64 = 1024
    967 	R_AARCH64_GLOB_DAT                        R_AARCH64 = 1025
    968 	R_AARCH64_JUMP_SLOT                       R_AARCH64 = 1026
    969 	R_AARCH64_RELATIVE                        R_AARCH64 = 1027
    970 	R_AARCH64_TLS_DTPMOD64                    R_AARCH64 = 1028
    971 	R_AARCH64_TLS_DTPREL64                    R_AARCH64 = 1029
    972 	R_AARCH64_TLS_TPREL64                     R_AARCH64 = 1030
    973 	R_AARCH64_TLSDESC                         R_AARCH64 = 1031
    974 	R_AARCH64_IRELATIVE                       R_AARCH64 = 1032
    975 )
    976 
    977 var raarch64Strings = []intName{
    978 	{0, "R_AARCH64_NONE"},
    979 	{1, "R_AARCH64_P32_ABS32"},
    980 	{2, "R_AARCH64_P32_ABS16"},
    981 	{3, "R_AARCH64_P32_PREL32"},
    982 	{4, "R_AARCH64_P32_PREL16"},
    983 	{5, "R_AARCH64_P32_MOVW_UABS_G0"},
    984 	{6, "R_AARCH64_P32_MOVW_UABS_G0_NC"},
    985 	{7, "R_AARCH64_P32_MOVW_UABS_G1"},
    986 	{8, "R_AARCH64_P32_MOVW_SABS_G0"},
    987 	{9, "R_AARCH64_P32_LD_PREL_LO19"},
    988 	{10, "R_AARCH64_P32_ADR_PREL_LO21"},
    989 	{11, "R_AARCH64_P32_ADR_PREL_PG_HI21"},
    990 	{12, "R_AARCH64_P32_ADD_ABS_LO12_NC"},
    991 	{13, "R_AARCH64_P32_LDST8_ABS_LO12_NC"},
    992 	{14, "R_AARCH64_P32_LDST16_ABS_LO12_NC"},
    993 	{15, "R_AARCH64_P32_LDST32_ABS_LO12_NC"},
    994 	{16, "R_AARCH64_P32_LDST64_ABS_LO12_NC"},
    995 	{17, "R_AARCH64_P32_LDST128_ABS_LO12_NC"},
    996 	{18, "R_AARCH64_P32_TSTBR14"},
    997 	{19, "R_AARCH64_P32_CONDBR19"},
    998 	{20, "R_AARCH64_P32_JUMP26"},
    999 	{21, "R_AARCH64_P32_CALL26"},
   1000 	{25, "R_AARCH64_P32_GOT_LD_PREL19"},
   1001 	{26, "R_AARCH64_P32_ADR_GOT_PAGE"},
   1002 	{27, "R_AARCH64_P32_LD32_GOT_LO12_NC"},
   1003 	{81, "R_AARCH64_P32_TLSGD_ADR_PAGE21"},
   1004 	{82, "R_AARCH64_P32_TLSGD_ADD_LO12_NC"},
   1005 	{103, "R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21"},
   1006 	{104, "R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC"},
   1007 	{105, "R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19"},
   1008 	{106, "R_AARCH64_P32_TLSLE_MOVW_TPREL_G1"},
   1009 	{107, "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0"},
   1010 	{108, "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC"},
   1011 	{109, "R_AARCH64_P32_TLSLE_ADD_TPREL_HI12"},
   1012 	{110, "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12"},
   1013 	{111, "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC"},
   1014 	{122, "R_AARCH64_P32_TLSDESC_LD_PREL19"},
   1015 	{123, "R_AARCH64_P32_TLSDESC_ADR_PREL21"},
   1016 	{124, "R_AARCH64_P32_TLSDESC_ADR_PAGE21"},
   1017 	{125, "R_AARCH64_P32_TLSDESC_LD32_LO12_NC"},
   1018 	{126, "R_AARCH64_P32_TLSDESC_ADD_LO12_NC"},
   1019 	{127, "R_AARCH64_P32_TLSDESC_CALL"},
   1020 	{180, "R_AARCH64_P32_COPY"},
   1021 	{181, "R_AARCH64_P32_GLOB_DAT"},
   1022 	{182, "R_AARCH64_P32_JUMP_SLOT"},
   1023 	{183, "R_AARCH64_P32_RELATIVE"},
   1024 	{184, "R_AARCH64_P32_TLS_DTPMOD"},
   1025 	{185, "R_AARCH64_P32_TLS_DTPREL"},
   1026 	{186, "R_AARCH64_P32_TLS_TPREL"},
   1027 	{187, "R_AARCH64_P32_TLSDESC"},
   1028 	{188, "R_AARCH64_P32_IRELATIVE"},
   1029 	{256, "R_AARCH64_NULL"},
   1030 	{257, "R_AARCH64_ABS64"},
   1031 	{258, "R_AARCH64_ABS32"},
   1032 	{259, "R_AARCH64_ABS16"},
   1033 	{260, "R_AARCH64_PREL64"},
   1034 	{261, "R_AARCH64_PREL32"},
   1035 	{262, "R_AARCH64_PREL16"},
   1036 	{263, "R_AARCH64_MOVW_UABS_G0"},
   1037 	{264, "R_AARCH64_MOVW_UABS_G0_NC"},
   1038 	{265, "R_AARCH64_MOVW_UABS_G1"},
   1039 	{266, "R_AARCH64_MOVW_UABS_G1_NC"},
   1040 	{267, "R_AARCH64_MOVW_UABS_G2"},
   1041 	{268, "R_AARCH64_MOVW_UABS_G2_NC"},
   1042 	{269, "R_AARCH64_MOVW_UABS_G3"},
   1043 	{270, "R_AARCH64_MOVW_SABS_G0"},
   1044 	{271, "R_AARCH64_MOVW_SABS_G1"},
   1045 	{272, "R_AARCH64_MOVW_SABS_G2"},
   1046 	{273, "R_AARCH64_LD_PREL_LO19"},
   1047 	{274, "R_AARCH64_ADR_PREL_LO21"},
   1048 	{275, "R_AARCH64_ADR_PREL_PG_HI21"},
   1049 	{276, "R_AARCH64_ADR_PREL_PG_HI21_NC"},
   1050 	{277, "R_AARCH64_ADD_ABS_LO12_NC"},
   1051 	{278, "R_AARCH64_LDST8_ABS_LO12_NC"},
   1052 	{279, "R_AARCH64_TSTBR14"},
   1053 	{280, "R_AARCH64_CONDBR19"},
   1054 	{282, "R_AARCH64_JUMP26"},
   1055 	{283, "R_AARCH64_CALL26"},
   1056 	{284, "R_AARCH64_LDST16_ABS_LO12_NC"},
   1057 	{285, "R_AARCH64_LDST32_ABS_LO12_NC"},
   1058 	{286, "R_AARCH64_LDST64_ABS_LO12_NC"},
   1059 	{299, "R_AARCH64_LDST128_ABS_LO12_NC"},
   1060 	{309, "R_AARCH64_GOT_LD_PREL19"},
   1061 	{310, "R_AARCH64_LD64_GOTOFF_LO15"},
   1062 	{311, "R_AARCH64_ADR_GOT_PAGE"},
   1063 	{312, "R_AARCH64_LD64_GOT_LO12_NC"},
   1064 	{313, "R_AARCH64_LD64_GOTPAGE_LO15"},
   1065 	{512, "R_AARCH64_TLSGD_ADR_PREL21"},
   1066 	{513, "R_AARCH64_TLSGD_ADR_PAGE21"},
   1067 	{514, "R_AARCH64_TLSGD_ADD_LO12_NC"},
   1068 	{515, "R_AARCH64_TLSGD_MOVW_G1"},
   1069 	{516, "R_AARCH64_TLSGD_MOVW_G0_NC"},
   1070 	{517, "R_AARCH64_TLSLD_ADR_PREL21"},
   1071 	{518, "R_AARCH64_TLSLD_ADR_PAGE21"},
   1072 	{539, "R_AARCH64_TLSIE_MOVW_GOTTPREL_G1"},
   1073 	{540, "R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC"},
   1074 	{541, "R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21"},
   1075 	{542, "R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC"},
   1076 	{543, "R_AARCH64_TLSIE_LD_GOTTPREL_PREL19"},
   1077 	{544, "R_AARCH64_TLSLE_MOVW_TPREL_G2"},
   1078 	{545, "R_AARCH64_TLSLE_MOVW_TPREL_G1"},
   1079 	{546, "R_AARCH64_TLSLE_MOVW_TPREL_G1_NC"},
   1080 	{547, "R_AARCH64_TLSLE_MOVW_TPREL_G0"},
   1081 	{548, "R_AARCH64_TLSLE_MOVW_TPREL_G0_NC"},
   1082 	{549, "R_AARCH64_TLSLE_ADD_TPREL_HI12"},
   1083 	{550, "R_AARCH64_TLSLE_ADD_TPREL_LO12"},
   1084 	{551, "R_AARCH64_TLSLE_ADD_TPREL_LO12_NC"},
   1085 	{560, "R_AARCH64_TLSDESC_LD_PREL19"},
   1086 	{561, "R_AARCH64_TLSDESC_ADR_PREL21"},
   1087 	{562, "R_AARCH64_TLSDESC_ADR_PAGE21"},
   1088 	{563, "R_AARCH64_TLSDESC_LD64_LO12_NC"},
   1089 	{564, "R_AARCH64_TLSDESC_ADD_LO12_NC"},
   1090 	{565, "R_AARCH64_TLSDESC_OFF_G1"},
   1091 	{566, "R_AARCH64_TLSDESC_OFF_G0_NC"},
   1092 	{567, "R_AARCH64_TLSDESC_LDR"},
   1093 	{568, "R_AARCH64_TLSDESC_ADD"},
   1094 	{569, "R_AARCH64_TLSDESC_CALL"},
   1095 	{570, "R_AARCH64_TLSLE_LDST128_TPREL_LO12"},
   1096 	{571, "R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC"},
   1097 	{572, "R_AARCH64_TLSLD_LDST128_DTPREL_LO12"},
   1098 	{573, "R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC"},
   1099 	{1024, "R_AARCH64_COPY"},
   1100 	{1025, "R_AARCH64_GLOB_DAT"},
   1101 	{1026, "R_AARCH64_JUMP_SLOT"},
   1102 	{1027, "R_AARCH64_RELATIVE"},
   1103 	{1028, "R_AARCH64_TLS_DTPMOD64"},
   1104 	{1029, "R_AARCH64_TLS_DTPREL64"},
   1105 	{1030, "R_AARCH64_TLS_TPREL64"},
   1106 	{1031, "R_AARCH64_TLSDESC"},
   1107 	{1032, "R_AARCH64_IRELATIVE"},
   1108 }
   1109 
   1110 func (i R_AARCH64) String() string   { return stringName(uint32(i), raarch64Strings, false) }
   1111 func (i R_AARCH64) GoString() string { return stringName(uint32(i), raarch64Strings, true) }
   1112 
   1113 // Relocation types for Alpha.
   1114 type R_ALPHA int
   1115 
   1116 const (
   1117 	R_ALPHA_NONE           R_ALPHA = 0  /* No reloc */
   1118 	R_ALPHA_REFLONG        R_ALPHA = 1  /* Direct 32 bit */
   1119 	R_ALPHA_REFQUAD        R_ALPHA = 2  /* Direct 64 bit */
   1120 	R_ALPHA_GPREL32        R_ALPHA = 3  /* GP relative 32 bit */
   1121 	R_ALPHA_LITERAL        R_ALPHA = 4  /* GP relative 16 bit w/optimization */
   1122 	R_ALPHA_LITUSE         R_ALPHA = 5  /* Optimization hint for LITERAL */
   1123 	R_ALPHA_GPDISP         R_ALPHA = 6  /* Add displacement to GP */
   1124 	R_ALPHA_BRADDR         R_ALPHA = 7  /* PC+4 relative 23 bit shifted */
   1125 	R_ALPHA_HINT           R_ALPHA = 8  /* PC+4 relative 16 bit shifted */
   1126 	R_ALPHA_SREL16         R_ALPHA = 9  /* PC relative 16 bit */
   1127 	R_ALPHA_SREL32         R_ALPHA = 10 /* PC relative 32 bit */
   1128 	R_ALPHA_SREL64         R_ALPHA = 11 /* PC relative 64 bit */
   1129 	R_ALPHA_OP_PUSH        R_ALPHA = 12 /* OP stack push */
   1130 	R_ALPHA_OP_STORE       R_ALPHA = 13 /* OP stack pop and store */
   1131 	R_ALPHA_OP_PSUB        R_ALPHA = 14 /* OP stack subtract */
   1132 	R_ALPHA_OP_PRSHIFT     R_ALPHA = 15 /* OP stack right shift */
   1133 	R_ALPHA_GPVALUE        R_ALPHA = 16
   1134 	R_ALPHA_GPRELHIGH      R_ALPHA = 17
   1135 	R_ALPHA_GPRELLOW       R_ALPHA = 18
   1136 	R_ALPHA_IMMED_GP_16    R_ALPHA = 19
   1137 	R_ALPHA_IMMED_GP_HI32  R_ALPHA = 20
   1138 	R_ALPHA_IMMED_SCN_HI32 R_ALPHA = 21
   1139 	R_ALPHA_IMMED_BR_HI32  R_ALPHA = 22
   1140 	R_ALPHA_IMMED_LO32     R_ALPHA = 23
   1141 	R_ALPHA_COPY           R_ALPHA = 24 /* Copy symbol at runtime */
   1142 	R_ALPHA_GLOB_DAT       R_ALPHA = 25 /* Create GOT entry */
   1143 	R_ALPHA_JMP_SLOT       R_ALPHA = 26 /* Create PLT entry */
   1144 	R_ALPHA_RELATIVE       R_ALPHA = 27 /* Adjust by program base */
   1145 )
   1146 
   1147 var ralphaStrings = []intName{
   1148 	{0, "R_ALPHA_NONE"},
   1149 	{1, "R_ALPHA_REFLONG"},
   1150 	{2, "R_ALPHA_REFQUAD"},
   1151 	{3, "R_ALPHA_GPREL32"},
   1152 	{4, "R_ALPHA_LITERAL"},
   1153 	{5, "R_ALPHA_LITUSE"},
   1154 	{6, "R_ALPHA_GPDISP"},
   1155 	{7, "R_ALPHA_BRADDR"},
   1156 	{8, "R_ALPHA_HINT"},
   1157 	{9, "R_ALPHA_SREL16"},
   1158 	{10, "R_ALPHA_SREL32"},
   1159 	{11, "R_ALPHA_SREL64"},
   1160 	{12, "R_ALPHA_OP_PUSH"},
   1161 	{13, "R_ALPHA_OP_STORE"},
   1162 	{14, "R_ALPHA_OP_PSUB"},
   1163 	{15, "R_ALPHA_OP_PRSHIFT"},
   1164 	{16, "R_ALPHA_GPVALUE"},
   1165 	{17, "R_ALPHA_GPRELHIGH"},
   1166 	{18, "R_ALPHA_GPRELLOW"},
   1167 	{19, "R_ALPHA_IMMED_GP_16"},
   1168 	{20, "R_ALPHA_IMMED_GP_HI32"},
   1169 	{21, "R_ALPHA_IMMED_SCN_HI32"},
   1170 	{22, "R_ALPHA_IMMED_BR_HI32"},
   1171 	{23, "R_ALPHA_IMMED_LO32"},
   1172 	{24, "R_ALPHA_COPY"},
   1173 	{25, "R_ALPHA_GLOB_DAT"},
   1174 	{26, "R_ALPHA_JMP_SLOT"},
   1175 	{27, "R_ALPHA_RELATIVE"},
   1176 }
   1177 
   1178 func (i R_ALPHA) String() string   { return stringName(uint32(i), ralphaStrings, false) }
   1179 func (i R_ALPHA) GoString() string { return stringName(uint32(i), ralphaStrings, true) }
   1180 
   1181 // Relocation types for ARM.
   1182 type R_ARM int
   1183 
   1184 const (
   1185 	R_ARM_NONE               R_ARM = 0 /* No relocation. */
   1186 	R_ARM_PC24               R_ARM = 1
   1187 	R_ARM_ABS32              R_ARM = 2
   1188 	R_ARM_REL32              R_ARM = 3
   1189 	R_ARM_PC13               R_ARM = 4
   1190 	R_ARM_ABS16              R_ARM = 5
   1191 	R_ARM_ABS12              R_ARM = 6
   1192 	R_ARM_THM_ABS5           R_ARM = 7
   1193 	R_ARM_ABS8               R_ARM = 8
   1194 	R_ARM_SBREL32            R_ARM = 9
   1195 	R_ARM_THM_PC22           R_ARM = 10
   1196 	R_ARM_THM_PC8            R_ARM = 11
   1197 	R_ARM_AMP_VCALL9         R_ARM = 12
   1198 	R_ARM_SWI24              R_ARM = 13
   1199 	R_ARM_THM_SWI8           R_ARM = 14
   1200 	R_ARM_XPC25              R_ARM = 15
   1201 	R_ARM_THM_XPC22          R_ARM = 16
   1202 	R_ARM_TLS_DTPMOD32       R_ARM = 17
   1203 	R_ARM_TLS_DTPOFF32       R_ARM = 18
   1204 	R_ARM_TLS_TPOFF32        R_ARM = 19
   1205 	R_ARM_COPY               R_ARM = 20 /* Copy data from shared object. */
   1206 	R_ARM_GLOB_DAT           R_ARM = 21 /* Set GOT entry to data address. */
   1207 	R_ARM_JUMP_SLOT          R_ARM = 22 /* Set GOT entry to code address. */
   1208 	R_ARM_RELATIVE           R_ARM = 23 /* Add load address of shared object. */
   1209 	R_ARM_GOTOFF             R_ARM = 24 /* Add GOT-relative symbol address. */
   1210 	R_ARM_GOTPC              R_ARM = 25 /* Add PC-relative GOT table address. */
   1211 	R_ARM_GOT32              R_ARM = 26 /* Add PC-relative GOT offset. */
   1212 	R_ARM_PLT32              R_ARM = 27 /* Add PC-relative PLT offset. */
   1213 	R_ARM_CALL               R_ARM = 28
   1214 	R_ARM_JUMP24             R_ARM = 29
   1215 	R_ARM_THM_JUMP24         R_ARM = 30
   1216 	R_ARM_BASE_ABS           R_ARM = 31
   1217 	R_ARM_ALU_PCREL_7_0      R_ARM = 32
   1218 	R_ARM_ALU_PCREL_15_8     R_ARM = 33
   1219 	R_ARM_ALU_PCREL_23_15    R_ARM = 34
   1220 	R_ARM_LDR_SBREL_11_10_NC R_ARM = 35
   1221 	R_ARM_ALU_SBREL_19_12_NC R_ARM = 36
   1222 	R_ARM_ALU_SBREL_27_20_CK R_ARM = 37
   1223 	R_ARM_TARGET1            R_ARM = 38
   1224 	R_ARM_SBREL31            R_ARM = 39
   1225 	R_ARM_V4BX               R_ARM = 40
   1226 	R_ARM_TARGET2            R_ARM = 41
   1227 	R_ARM_PREL31             R_ARM = 42
   1228 	R_ARM_MOVW_ABS_NC        R_ARM = 43
   1229 	R_ARM_MOVT_ABS           R_ARM = 44
   1230 	R_ARM_MOVW_PREL_NC       R_ARM = 45
   1231 	R_ARM_MOVT_PREL          R_ARM = 46
   1232 	R_ARM_THM_MOVW_ABS_NC    R_ARM = 47
   1233 	R_ARM_THM_MOVT_ABS       R_ARM = 48
   1234 	R_ARM_THM_MOVW_PREL_NC   R_ARM = 49
   1235 	R_ARM_THM_MOVT_PREL      R_ARM = 50
   1236 	R_ARM_THM_JUMP19         R_ARM = 51
   1237 	R_ARM_THM_JUMP6          R_ARM = 52
   1238 	R_ARM_THM_ALU_PREL_11_0  R_ARM = 53
   1239 	R_ARM_THM_PC12           R_ARM = 54
   1240 	R_ARM_ABS32_NOI          R_ARM = 55
   1241 	R_ARM_REL32_NOI          R_ARM = 56
   1242 	R_ARM_ALU_PC_G0_NC       R_ARM = 57
   1243 	R_ARM_ALU_PC_G0          R_ARM = 58
   1244 	R_ARM_ALU_PC_G1_NC       R_ARM = 59
   1245 	R_ARM_ALU_PC_G1          R_ARM = 60
   1246 	R_ARM_ALU_PC_G2          R_ARM = 61
   1247 	R_ARM_LDR_PC_G1          R_ARM = 62
   1248 	R_ARM_LDR_PC_G2          R_ARM = 63
   1249 	R_ARM_LDRS_PC_G0         R_ARM = 64
   1250 	R_ARM_LDRS_PC_G1         R_ARM = 65
   1251 	R_ARM_LDRS_PC_G2         R_ARM = 66
   1252 	R_ARM_LDC_PC_G0          R_ARM = 67
   1253 	R_ARM_LDC_PC_G1          R_ARM = 68
   1254 	R_ARM_LDC_PC_G2          R_ARM = 69
   1255 	R_ARM_ALU_SB_G0_NC       R_ARM = 70
   1256 	R_ARM_ALU_SB_G0          R_ARM = 71
   1257 	R_ARM_ALU_SB_G1_NC       R_ARM = 72
   1258 	R_ARM_ALU_SB_G1          R_ARM = 73
   1259 	R_ARM_ALU_SB_G2          R_ARM = 74
   1260 	R_ARM_LDR_SB_G0          R_ARM = 75
   1261 	R_ARM_LDR_SB_G1          R_ARM = 76
   1262 	R_ARM_LDR_SB_G2          R_ARM = 77
   1263 	R_ARM_LDRS_SB_G0         R_ARM = 78
   1264 	R_ARM_LDRS_SB_G1         R_ARM = 79
   1265 	R_ARM_LDRS_SB_G2         R_ARM = 80
   1266 	R_ARM_LDC_SB_G0          R_ARM = 81
   1267 	R_ARM_LDC_SB_G1          R_ARM = 82
   1268 	R_ARM_LDC_SB_G2          R_ARM = 83
   1269 	R_ARM_MOVW_BREL_NC       R_ARM = 84
   1270 	R_ARM_MOVT_BREL          R_ARM = 85
   1271 	R_ARM_MOVW_BREL          R_ARM = 86
   1272 	R_ARM_THM_MOVW_BREL_NC   R_ARM = 87
   1273 	R_ARM_THM_MOVT_BREL      R_ARM = 88
   1274 	R_ARM_THM_MOVW_BREL      R_ARM = 89
   1275 	R_ARM_TLS_GOTDESC        R_ARM = 90
   1276 	R_ARM_TLS_CALL           R_ARM = 91
   1277 	R_ARM_TLS_DESCSEQ        R_ARM = 92
   1278 	R_ARM_THM_TLS_CALL       R_ARM = 93
   1279 	R_ARM_PLT32_ABS          R_ARM = 94
   1280 	R_ARM_GOT_ABS            R_ARM = 95
   1281 	R_ARM_GOT_PREL           R_ARM = 96
   1282 	R_ARM_GOT_BREL12         R_ARM = 97
   1283 	R_ARM_GOTOFF12           R_ARM = 98
   1284 	R_ARM_GOTRELAX           R_ARM = 99
   1285 	R_ARM_GNU_VTENTRY        R_ARM = 100
   1286 	R_ARM_GNU_VTINHERIT      R_ARM = 101
   1287 	R_ARM_THM_JUMP11         R_ARM = 102
   1288 	R_ARM_THM_JUMP8          R_ARM = 103
   1289 	R_ARM_TLS_GD32           R_ARM = 104
   1290 	R_ARM_TLS_LDM32          R_ARM = 105
   1291 	R_ARM_TLS_LDO32          R_ARM = 106
   1292 	R_ARM_TLS_IE32           R_ARM = 107
   1293 	R_ARM_TLS_LE32           R_ARM = 108
   1294 	R_ARM_TLS_LDO12          R_ARM = 109
   1295 	R_ARM_TLS_LE12           R_ARM = 110
   1296 	R_ARM_TLS_IE12GP         R_ARM = 111
   1297 	R_ARM_PRIVATE_0          R_ARM = 112
   1298 	R_ARM_PRIVATE_1          R_ARM = 113
   1299 	R_ARM_PRIVATE_2          R_ARM = 114
   1300 	R_ARM_PRIVATE_3          R_ARM = 115
   1301 	R_ARM_PRIVATE_4          R_ARM = 116
   1302 	R_ARM_PRIVATE_5          R_ARM = 117
   1303 	R_ARM_PRIVATE_6          R_ARM = 118
   1304 	R_ARM_PRIVATE_7          R_ARM = 119
   1305 	R_ARM_PRIVATE_8          R_ARM = 120
   1306 	R_ARM_PRIVATE_9          R_ARM = 121
   1307 	R_ARM_PRIVATE_10         R_ARM = 122
   1308 	R_ARM_PRIVATE_11         R_ARM = 123
   1309 	R_ARM_PRIVATE_12         R_ARM = 124
   1310 	R_ARM_PRIVATE_13         R_ARM = 125
   1311 	R_ARM_PRIVATE_14         R_ARM = 126
   1312 	R_ARM_PRIVATE_15         R_ARM = 127
   1313 	R_ARM_ME_TOO             R_ARM = 128
   1314 	R_ARM_THM_TLS_DESCSEQ16  R_ARM = 129
   1315 	R_ARM_THM_TLS_DESCSEQ32  R_ARM = 130
   1316 	R_ARM_THM_GOT_BREL12     R_ARM = 131
   1317 	R_ARM_THM_ALU_ABS_G0_NC  R_ARM = 132
   1318 	R_ARM_THM_ALU_ABS_G1_NC  R_ARM = 133
   1319 	R_ARM_THM_ALU_ABS_G2_NC  R_ARM = 134
   1320 	R_ARM_THM_ALU_ABS_G3     R_ARM = 135
   1321 	R_ARM_IRELATIVE          R_ARM = 160
   1322 	R_ARM_RXPC25             R_ARM = 249
   1323 	R_ARM_RSBREL32           R_ARM = 250
   1324 	R_ARM_THM_RPC22          R_ARM = 251
   1325 	R_ARM_RREL32             R_ARM = 252
   1326 	R_ARM_RABS32             R_ARM = 253
   1327 	R_ARM_RPC24              R_ARM = 254
   1328 	R_ARM_RBASE              R_ARM = 255
   1329 )
   1330 
   1331 var rarmStrings = []intName{
   1332 	{0, "R_ARM_NONE"},
   1333 	{1, "R_ARM_PC24"},
   1334 	{2, "R_ARM_ABS32"},
   1335 	{3, "R_ARM_REL32"},
   1336 	{4, "R_ARM_PC13"},
   1337 	{5, "R_ARM_ABS16"},
   1338 	{6, "R_ARM_ABS12"},
   1339 	{7, "R_ARM_THM_ABS5"},
   1340 	{8, "R_ARM_ABS8"},
   1341 	{9, "R_ARM_SBREL32"},
   1342 	{10, "R_ARM_THM_PC22"},
   1343 	{11, "R_ARM_THM_PC8"},
   1344 	{12, "R_ARM_AMP_VCALL9"},
   1345 	{13, "R_ARM_SWI24"},
   1346 	{14, "R_ARM_THM_SWI8"},
   1347 	{15, "R_ARM_XPC25"},
   1348 	{16, "R_ARM_THM_XPC22"},
   1349 	{17, "R_ARM_TLS_DTPMOD32"},
   1350 	{18, "R_ARM_TLS_DTPOFF32"},
   1351 	{19, "R_ARM_TLS_TPOFF32"},
   1352 	{20, "R_ARM_COPY"},
   1353 	{21, "R_ARM_GLOB_DAT"},
   1354 	{22, "R_ARM_JUMP_SLOT"},
   1355 	{23, "R_ARM_RELATIVE"},
   1356 	{24, "R_ARM_GOTOFF"},
   1357 	{25, "R_ARM_GOTPC"},
   1358 	{26, "R_ARM_GOT32"},
   1359 	{27, "R_ARM_PLT32"},
   1360 	{28, "R_ARM_CALL"},
   1361 	{29, "R_ARM_JUMP24"},
   1362 	{30, "R_ARM_THM_JUMP24"},
   1363 	{31, "R_ARM_BASE_ABS"},
   1364 	{32, "R_ARM_ALU_PCREL_7_0"},
   1365 	{33, "R_ARM_ALU_PCREL_15_8"},
   1366 	{34, "R_ARM_ALU_PCREL_23_15"},
   1367 	{35, "R_ARM_LDR_SBREL_11_10_NC"},
   1368 	{36, "R_ARM_ALU_SBREL_19_12_NC"},
   1369 	{37, "R_ARM_ALU_SBREL_27_20_CK"},
   1370 	{38, "R_ARM_TARGET1"},
   1371 	{39, "R_ARM_SBREL31"},
   1372 	{40, "R_ARM_V4BX"},
   1373 	{41, "R_ARM_TARGET2"},
   1374 	{42, "R_ARM_PREL31"},
   1375 	{43, "R_ARM_MOVW_ABS_NC"},
   1376 	{44, "R_ARM_MOVT_ABS"},
   1377 	{45, "R_ARM_MOVW_PREL_NC"},
   1378 	{46, "R_ARM_MOVT_PREL"},
   1379 	{47, "R_ARM_THM_MOVW_ABS_NC"},
   1380 	{48, "R_ARM_THM_MOVT_ABS"},
   1381 	{49, "R_ARM_THM_MOVW_PREL_NC"},
   1382 	{50, "R_ARM_THM_MOVT_PREL"},
   1383 	{51, "R_ARM_THM_JUMP19"},
   1384 	{52, "R_ARM_THM_JUMP6"},
   1385 	{53, "R_ARM_THM_ALU_PREL_11_0"},
   1386 	{54, "R_ARM_THM_PC12"},
   1387 	{55, "R_ARM_ABS32_NOI"},
   1388 	{56, "R_ARM_REL32_NOI"},
   1389 	{57, "R_ARM_ALU_PC_G0_NC"},
   1390 	{58, "R_ARM_ALU_PC_G0"},
   1391 	{59, "R_ARM_ALU_PC_G1_NC"},
   1392 	{60, "R_ARM_ALU_PC_G1"},
   1393 	{61, "R_ARM_ALU_PC_G2"},
   1394 	{62, "R_ARM_LDR_PC_G1"},
   1395 	{63, "R_ARM_LDR_PC_G2"},
   1396 	{64, "R_ARM_LDRS_PC_G0"},
   1397 	{65, "R_ARM_LDRS_PC_G1"},
   1398 	{66, "R_ARM_LDRS_PC_G2"},
   1399 	{67, "R_ARM_LDC_PC_G0"},
   1400 	{68, "R_ARM_LDC_PC_G1"},
   1401 	{69, "R_ARM_LDC_PC_G2"},
   1402 	{70, "R_ARM_ALU_SB_G0_NC"},
   1403 	{71, "R_ARM_ALU_SB_G0"},
   1404 	{72, "R_ARM_ALU_SB_G1_NC"},
   1405 	{73, "R_ARM_ALU_SB_G1"},
   1406 	{74, "R_ARM_ALU_SB_G2"},
   1407 	{75, "R_ARM_LDR_SB_G0"},
   1408 	{76, "R_ARM_LDR_SB_G1"},
   1409 	{77, "R_ARM_LDR_SB_G2"},
   1410 	{78, "R_ARM_LDRS_SB_G0"},
   1411 	{79, "R_ARM_LDRS_SB_G1"},
   1412 	{80, "R_ARM_LDRS_SB_G2"},
   1413 	{81, "R_ARM_LDC_SB_G0"},
   1414 	{82, "R_ARM_LDC_SB_G1"},
   1415 	{83, "R_ARM_LDC_SB_G2"},
   1416 	{84, "R_ARM_MOVW_BREL_NC"},
   1417 	{85, "R_ARM_MOVT_BREL"},
   1418 	{86, "R_ARM_MOVW_BREL"},
   1419 	{87, "R_ARM_THM_MOVW_BREL_NC"},
   1420 	{88, "R_ARM_THM_MOVT_BREL"},
   1421 	{89, "R_ARM_THM_MOVW_BREL"},
   1422 	{90, "R_ARM_TLS_GOTDESC"},
   1423 	{91, "R_ARM_TLS_CALL"},
   1424 	{92, "R_ARM_TLS_DESCSEQ"},
   1425 	{93, "R_ARM_THM_TLS_CALL"},
   1426 	{94, "R_ARM_PLT32_ABS"},
   1427 	{95, "R_ARM_GOT_ABS"},
   1428 	{96, "R_ARM_GOT_PREL"},
   1429 	{97, "R_ARM_GOT_BREL12"},
   1430 	{98, "R_ARM_GOTOFF12"},
   1431 	{99, "R_ARM_GOTRELAX"},
   1432 	{100, "R_ARM_GNU_VTENTRY"},
   1433 	{101, "R_ARM_GNU_VTINHERIT"},
   1434 	{102, "R_ARM_THM_JUMP11"},
   1435 	{103, "R_ARM_THM_JUMP8"},
   1436 	{104, "R_ARM_TLS_GD32"},
   1437 	{105, "R_ARM_TLS_LDM32"},
   1438 	{106, "R_ARM_TLS_LDO32"},
   1439 	{107, "R_ARM_TLS_IE32"},
   1440 	{108, "R_ARM_TLS_LE32"},
   1441 	{109, "R_ARM_TLS_LDO12"},
   1442 	{110, "R_ARM_TLS_LE12"},
   1443 	{111, "R_ARM_TLS_IE12GP"},
   1444 	{112, "R_ARM_PRIVATE_0"},
   1445 	{113, "R_ARM_PRIVATE_1"},
   1446 	{114, "R_ARM_PRIVATE_2"},
   1447 	{115, "R_ARM_PRIVATE_3"},
   1448 	{116, "R_ARM_PRIVATE_4"},
   1449 	{117, "R_ARM_PRIVATE_5"},
   1450 	{118, "R_ARM_PRIVATE_6"},
   1451 	{119, "R_ARM_PRIVATE_7"},
   1452 	{120, "R_ARM_PRIVATE_8"},
   1453 	{121, "R_ARM_PRIVATE_9"},
   1454 	{122, "R_ARM_PRIVATE_10"},
   1455 	{123, "R_ARM_PRIVATE_11"},
   1456 	{124, "R_ARM_PRIVATE_12"},
   1457 	{125, "R_ARM_PRIVATE_13"},
   1458 	{126, "R_ARM_PRIVATE_14"},
   1459 	{127, "R_ARM_PRIVATE_15"},
   1460 	{128, "R_ARM_ME_TOO"},
   1461 	{129, "R_ARM_THM_TLS_DESCSEQ16"},
   1462 	{130, "R_ARM_THM_TLS_DESCSEQ32"},
   1463 	{131, "R_ARM_THM_GOT_BREL12"},
   1464 	{132, "R_ARM_THM_ALU_ABS_G0_NC"},
   1465 	{133, "R_ARM_THM_ALU_ABS_G1_NC"},
   1466 	{134, "R_ARM_THM_ALU_ABS_G2_NC"},
   1467 	{135, "R_ARM_THM_ALU_ABS_G3"},
   1468 	{160, "R_ARM_IRELATIVE"},
   1469 	{249, "R_ARM_RXPC25"},
   1470 	{250, "R_ARM_RSBREL32"},
   1471 	{251, "R_ARM_THM_RPC22"},
   1472 	{252, "R_ARM_RREL32"},
   1473 	{253, "R_ARM_RABS32"},
   1474 	{254, "R_ARM_RPC24"},
   1475 	{255, "R_ARM_RBASE"},
   1476 }
   1477 
   1478 func (i R_ARM) String() string   { return stringName(uint32(i), rarmStrings, false) }
   1479 func (i R_ARM) GoString() string { return stringName(uint32(i), rarmStrings, true) }
   1480 
   1481 // Relocation types for 386.
   1482 type R_386 int
   1483 
   1484 const (
   1485 	R_386_NONE          R_386 = 0  /* No relocation. */
   1486 	R_386_32            R_386 = 1  /* Add symbol value. */
   1487 	R_386_PC32          R_386 = 2  /* Add PC-relative symbol value. */
   1488 	R_386_GOT32         R_386 = 3  /* Add PC-relative GOT offset. */
   1489 	R_386_PLT32         R_386 = 4  /* Add PC-relative PLT offset. */
   1490 	R_386_COPY          R_386 = 5  /* Copy data from shared object. */
   1491 	R_386_GLOB_DAT      R_386 = 6  /* Set GOT entry to data address. */
   1492 	R_386_JMP_SLOT      R_386 = 7  /* Set GOT entry to code address. */
   1493 	R_386_RELATIVE      R_386 = 8  /* Add load address of shared object. */
   1494 	R_386_GOTOFF        R_386 = 9  /* Add GOT-relative symbol address. */
   1495 	R_386_GOTPC         R_386 = 10 /* Add PC-relative GOT table address. */
   1496 	R_386_32PLT         R_386 = 11
   1497 	R_386_TLS_TPOFF     R_386 = 14 /* Negative offset in static TLS block */
   1498 	R_386_TLS_IE        R_386 = 15 /* Absolute address of GOT for -ve static TLS */
   1499 	R_386_TLS_GOTIE     R_386 = 16 /* GOT entry for negative static TLS block */
   1500 	R_386_TLS_LE        R_386 = 17 /* Negative offset relative to static TLS */
   1501 	R_386_TLS_GD        R_386 = 18 /* 32 bit offset to GOT (index,off) pair */
   1502 	R_386_TLS_LDM       R_386 = 19 /* 32 bit offset to GOT (index,zero) pair */
   1503 	R_386_16            R_386 = 20
   1504 	R_386_PC16          R_386 = 21
   1505 	R_386_8             R_386 = 22
   1506 	R_386_PC8           R_386 = 23
   1507 	R_386_TLS_GD_32     R_386 = 24 /* 32 bit offset to GOT (index,off) pair */
   1508 	R_386_TLS_GD_PUSH   R_386 = 25 /* pushl instruction for Sun ABI GD sequence */
   1509 	R_386_TLS_GD_CALL   R_386 = 26 /* call instruction for Sun ABI GD sequence */
   1510 	R_386_TLS_GD_POP    R_386 = 27 /* popl instruction for Sun ABI GD sequence */
   1511 	R_386_TLS_LDM_32    R_386 = 28 /* 32 bit offset to GOT (index,zero) pair */
   1512 	R_386_TLS_LDM_PUSH  R_386 = 29 /* pushl instruction for Sun ABI LD sequence */
   1513 	R_386_TLS_LDM_CALL  R_386 = 30 /* call instruction for Sun ABI LD sequence */
   1514 	R_386_TLS_LDM_POP   R_386 = 31 /* popl instruction for Sun ABI LD sequence */
   1515 	R_386_TLS_LDO_32    R_386 = 32 /* 32 bit offset from start of TLS block */
   1516 	R_386_TLS_IE_32     R_386 = 33 /* 32 bit offset to GOT static TLS offset entry */
   1517 	R_386_TLS_LE_32     R_386 = 34 /* 32 bit offset within static TLS block */
   1518 	R_386_TLS_DTPMOD32  R_386 = 35 /* GOT entry containing TLS index */
   1519 	R_386_TLS_DTPOFF32  R_386 = 36 /* GOT entry containing TLS offset */
   1520 	R_386_TLS_TPOFF32   R_386 = 37 /* GOT entry of -ve static TLS offset */
   1521 	R_386_SIZE32        R_386 = 38
   1522 	R_386_TLS_GOTDESC   R_386 = 39
   1523 	R_386_TLS_DESC_CALL R_386 = 40
   1524 	R_386_TLS_DESC      R_386 = 41
   1525 	R_386_IRELATIVE     R_386 = 42
   1526 	R_386_GOT32X        R_386 = 43
   1527 )
   1528 
   1529 var r386Strings = []intName{
   1530 	{0, "R_386_NONE"},
   1531 	{1, "R_386_32"},
   1532 	{2, "R_386_PC32"},
   1533 	{3, "R_386_GOT32"},
   1534 	{4, "R_386_PLT32"},
   1535 	{5, "R_386_COPY"},
   1536 	{6, "R_386_GLOB_DAT"},
   1537 	{7, "R_386_JMP_SLOT"},
   1538 	{8, "R_386_RELATIVE"},
   1539 	{9, "R_386_GOTOFF"},
   1540 	{10, "R_386_GOTPC"},
   1541 	{11, "R_386_32PLT"},
   1542 	{14, "R_386_TLS_TPOFF"},
   1543 	{15, "R_386_TLS_IE"},
   1544 	{16, "R_386_TLS_GOTIE"},
   1545 	{17, "R_386_TLS_LE"},
   1546 	{18, "R_386_TLS_GD"},
   1547 	{19, "R_386_TLS_LDM"},
   1548 	{20, "R_386_16"},
   1549 	{21, "R_386_PC16"},
   1550 	{22, "R_386_8"},
   1551 	{23, "R_386_PC8"},
   1552 	{24, "R_386_TLS_GD_32"},
   1553 	{25, "R_386_TLS_GD_PUSH"},
   1554 	{26, "R_386_TLS_GD_CALL"},
   1555 	{27, "R_386_TLS_GD_POP"},
   1556 	{28, "R_386_TLS_LDM_32"},
   1557 	{29, "R_386_TLS_LDM_PUSH"},
   1558 	{30, "R_386_TLS_LDM_CALL"},
   1559 	{31, "R_386_TLS_LDM_POP"},
   1560 	{32, "R_386_TLS_LDO_32"},
   1561 	{33, "R_386_TLS_IE_32"},
   1562 	{34, "R_386_TLS_LE_32"},
   1563 	{35, "R_386_TLS_DTPMOD32"},
   1564 	{36, "R_386_TLS_DTPOFF32"},
   1565 	{37, "R_386_TLS_TPOFF32"},
   1566 	{38, "R_386_SIZE32"},
   1567 	{39, "R_386_TLS_GOTDESC"},
   1568 	{40, "R_386_TLS_DESC_CALL"},
   1569 	{41, "R_386_TLS_DESC"},
   1570 	{42, "R_386_IRELATIVE"},
   1571 	{43, "R_386_GOT32X"},
   1572 }
   1573 
   1574 func (i R_386) String() string   { return stringName(uint32(i), r386Strings, false) }
   1575 func (i R_386) GoString() string { return stringName(uint32(i), r386Strings, true) }
   1576 
   1577 // Relocation types for MIPS.
   1578 type R_MIPS int
   1579 
   1580 const (
   1581 	R_MIPS_NONE          R_MIPS = 0
   1582 	R_MIPS_16            R_MIPS = 1
   1583 	R_MIPS_32            R_MIPS = 2
   1584 	R_MIPS_REL32         R_MIPS = 3
   1585 	R_MIPS_26            R_MIPS = 4
   1586 	R_MIPS_HI16          R_MIPS = 5  /* high 16 bits of symbol value */
   1587 	R_MIPS_LO16          R_MIPS = 6  /* low 16 bits of symbol value */
   1588 	R_MIPS_GPREL16       R_MIPS = 7  /* GP-relative reference  */
   1589 	R_MIPS_LITERAL       R_MIPS = 8  /* Reference to literal section  */
   1590 	R_MIPS_GOT16         R_MIPS = 9  /* Reference to global offset table */
   1591 	R_MIPS_PC16          R_MIPS = 10 /* 16 bit PC relative reference */
   1592 	R_MIPS_CALL16        R_MIPS = 11 /* 16 bit call through glbl offset tbl */
   1593 	R_MIPS_GPREL32       R_MIPS = 12
   1594 	R_MIPS_SHIFT5        R_MIPS = 16
   1595 	R_MIPS_SHIFT6        R_MIPS = 17
   1596 	R_MIPS_64            R_MIPS = 18
   1597 	R_MIPS_GOT_DISP      R_MIPS = 19
   1598 	R_MIPS_GOT_PAGE      R_MIPS = 20
   1599 	R_MIPS_GOT_OFST      R_MIPS = 21
   1600 	R_MIPS_GOT_HI16      R_MIPS = 22
   1601 	R_MIPS_GOT_LO16      R_MIPS = 23
   1602 	R_MIPS_SUB           R_MIPS = 24
   1603 	R_MIPS_INSERT_A      R_MIPS = 25
   1604 	R_MIPS_INSERT_B      R_MIPS = 26
   1605 	R_MIPS_DELETE        R_MIPS = 27
   1606 	R_MIPS_HIGHER        R_MIPS = 28
   1607 	R_MIPS_HIGHEST       R_MIPS = 29
   1608 	R_MIPS_CALL_HI16     R_MIPS = 30
   1609 	R_MIPS_CALL_LO16     R_MIPS = 31
   1610 	R_MIPS_SCN_DISP      R_MIPS = 32
   1611 	R_MIPS_REL16         R_MIPS = 33
   1612 	R_MIPS_ADD_IMMEDIATE R_MIPS = 34
   1613 	R_MIPS_PJUMP         R_MIPS = 35
   1614 	R_MIPS_RELGOT        R_MIPS = 36
   1615 	R_MIPS_JALR          R_MIPS = 37
   1616 
   1617 	R_MIPS_TLS_DTPMOD32    R_MIPS = 38 /* Module number 32 bit */
   1618 	R_MIPS_TLS_DTPREL32    R_MIPS = 39 /* Module-relative offset 32 bit */
   1619 	R_MIPS_TLS_DTPMOD64    R_MIPS = 40 /* Module number 64 bit */
   1620 	R_MIPS_TLS_DTPREL64    R_MIPS = 41 /* Module-relative offset 64 bit */
   1621 	R_MIPS_TLS_GD          R_MIPS = 42 /* 16 bit GOT offset for GD */
   1622 	R_MIPS_TLS_LDM         R_MIPS = 43 /* 16 bit GOT offset for LDM */
   1623 	R_MIPS_TLS_DTPREL_HI16 R_MIPS = 44 /* Module-relative offset, high 16 bits */
   1624 	R_MIPS_TLS_DTPREL_LO16 R_MIPS = 45 /* Module-relative offset, low 16 bits */
   1625 	R_MIPS_TLS_GOTTPREL    R_MIPS = 46 /* 16 bit GOT offset for IE */
   1626 	R_MIPS_TLS_TPREL32     R_MIPS = 47 /* TP-relative offset, 32 bit */
   1627 	R_MIPS_TLS_TPREL64     R_MIPS = 48 /* TP-relative offset, 64 bit */
   1628 	R_MIPS_TLS_TPREL_HI16  R_MIPS = 49 /* TP-relative offset, high 16 bits */
   1629 	R_MIPS_TLS_TPREL_LO16  R_MIPS = 50 /* TP-relative offset, low 16 bits */
   1630 )
   1631 
   1632 var rmipsStrings = []intName{
   1633 	{0, "R_MIPS_NONE"},
   1634 	{1, "R_MIPS_16"},
   1635 	{2, "R_MIPS_32"},
   1636 	{3, "R_MIPS_REL32"},
   1637 	{4, "R_MIPS_26"},
   1638 	{5, "R_MIPS_HI16"},
   1639 	{6, "R_MIPS_LO16"},
   1640 	{7, "R_MIPS_GPREL16"},
   1641 	{8, "R_MIPS_LITERAL"},
   1642 	{9, "R_MIPS_GOT16"},
   1643 	{10, "R_MIPS_PC16"},
   1644 	{11, "R_MIPS_CALL16"},
   1645 	{12, "R_MIPS_GPREL32"},
   1646 	{16, "R_MIPS_SHIFT5"},
   1647 	{17, "R_MIPS_SHIFT6"},
   1648 	{18, "R_MIPS_64"},
   1649 	{19, "R_MIPS_GOT_DISP"},
   1650 	{20, "R_MIPS_GOT_PAGE"},
   1651 	{21, "R_MIPS_GOT_OFST"},
   1652 	{22, "R_MIPS_GOT_HI16"},
   1653 	{23, "R_MIPS_GOT_LO16"},
   1654 	{24, "R_MIPS_SUB"},
   1655 	{25, "R_MIPS_INSERT_A"},
   1656 	{26, "R_MIPS_INSERT_B"},
   1657 	{27, "R_MIPS_DELETE"},
   1658 	{28, "R_MIPS_HIGHER"},
   1659 	{29, "R_MIPS_HIGHEST"},
   1660 	{30, "R_MIPS_CALL_HI16"},
   1661 	{31, "R_MIPS_CALL_LO16"},
   1662 	{32, "R_MIPS_SCN_DISP"},
   1663 	{33, "R_MIPS_REL16"},
   1664 	{34, "R_MIPS_ADD_IMMEDIATE"},
   1665 	{35, "R_MIPS_PJUMP"},
   1666 	{36, "R_MIPS_RELGOT"},
   1667 	{37, "R_MIPS_JALR"},
   1668 	{38, "R_MIPS_TLS_DTPMOD32"},
   1669 	{39, "R_MIPS_TLS_DTPREL32"},
   1670 	{40, "R_MIPS_TLS_DTPMOD64"},
   1671 	{41, "R_MIPS_TLS_DTPREL64"},
   1672 	{42, "R_MIPS_TLS_GD"},
   1673 	{43, "R_MIPS_TLS_LDM"},
   1674 	{44, "R_MIPS_TLS_DTPREL_HI16"},
   1675 	{45, "R_MIPS_TLS_DTPREL_LO16"},
   1676 	{46, "R_MIPS_TLS_GOTTPREL"},
   1677 	{47, "R_MIPS_TLS_TPREL32"},
   1678 	{48, "R_MIPS_TLS_TPREL64"},
   1679 	{49, "R_MIPS_TLS_TPREL_HI16"},
   1680 	{50, "R_MIPS_TLS_TPREL_LO16"},
   1681 }
   1682 
   1683 func (i R_MIPS) String() string   { return stringName(uint32(i), rmipsStrings, false) }
   1684 func (i R_MIPS) GoString() string { return stringName(uint32(i), rmipsStrings, true) }
   1685 
   1686 // Relocation types for PowerPC.
   1687 //
   1688 // Values that are shared by both R_PPC and R_PPC64 are prefixed with
   1689 // R_POWERPC_ in the ELF standard. For the R_PPC type, the relevant
   1690 // shared relocations have been renamed with the prefix R_PPC_.
   1691 // The original name follows the value in a comment.
   1692 type R_PPC int
   1693 
   1694 const (
   1695 	R_PPC_NONE            R_PPC = 0  // R_POWERPC_NONE
   1696 	R_PPC_ADDR32          R_PPC = 1  // R_POWERPC_ADDR32
   1697 	R_PPC_ADDR24          R_PPC = 2  // R_POWERPC_ADDR24
   1698 	R_PPC_ADDR16          R_PPC = 3  // R_POWERPC_ADDR16
   1699 	R_PPC_ADDR16_LO       R_PPC = 4  // R_POWERPC_ADDR16_LO
   1700 	R_PPC_ADDR16_HI       R_PPC = 5  // R_POWERPC_ADDR16_HI
   1701 	R_PPC_ADDR16_HA       R_PPC = 6  // R_POWERPC_ADDR16_HA
   1702 	R_PPC_ADDR14          R_PPC = 7  // R_POWERPC_ADDR14
   1703 	R_PPC_ADDR14_BRTAKEN  R_PPC = 8  // R_POWERPC_ADDR14_BRTAKEN
   1704 	R_PPC_ADDR14_BRNTAKEN R_PPC = 9  // R_POWERPC_ADDR14_BRNTAKEN
   1705 	R_PPC_REL24           R_PPC = 10 // R_POWERPC_REL24
   1706 	R_PPC_REL14           R_PPC = 11 // R_POWERPC_REL14
   1707 	R_PPC_REL14_BRTAKEN   R_PPC = 12 // R_POWERPC_REL14_BRTAKEN
   1708 	R_PPC_REL14_BRNTAKEN  R_PPC = 13 // R_POWERPC_REL14_BRNTAKEN
   1709 	R_PPC_GOT16           R_PPC = 14 // R_POWERPC_GOT16
   1710 	R_PPC_GOT16_LO        R_PPC = 15 // R_POWERPC_GOT16_LO
   1711 	R_PPC_GOT16_HI        R_PPC = 16 // R_POWERPC_GOT16_HI
   1712 	R_PPC_GOT16_HA        R_PPC = 17 // R_POWERPC_GOT16_HA
   1713 	R_PPC_PLTREL24        R_PPC = 18
   1714 	R_PPC_COPY            R_PPC = 19 // R_POWERPC_COPY
   1715 	R_PPC_GLOB_DAT        R_PPC = 20 // R_POWERPC_GLOB_DAT
   1716 	R_PPC_JMP_SLOT        R_PPC = 21 // R_POWERPC_JMP_SLOT
   1717 	R_PPC_RELATIVE        R_PPC = 22 // R_POWERPC_RELATIVE
   1718 	R_PPC_LOCAL24PC       R_PPC = 23
   1719 	R_PPC_UADDR32         R_PPC = 24 // R_POWERPC_UADDR32
   1720 	R_PPC_UADDR16         R_PPC = 25 // R_POWERPC_UADDR16
   1721 	R_PPC_REL32           R_PPC = 26 // R_POWERPC_REL32
   1722 	R_PPC_PLT32           R_PPC = 27 // R_POWERPC_PLT32
   1723 	R_PPC_PLTREL32        R_PPC = 28 // R_POWERPC_PLTREL32
   1724 	R_PPC_PLT16_LO        R_PPC = 29 // R_POWERPC_PLT16_LO
   1725 	R_PPC_PLT16_HI        R_PPC = 30 // R_POWERPC_PLT16_HI
   1726 	R_PPC_PLT16_HA        R_PPC = 31 // R_POWERPC_PLT16_HA
   1727 	R_PPC_SDAREL16        R_PPC = 32
   1728 	R_PPC_SECTOFF         R_PPC = 33 // R_POWERPC_SECTOFF
   1729 	R_PPC_SECTOFF_LO      R_PPC = 34 // R_POWERPC_SECTOFF_LO
   1730 	R_PPC_SECTOFF_HI      R_PPC = 35 // R_POWERPC_SECTOFF_HI
   1731 	R_PPC_SECTOFF_HA      R_PPC = 36 // R_POWERPC_SECTOFF_HA
   1732 	R_PPC_TLS             R_PPC = 67 // R_POWERPC_TLS
   1733 	R_PPC_DTPMOD32        R_PPC = 68 // R_POWERPC_DTPMOD32
   1734 	R_PPC_TPREL16         R_PPC = 69 // R_POWERPC_TPREL16
   1735 	R_PPC_TPREL16_LO      R_PPC = 70 // R_POWERPC_TPREL16_LO
   1736 	R_PPC_TPREL16_HI      R_PPC = 71 // R_POWERPC_TPREL16_HI
   1737 	R_PPC_TPREL16_HA      R_PPC = 72 // R_POWERPC_TPREL16_HA
   1738 	R_PPC_TPREL32         R_PPC = 73 // R_POWERPC_TPREL32
   1739 	R_PPC_DTPREL16        R_PPC = 74 // R_POWERPC_DTPREL16
   1740 	R_PPC_DTPREL16_LO     R_PPC = 75 // R_POWERPC_DTPREL16_LO
   1741 	R_PPC_DTPREL16_HI     R_PPC = 76 // R_POWERPC_DTPREL16_HI
   1742 	R_PPC_DTPREL16_HA     R_PPC = 77 // R_POWERPC_DTPREL16_HA
   1743 	R_PPC_DTPREL32        R_PPC = 78 // R_POWERPC_DTPREL32
   1744 	R_PPC_GOT_TLSGD16     R_PPC = 79 // R_POWERPC_GOT_TLSGD16
   1745 	R_PPC_GOT_TLSGD16_LO  R_PPC = 80 // R_POWERPC_GOT_TLSGD16_LO
   1746 	R_PPC_GOT_TLSGD16_HI  R_PPC = 81 // R_POWERPC_GOT_TLSGD16_HI
   1747 	R_PPC_GOT_TLSGD16_HA  R_PPC = 82 // R_POWERPC_GOT_TLSGD16_HA
   1748 	R_PPC_GOT_TLSLD16     R_PPC = 83 // R_POWERPC_GOT_TLSLD16
   1749 	R_PPC_GOT_TLSLD16_LO  R_PPC = 84 // R_POWERPC_GOT_TLSLD16_LO
   1750 	R_PPC_GOT_TLSLD16_HI  R_PPC = 85 // R_POWERPC_GOT_TLSLD16_HI
   1751 	R_PPC_GOT_TLSLD16_HA  R_PPC = 86 // R_POWERPC_GOT_TLSLD16_HA
   1752 	R_PPC_GOT_TPREL16     R_PPC = 87 // R_POWERPC_GOT_TPREL16
   1753 	R_PPC_GOT_TPREL16_LO  R_PPC = 88 // R_POWERPC_GOT_TPREL16_LO
   1754 	R_PPC_GOT_TPREL16_HI  R_PPC = 89 // R_POWERPC_GOT_TPREL16_HI
   1755 	R_PPC_GOT_TPREL16_HA  R_PPC = 90 // R_POWERPC_GOT_TPREL16_HA
   1756 	R_PPC_EMB_NADDR32     R_PPC = 101
   1757 	R_PPC_EMB_NADDR16     R_PPC = 102
   1758 	R_PPC_EMB_NADDR16_LO  R_PPC = 103
   1759 	R_PPC_EMB_NADDR16_HI  R_PPC = 104
   1760 	R_PPC_EMB_NADDR16_HA  R_PPC = 105
   1761 	R_PPC_EMB_SDAI16      R_PPC = 106
   1762 	R_PPC_EMB_SDA2I16     R_PPC = 107
   1763 	R_PPC_EMB_SDA2REL     R_PPC = 108
   1764 	R_PPC_EMB_SDA21       R_PPC = 109
   1765 	R_PPC_EMB_MRKREF      R_PPC = 110
   1766 	R_PPC_EMB_RELSEC16    R_PPC = 111
   1767 	R_PPC_EMB_RELST_LO    R_PPC = 112
   1768 	R_PPC_EMB_RELST_HI    R_PPC = 113
   1769 	R_PPC_EMB_RELST_HA    R_PPC = 114
   1770 	R_PPC_EMB_BIT_FLD     R_PPC = 115
   1771 	R_PPC_EMB_RELSDA      R_PPC = 116
   1772 )
   1773 
   1774 var rppcStrings = []intName{
   1775 	{0, "R_PPC_NONE"},
   1776 	{1, "R_PPC_ADDR32"},
   1777 	{2, "R_PPC_ADDR24"},
   1778 	{3, "R_PPC_ADDR16"},
   1779 	{4, "R_PPC_ADDR16_LO"},
   1780 	{5, "R_PPC_ADDR16_HI"},
   1781 	{6, "R_PPC_ADDR16_HA"},
   1782 	{7, "R_PPC_ADDR14"},
   1783 	{8, "R_PPC_ADDR14_BRTAKEN"},
   1784 	{9, "R_PPC_ADDR14_BRNTAKEN"},
   1785 	{10, "R_PPC_REL24"},
   1786 	{11, "R_PPC_REL14"},
   1787 	{12, "R_PPC_REL14_BRTAKEN"},
   1788 	{13, "R_PPC_REL14_BRNTAKEN"},
   1789 	{14, "R_PPC_GOT16"},
   1790 	{15, "R_PPC_GOT16_LO"},
   1791 	{16, "R_PPC_GOT16_HI"},
   1792 	{17, "R_PPC_GOT16_HA"},
   1793 	{18, "R_PPC_PLTREL24"},
   1794 	{19, "R_PPC_COPY"},
   1795 	{20, "R_PPC_GLOB_DAT"},
   1796 	{21, "R_PPC_JMP_SLOT"},
   1797 	{22, "R_PPC_RELATIVE"},
   1798 	{23, "R_PPC_LOCAL24PC"},
   1799 	{24, "R_PPC_UADDR32"},
   1800 	{25, "R_PPC_UADDR16"},
   1801 	{26, "R_PPC_REL32"},
   1802 	{27, "R_PPC_PLT32"},
   1803 	{28, "R_PPC_PLTREL32"},
   1804 	{29, "R_PPC_PLT16_LO"},
   1805 	{30, "R_PPC_PLT16_HI"},
   1806 	{31, "R_PPC_PLT16_HA"},
   1807 	{32, "R_PPC_SDAREL16"},
   1808 	{33, "R_PPC_SECTOFF"},
   1809 	{34, "R_PPC_SECTOFF_LO"},
   1810 	{35, "R_PPC_SECTOFF_HI"},
   1811 	{36, "R_PPC_SECTOFF_HA"},
   1812 	{67, "R_PPC_TLS"},
   1813 	{68, "R_PPC_DTPMOD32"},
   1814 	{69, "R_PPC_TPREL16"},
   1815 	{70, "R_PPC_TPREL16_LO"},
   1816 	{71, "R_PPC_TPREL16_HI"},
   1817 	{72, "R_PPC_TPREL16_HA"},
   1818 	{73, "R_PPC_TPREL32"},
   1819 	{74, "R_PPC_DTPREL16"},
   1820 	{75, "R_PPC_DTPREL16_LO"},
   1821 	{76, "R_PPC_DTPREL16_HI"},
   1822 	{77, "R_PPC_DTPREL16_HA"},
   1823 	{78, "R_PPC_DTPREL32"},
   1824 	{79, "R_PPC_GOT_TLSGD16"},
   1825 	{80, "R_PPC_GOT_TLSGD16_LO"},
   1826 	{81, "R_PPC_GOT_TLSGD16_HI"},
   1827 	{82, "R_PPC_GOT_TLSGD16_HA"},
   1828 	{83, "R_PPC_GOT_TLSLD16"},
   1829 	{84, "R_PPC_GOT_TLSLD16_LO"},
   1830 	{85, "R_PPC_GOT_TLSLD16_HI"},
   1831 	{86, "R_PPC_GOT_TLSLD16_HA"},
   1832 	{87, "R_PPC_GOT_TPREL16"},
   1833 	{88, "R_PPC_GOT_TPREL16_LO"},
   1834 	{89, "R_PPC_GOT_TPREL16_HI"},
   1835 	{90, "R_PPC_GOT_TPREL16_HA"},
   1836 	{101, "R_PPC_EMB_NADDR32"},
   1837 	{102, "R_PPC_EMB_NADDR16"},
   1838 	{103, "R_PPC_EMB_NADDR16_LO"},
   1839 	{104, "R_PPC_EMB_NADDR16_HI"},
   1840 	{105, "R_PPC_EMB_NADDR16_HA"},
   1841 	{106, "R_PPC_EMB_SDAI16"},
   1842 	{107, "R_PPC_EMB_SDA2I16"},
   1843 	{108, "R_PPC_EMB_SDA2REL"},
   1844 	{109, "R_PPC_EMB_SDA21"},
   1845 	{110, "R_PPC_EMB_MRKREF"},
   1846 	{111, "R_PPC_EMB_RELSEC16"},
   1847 	{112, "R_PPC_EMB_RELST_LO"},
   1848 	{113, "R_PPC_EMB_RELST_HI"},
   1849 	{114, "R_PPC_EMB_RELST_HA"},
   1850 	{115, "R_PPC_EMB_BIT_FLD"},
   1851 	{116, "R_PPC_EMB_RELSDA"},
   1852 }
   1853 
   1854 func (i R_PPC) String() string   { return stringName(uint32(i), rppcStrings, false) }
   1855 func (i R_PPC) GoString() string { return stringName(uint32(i), rppcStrings, true) }
   1856 
   1857 // Relocation types for 64-bit PowerPC or Power Architecture processors.
   1858 //
   1859 // Values that are shared by both R_PPC and R_PPC64 are prefixed with
   1860 // R_POWERPC_ in the ELF standard. For the R_PPC64 type, the relevant
   1861 // shared relocations have been renamed with the prefix R_PPC64_.
   1862 // The original name follows the value in a comment.
   1863 type R_PPC64 int
   1864 
   1865 const (
   1866 	R_PPC64_NONE               R_PPC64 = 0  // R_POWERPC_NONE
   1867 	R_PPC64_ADDR32             R_PPC64 = 1  // R_POWERPC_ADDR32
   1868 	R_PPC64_ADDR24             R_PPC64 = 2  // R_POWERPC_ADDR24
   1869 	R_PPC64_ADDR16             R_PPC64 = 3  // R_POWERPC_ADDR16
   1870 	R_PPC64_ADDR16_LO          R_PPC64 = 4  // R_POWERPC_ADDR16_LO
   1871 	R_PPC64_ADDR16_HI          R_PPC64 = 5  // R_POWERPC_ADDR16_HI
   1872 	R_PPC64_ADDR16_HA          R_PPC64 = 6  // R_POWERPC_ADDR16_HA
   1873 	R_PPC64_ADDR14             R_PPC64 = 7  // R_POWERPC_ADDR14
   1874 	R_PPC64_ADDR14_BRTAKEN     R_PPC64 = 8  // R_POWERPC_ADDR14_BRTAKEN
   1875 	R_PPC64_ADDR14_BRNTAKEN    R_PPC64 = 9  // R_POWERPC_ADDR14_BRNTAKEN
   1876 	R_PPC64_REL24              R_PPC64 = 10 // R_POWERPC_REL24
   1877 	R_PPC64_REL14              R_PPC64 = 11 // R_POWERPC_REL14
   1878 	R_PPC64_REL14_BRTAKEN      R_PPC64 = 12 // R_POWERPC_REL14_BRTAKEN
   1879 	R_PPC64_REL14_BRNTAKEN     R_PPC64 = 13 // R_POWERPC_REL14_BRNTAKEN
   1880 	R_PPC64_GOT16              R_PPC64 = 14 // R_POWERPC_GOT16
   1881 	R_PPC64_GOT16_LO           R_PPC64 = 15 // R_POWERPC_GOT16_LO
   1882 	R_PPC64_GOT16_HI           R_PPC64 = 16 // R_POWERPC_GOT16_HI
   1883 	R_PPC64_GOT16_HA           R_PPC64 = 17 // R_POWERPC_GOT16_HA
   1884 	R_PPC64_JMP_SLOT           R_PPC64 = 21 // R_POWERPC_JMP_SLOT
   1885 	R_PPC64_REL32              R_PPC64 = 26 // R_POWERPC_REL32
   1886 	R_PPC64_ADDR64             R_PPC64 = 38
   1887 	R_PPC64_ADDR16_HIGHER      R_PPC64 = 39
   1888 	R_PPC64_ADDR16_HIGHERA     R_PPC64 = 40
   1889 	R_PPC64_ADDR16_HIGHEST     R_PPC64 = 41
   1890 	R_PPC64_ADDR16_HIGHESTA    R_PPC64 = 42
   1891 	R_PPC64_REL64              R_PPC64 = 44
   1892 	R_PPC64_TOC16              R_PPC64 = 47
   1893 	R_PPC64_TOC16_LO           R_PPC64 = 48
   1894 	R_PPC64_TOC16_HI           R_PPC64 = 49
   1895 	R_PPC64_TOC16_HA           R_PPC64 = 50
   1896 	R_PPC64_TOC                R_PPC64 = 51
   1897 	R_PPC64_PLTGOT16           R_PPC64 = 52
   1898 	R_PPC64_PLTGOT16_LO        R_PPC64 = 53
   1899 	R_PPC64_PLTGOT16_HI        R_PPC64 = 54
   1900 	R_PPC64_PLTGOT16_HA        R_PPC64 = 55
   1901 	R_PPC64_ADDR16_DS          R_PPC64 = 56
   1902 	R_PPC64_ADDR16_LO_DS       R_PPC64 = 57
   1903 	R_PPC64_GOT16_DS           R_PPC64 = 58
   1904 	R_PPC64_GOT16_LO_DS        R_PPC64 = 59
   1905 	R_PPC64_PLT16_LO_DS        R_PPC64 = 60
   1906 	R_PPC64_SECTOFF_DS         R_PPC64 = 61
   1907 	R_PPC64_SECTOFF_LO_DS      R_PPC64 = 61
   1908 	R_PPC64_TOC16_DS           R_PPC64 = 63
   1909 	R_PPC64_TOC16_LO_DS        R_PPC64 = 64
   1910 	R_PPC64_PLTGOT16_DS        R_PPC64 = 65
   1911 	R_PPC64_PLTGOT_LO_DS       R_PPC64 = 66
   1912 	R_PPC64_TLS                R_PPC64 = 67 // R_POWERPC_TLS
   1913 	R_PPC64_DTPMOD64           R_PPC64 = 68 // R_POWERPC_DTPMOD64
   1914 	R_PPC64_TPREL16            R_PPC64 = 69 // R_POWERPC_TPREL16
   1915 	R_PPC64_TPREL16_LO         R_PPC64 = 70 // R_POWERPC_TPREL16_LO
   1916 	R_PPC64_TPREL16_HI         R_PPC64 = 71 // R_POWERPC_TPREL16_HI
   1917 	R_PPC64_TPREL16_HA         R_PPC64 = 72 // R_POWERPC_TPREL16_HA
   1918 	R_PPC64_TPREL64            R_PPC64 = 73 // R_POWERPC_TPREL64
   1919 	R_PPC64_DTPREL16           R_PPC64 = 74 // R_POWERPC_DTPREL16
   1920 	R_PPC64_DTPREL16_LO        R_PPC64 = 75 // R_POWERPC_DTPREL16_LO
   1921 	R_PPC64_DTPREL16_HI        R_PPC64 = 76 // R_POWERPC_DTPREL16_HI
   1922 	R_PPC64_DTPREL16_HA        R_PPC64 = 77 // R_POWERPC_DTPREL16_HA
   1923 	R_PPC64_DTPREL64           R_PPC64 = 78 // R_POWERPC_DTPREL64
   1924 	R_PPC64_GOT_TLSGD16        R_PPC64 = 79 // R_POWERPC_GOT_TLSGD16
   1925 	R_PPC64_GOT_TLSGD16_LO     R_PPC64 = 80 // R_POWERPC_GOT_TLSGD16_LO
   1926 	R_PPC64_GOT_TLSGD16_HI     R_PPC64 = 81 // R_POWERPC_GOT_TLSGD16_HI
   1927 	R_PPC64_GOT_TLSGD16_HA     R_PPC64 = 82 // R_POWERPC_GOT_TLSGD16_HA
   1928 	R_PPC64_GOT_TLSLD16        R_PPC64 = 83 // R_POWERPC_GOT_TLSLD16
   1929 	R_PPC64_GOT_TLSLD16_LO     R_PPC64 = 84 // R_POWERPC_GOT_TLSLD16_LO
   1930 	R_PPC64_GOT_TLSLD16_HI     R_PPC64 = 85 // R_POWERPC_GOT_TLSLD16_HI
   1931 	R_PPC64_GOT_TLSLD16_HA     R_PPC64 = 86 // R_POWERPC_GOT_TLSLD16_HA
   1932 	R_PPC64_GOT_TPREL16_DS     R_PPC64 = 87 // R_POWERPC_GOT_TPREL16_DS
   1933 	R_PPC64_GOT_TPREL16_LO_DS  R_PPC64 = 88 // R_POWERPC_GOT_TPREL16_LO_DS
   1934 	R_PPC64_GOT_TPREL16_HI     R_PPC64 = 89 // R_POWERPC_GOT_TPREL16_HI
   1935 	R_PPC64_GOT_TPREL16_HA     R_PPC64 = 90 // R_POWERPC_GOT_TPREL16_HA
   1936 	R_PPC64_GOT_DTPREL16_DS    R_PPC64 = 91 // R_POWERPC_GOT_DTPREL16_DS
   1937 	R_PPC64_GOT_DTPREL16_LO_DS R_PPC64 = 92 // R_POWERPC_GOT_DTPREL16_LO_DS
   1938 	R_PPC64_GOT_DTPREL16_HI    R_PPC64 = 93 // R_POWERPC_GOT_DTPREL16_HI
   1939 	R_PPC64_GOT_DTPREL16_HA    R_PPC64 = 94 // R_POWERPC_GOT_DTPREL16_HA
   1940 	R_PPC64_TPREL16_DS         R_PPC64 = 95
   1941 	R_PPC64_TPREL16_LO_DS      R_PPC64 = 96
   1942 	R_PPC64_TPREL16_HIGHER     R_PPC64 = 97
   1943 	R_PPC64_TPREL16_HIGHERA    R_PPC64 = 98
   1944 	R_PPC64_TPREL16_HIGHEST    R_PPC64 = 99
   1945 	R_PPC64_TPREL16_HIGHESTA   R_PPC64 = 100
   1946 	R_PPC64_DTPREL16_DS        R_PPC64 = 101
   1947 	R_PPC64_DTPREL16_LO_DS     R_PPC64 = 102
   1948 	R_PPC64_DTPREL16_HIGHER    R_PPC64 = 103
   1949 	R_PPC64_DTPREL16_HIGHERA   R_PPC64 = 104
   1950 	R_PPC64_DTPREL16_HIGHEST   R_PPC64 = 105
   1951 	R_PPC64_DTPREL16_HIGHESTA  R_PPC64 = 106
   1952 	R_PPC64_TLSGD              R_PPC64 = 107
   1953 	R_PPC64_TLSLD              R_PPC64 = 108
   1954 	R_PPC64_TOCSAVE            R_PPC64 = 109
   1955 	R_PPC64_ADDR16_HIGH        R_PPC64 = 110
   1956 	R_PPC64_ADDR16_HIGHA       R_PPC64 = 111
   1957 	R_PPC64_TPREL16_HIGH       R_PPC64 = 112
   1958 	R_PPC64_TPREL16_HIGHA      R_PPC64 = 113
   1959 	R_PPC64_DTPREL16_HIGH      R_PPC64 = 114
   1960 	R_PPC64_DTPREL16_HIGHA     R_PPC64 = 115
   1961 	R_PPC64_REL24_NOTOC        R_PPC64 = 116
   1962 	R_PPC64_ADDR64_LOCAL       R_PPC64 = 117
   1963 	R_PPC64_ENTRY              R_PPC64 = 118
   1964 	R_PPC64_REL16DX_HA         R_PPC64 = 246 // R_POWERPC_REL16DX_HA
   1965 	R_PPC64_JMP_IREL           R_PPC64 = 247
   1966 	R_PPC64_IRELATIVE          R_PPC64 = 248 // R_POWERPC_IRELATIVE
   1967 	R_PPC64_REL16              R_PPC64 = 249 // R_POWERPC_REL16
   1968 	R_PPC64_REL16_LO           R_PPC64 = 250 // R_POWERPC_REL16_LO
   1969 	R_PPC64_REL16_HI           R_PPC64 = 251 // R_POWERPC_REL16_HI
   1970 	R_PPC64_REL16_HA           R_PPC64 = 252 // R_POWERPC_REL16_HA
   1971 )
   1972 
   1973 var rppc64Strings = []intName{
   1974 	{0, "R_PPC64_NONE"},
   1975 	{1, "R_PPC64_ADDR32"},
   1976 	{2, "R_PPC64_ADDR24"},
   1977 	{3, "R_PPC64_ADDR16"},
   1978 	{4, "R_PPC64_ADDR16_LO"},
   1979 	{5, "R_PPC64_ADDR16_HI"},
   1980 	{6, "R_PPC64_ADDR16_HA"},
   1981 	{7, "R_PPC64_ADDR14"},
   1982 	{8, "R_PPC64_ADDR14_BRTAKEN"},
   1983 	{9, "R_PPC64_ADDR14_BRNTAKEN"},
   1984 	{10, "R_PPC64_REL24"},
   1985 	{11, "R_PPC64_REL14"},
   1986 	{12, "R_PPC64_REL14_BRTAKEN"},
   1987 	{13, "R_PPC64_REL14_BRNTAKEN"},
   1988 	{14, "R_PPC64_GOT16"},
   1989 	{15, "R_PPC64_GOT16_LO"},
   1990 	{16, "R_PPC64_GOT16_HI"},
   1991 	{17, "R_PPC64_GOT16_HA"},
   1992 	{21, "R_PPC64_JMP_SLOT"},
   1993 	{26, "R_PPC64_REL32"},
   1994 	{38, "R_PPC64_ADDR64"},
   1995 	{39, "R_PPC64_ADDR16_HIGHER"},
   1996 	{40, "R_PPC64_ADDR16_HIGHERA"},
   1997 	{41, "R_PPC64_ADDR16_HIGHEST"},
   1998 	{42, "R_PPC64_ADDR16_HIGHESTA"},
   1999 	{44, "R_PPC64_REL64"},
   2000 	{47, "R_PPC64_TOC16"},
   2001 	{48, "R_PPC64_TOC16_LO"},
   2002 	{49, "R_PPC64_TOC16_HI"},
   2003 	{50, "R_PPC64_TOC16_HA"},
   2004 	{51, "R_PPC64_TOC"},
   2005 	{52, "R_PPC64_PLTGOT16"},
   2006 	{53, "R_PPC64_PLTGOT16_LO"},
   2007 	{54, "R_PPC64_PLTGOT16_HI"},
   2008 	{55, "R_PPC64_PLTGOT16_HA"},
   2009 	{56, "R_PPC64_ADDR16_DS"},
   2010 	{57, "R_PPC64_ADDR16_LO_DS"},
   2011 	{58, "R_PPC64_GOT16_DS"},
   2012 	{59, "R_PPC64_GOT16_LO_DS"},
   2013 	{60, "R_PPC64_PLT16_LO_DS"},
   2014 	{61, "R_PPC64_SECTOFF_DS"},
   2015 	{61, "R_PPC64_SECTOFF_LO_DS"},
   2016 	{63, "R_PPC64_TOC16_DS"},
   2017 	{64, "R_PPC64_TOC16_LO_DS"},
   2018 	{65, "R_PPC64_PLTGOT16_DS"},
   2019 	{66, "R_PPC64_PLTGOT_LO_DS"},
   2020 	{67, "R_PPC64_TLS"},
   2021 	{68, "R_PPC64_DTPMOD64"},
   2022 	{69, "R_PPC64_TPREL16"},
   2023 	{70, "R_PPC64_TPREL16_LO"},
   2024 	{71, "R_PPC64_TPREL16_HI"},
   2025 	{72, "R_PPC64_TPREL16_HA"},
   2026 	{73, "R_PPC64_TPREL64"},
   2027 	{74, "R_PPC64_DTPREL16"},
   2028 	{75, "R_PPC64_DTPREL16_LO"},
   2029 	{76, "R_PPC64_DTPREL16_HI"},
   2030 	{77, "R_PPC64_DTPREL16_HA"},
   2031 	{78, "R_PPC64_DTPREL64"},
   2032 	{79, "R_PPC64_GOT_TLSGD16"},
   2033 	{80, "R_PPC64_GOT_TLSGD16_LO"},
   2034 	{81, "R_PPC64_GOT_TLSGD16_HI"},
   2035 	{82, "R_PPC64_GOT_TLSGD16_HA"},
   2036 	{83, "R_PPC64_GOT_TLSLD16"},
   2037 	{84, "R_PPC64_GOT_TLSLD16_LO"},
   2038 	{85, "R_PPC64_GOT_TLSLD16_HI"},
   2039 	{86, "R_PPC64_GOT_TLSLD16_HA"},
   2040 	{87, "R_PPC64_GOT_TPREL16_DS"},
   2041 	{88, "R_PPC64_GOT_TPREL16_LO_DS"},
   2042 	{89, "R_PPC64_GOT_TPREL16_HI"},
   2043 	{90, "R_PPC64_GOT_TPREL16_HA"},
   2044 	{91, "R_PPC64_GOT_DTPREL16_DS"},
   2045 	{92, "R_PPC64_GOT_DTPREL16_LO_DS"},
   2046 	{93, "R_PPC64_GOT_DTPREL16_HI"},
   2047 	{94, "R_PPC64_GOT_DTPREL16_HA"},
   2048 	{95, "R_PPC64_TPREL16_DS"},
   2049 	{96, "R_PPC64_TPREL16_LO_DS"},
   2050 	{97, "R_PPC64_TPREL16_HIGHER"},
   2051 	{98, "R_PPC64_TPREL16_HIGHERA"},
   2052 	{99, "R_PPC64_TPREL16_HIGHEST"},
   2053 	{100, "R_PPC64_TPREL16_HIGHESTA"},
   2054 	{101, "R_PPC64_DTPREL16_DS"},
   2055 	{102, "R_PPC64_DTPREL16_LO_DS"},
   2056 	{103, "R_PPC64_DTPREL16_HIGHER"},
   2057 	{104, "R_PPC64_DTPREL16_HIGHERA"},
   2058 	{105, "R_PPC64_DTPREL16_HIGHEST"},
   2059 	{106, "R_PPC64_DTPREL16_HIGHESTA"},
   2060 	{107, "R_PPC64_TLSGD"},
   2061 	{108, "R_PPC64_TLSLD"},
   2062 	{109, "R_PPC64_TOCSAVE"},
   2063 	{110, "R_PPC64_ADDR16_HIGH"},
   2064 	{111, "R_PPC64_ADDR16_HIGHA"},
   2065 	{112, "R_PPC64_TPREL16_HIGH"},
   2066 	{113, "R_PPC64_TPREL16_HIGHA"},
   2067 	{114, "R_PPC64_DTPREL16_HIGH"},
   2068 	{115, "R_PPC64_DTPREL16_HIGHA"},
   2069 	{116, "R_PPC64_REL24_NOTOC"},
   2070 	{117, "R_PPC64_ADDR64_LOCAL"},
   2071 	{118, "R_PPC64_ENTRY"},
   2072 	{246, "R_PPC64_REL16DX_HA"},
   2073 	{247, "R_PPC64_JMP_IREL"},
   2074 	{248, "R_PPC64_IRELATIVE"},
   2075 	{249, "R_PPC64_REL16"},
   2076 	{250, "R_PPC64_REL16_LO"},
   2077 	{251, "R_PPC64_REL16_HI"},
   2078 	{252, "R_PPC64_REL16_HA"},
   2079 }
   2080 
   2081 func (i R_PPC64) String() string   { return stringName(uint32(i), rppc64Strings, false) }
   2082 func (i R_PPC64) GoString() string { return stringName(uint32(i), rppc64Strings, true) }
   2083 
   2084 // Relocation types for s390x processors.
   2085 type R_390 int
   2086 
   2087 const (
   2088 	R_390_NONE        R_390 = 0
   2089 	R_390_8           R_390 = 1
   2090 	R_390_12          R_390 = 2
   2091 	R_390_16          R_390 = 3
   2092 	R_390_32          R_390 = 4
   2093 	R_390_PC32        R_390 = 5
   2094 	R_390_GOT12       R_390 = 6
   2095 	R_390_GOT32       R_390 = 7
   2096 	R_390_PLT32       R_390 = 8
   2097 	R_390_COPY        R_390 = 9
   2098 	R_390_GLOB_DAT    R_390 = 10
   2099 	R_390_JMP_SLOT    R_390 = 11
   2100 	R_390_RELATIVE    R_390 = 12
   2101 	R_390_GOTOFF      R_390 = 13
   2102 	R_390_GOTPC       R_390 = 14
   2103 	R_390_GOT16       R_390 = 15
   2104 	R_390_PC16        R_390 = 16
   2105 	R_390_PC16DBL     R_390 = 17
   2106 	R_390_PLT16DBL    R_390 = 18
   2107 	R_390_PC32DBL     R_390 = 19
   2108 	R_390_PLT32DBL    R_390 = 20
   2109 	R_390_GOTPCDBL    R_390 = 21
   2110 	R_390_64          R_390 = 22
   2111 	R_390_PC64        R_390 = 23
   2112 	R_390_GOT64       R_390 = 24
   2113 	R_390_PLT64       R_390 = 25
   2114 	R_390_GOTENT      R_390 = 26
   2115 	R_390_GOTOFF16    R_390 = 27
   2116 	R_390_GOTOFF64    R_390 = 28
   2117 	R_390_GOTPLT12    R_390 = 29
   2118 	R_390_GOTPLT16    R_390 = 30
   2119 	R_390_GOTPLT32    R_390 = 31
   2120 	R_390_GOTPLT64    R_390 = 32
   2121 	R_390_GOTPLTENT   R_390 = 33
   2122 	R_390_GOTPLTOFF16 R_390 = 34
   2123 	R_390_GOTPLTOFF32 R_390 = 35
   2124 	R_390_GOTPLTOFF64 R_390 = 36
   2125 	R_390_TLS_LOAD    R_390 = 37
   2126 	R_390_TLS_GDCALL  R_390 = 38
   2127 	R_390_TLS_LDCALL  R_390 = 39
   2128 	R_390_TLS_GD32    R_390 = 40
   2129 	R_390_TLS_GD64    R_390 = 41
   2130 	R_390_TLS_GOTIE12 R_390 = 42
   2131 	R_390_TLS_GOTIE32 R_390 = 43
   2132 	R_390_TLS_GOTIE64 R_390 = 44
   2133 	R_390_TLS_LDM32   R_390 = 45
   2134 	R_390_TLS_LDM64   R_390 = 46
   2135 	R_390_TLS_IE32    R_390 = 47
   2136 	R_390_TLS_IE64    R_390 = 48
   2137 	R_390_TLS_IEENT   R_390 = 49
   2138 	R_390_TLS_LE32    R_390 = 50
   2139 	R_390_TLS_LE64    R_390 = 51
   2140 	R_390_TLS_LDO32   R_390 = 52
   2141 	R_390_TLS_LDO64   R_390 = 53
   2142 	R_390_TLS_DTPMOD  R_390 = 54
   2143 	R_390_TLS_DTPOFF  R_390 = 55
   2144 	R_390_TLS_TPOFF   R_390 = 56
   2145 	R_390_20          R_390 = 57
   2146 	R_390_GOT20       R_390 = 58
   2147 	R_390_GOTPLT20    R_390 = 59
   2148 	R_390_TLS_GOTIE20 R_390 = 60
   2149 )
   2150 
   2151 var r390Strings = []intName{
   2152 	{0, "R_390_NONE"},
   2153 	{1, "R_390_8"},
   2154 	{2, "R_390_12"},
   2155 	{3, "R_390_16"},
   2156 	{4, "R_390_32"},
   2157 	{5, "R_390_PC32"},
   2158 	{6, "R_390_GOT12"},
   2159 	{7, "R_390_GOT32"},
   2160 	{8, "R_390_PLT32"},
   2161 	{9, "R_390_COPY"},
   2162 	{10, "R_390_GLOB_DAT"},
   2163 	{11, "R_390_JMP_SLOT"},
   2164 	{12, "R_390_RELATIVE"},
   2165 	{13, "R_390_GOTOFF"},
   2166 	{14, "R_390_GOTPC"},
   2167 	{15, "R_390_GOT16"},
   2168 	{16, "R_390_PC16"},
   2169 	{17, "R_390_PC16DBL"},
   2170 	{18, "R_390_PLT16DBL"},
   2171 	{19, "R_390_PC32DBL"},
   2172 	{20, "R_390_PLT32DBL"},
   2173 	{21, "R_390_GOTPCDBL"},
   2174 	{22, "R_390_64"},
   2175 	{23, "R_390_PC64"},
   2176 	{24, "R_390_GOT64"},
   2177 	{25, "R_390_PLT64"},
   2178 	{26, "R_390_GOTENT"},
   2179 	{27, "R_390_GOTOFF16"},
   2180 	{28, "R_390_GOTOFF64"},
   2181 	{29, "R_390_GOTPLT12"},
   2182 	{30, "R_390_GOTPLT16"},
   2183 	{31, "R_390_GOTPLT32"},
   2184 	{32, "R_390_GOTPLT64"},
   2185 	{33, "R_390_GOTPLTENT"},
   2186 	{34, "R_390_GOTPLTOFF16"},
   2187 	{35, "R_390_GOTPLTOFF32"},
   2188 	{36, "R_390_GOTPLTOFF64"},
   2189 	{37, "R_390_TLS_LOAD"},
   2190 	{38, "R_390_TLS_GDCALL"},
   2191 	{39, "R_390_TLS_LDCALL"},
   2192 	{40, "R_390_TLS_GD32"},
   2193 	{41, "R_390_TLS_GD64"},
   2194 	{42, "R_390_TLS_GOTIE12"},
   2195 	{43, "R_390_TLS_GOTIE32"},
   2196 	{44, "R_390_TLS_GOTIE64"},
   2197 	{45, "R_390_TLS_LDM32"},
   2198 	{46, "R_390_TLS_LDM64"},
   2199 	{47, "R_390_TLS_IE32"},
   2200 	{48, "R_390_TLS_IE64"},
   2201 	{49, "R_390_TLS_IEENT"},
   2202 	{50, "R_390_TLS_LE32"},
   2203 	{51, "R_390_TLS_LE64"},
   2204 	{52, "R_390_TLS_LDO32"},
   2205 	{53, "R_390_TLS_LDO64"},
   2206 	{54, "R_390_TLS_DTPMOD"},
   2207 	{55, "R_390_TLS_DTPOFF"},
   2208 	{56, "R_390_TLS_TPOFF"},
   2209 	{57, "R_390_20"},
   2210 	{58, "R_390_GOT20"},
   2211 	{59, "R_390_GOTPLT20"},
   2212 	{60, "R_390_TLS_GOTIE20"},
   2213 }
   2214 
   2215 func (i R_390) String() string   { return stringName(uint32(i), r390Strings, false) }
   2216 func (i R_390) GoString() string { return stringName(uint32(i), r390Strings, true) }
   2217 
   2218 // Relocation types for SPARC.
   2219 type R_SPARC int
   2220 
   2221 const (
   2222 	R_SPARC_NONE     R_SPARC = 0
   2223 	R_SPARC_8        R_SPARC = 1
   2224 	R_SPARC_16       R_SPARC = 2
   2225 	R_SPARC_32       R_SPARC = 3
   2226 	R_SPARC_DISP8    R_SPARC = 4
   2227 	R_SPARC_DISP16   R_SPARC = 5
   2228 	R_SPARC_DISP32   R_SPARC = 6
   2229 	R_SPARC_WDISP30  R_SPARC = 7
   2230 	R_SPARC_WDISP22  R_SPARC = 8
   2231 	R_SPARC_HI22     R_SPARC = 9
   2232 	R_SPARC_22       R_SPARC = 10
   2233 	R_SPARC_13       R_SPARC = 11
   2234 	R_SPARC_LO10     R_SPARC = 12
   2235 	R_SPARC_GOT10    R_SPARC = 13
   2236 	R_SPARC_GOT13    R_SPARC = 14
   2237 	R_SPARC_GOT22    R_SPARC = 15
   2238 	R_SPARC_PC10     R_SPARC = 16
   2239 	R_SPARC_PC22     R_SPARC = 17
   2240 	R_SPARC_WPLT30   R_SPARC = 18
   2241 	R_SPARC_COPY     R_SPARC = 19
   2242 	R_SPARC_GLOB_DAT R_SPARC = 20
   2243 	R_SPARC_JMP_SLOT R_SPARC = 21
   2244 	R_SPARC_RELATIVE R_SPARC = 22
   2245 	R_SPARC_UA32     R_SPARC = 23
   2246 	R_SPARC_PLT32    R_SPARC = 24
   2247 	R_SPARC_HIPLT22  R_SPARC = 25
   2248 	R_SPARC_LOPLT10  R_SPARC = 26
   2249 	R_SPARC_PCPLT32  R_SPARC = 27
   2250 	R_SPARC_PCPLT22  R_SPARC = 28
   2251 	R_SPARC_PCPLT10  R_SPARC = 29
   2252 	R_SPARC_10       R_SPARC = 30
   2253 	R_SPARC_11       R_SPARC = 31
   2254 	R_SPARC_64       R_SPARC = 32
   2255 	R_SPARC_OLO10    R_SPARC = 33
   2256 	R_SPARC_HH22     R_SPARC = 34
   2257 	R_SPARC_HM10     R_SPARC = 35
   2258 	R_SPARC_LM22     R_SPARC = 36
   2259 	R_SPARC_PC_HH22  R_SPARC = 37
   2260 	R_SPARC_PC_HM10  R_SPARC = 38
   2261 	R_SPARC_PC_LM22  R_SPARC = 39
   2262 	R_SPARC_WDISP16  R_SPARC = 40
   2263 	R_SPARC_WDISP19  R_SPARC = 41
   2264 	R_SPARC_GLOB_JMP R_SPARC = 42
   2265 	R_SPARC_7        R_SPARC = 43
   2266 	R_SPARC_5        R_SPARC = 44
   2267 	R_SPARC_6        R_SPARC = 45
   2268 	R_SPARC_DISP64   R_SPARC = 46
   2269 	R_SPARC_PLT64    R_SPARC = 47
   2270 	R_SPARC_HIX22    R_SPARC = 48
   2271 	R_SPARC_LOX10    R_SPARC = 49
   2272 	R_SPARC_H44      R_SPARC = 50
   2273 	R_SPARC_M44      R_SPARC = 51
   2274 	R_SPARC_L44      R_SPARC = 52
   2275 	R_SPARC_REGISTER R_SPARC = 53
   2276 	R_SPARC_UA64     R_SPARC = 54
   2277 	R_SPARC_UA16     R_SPARC = 55
   2278 )
   2279 
   2280 var rsparcStrings = []intName{
   2281 	{0, "R_SPARC_NONE"},
   2282 	{1, "R_SPARC_8"},
   2283 	{2, "R_SPARC_16"},
   2284 	{3, "R_SPARC_32"},
   2285 	{4, "R_SPARC_DISP8"},
   2286 	{5, "R_SPARC_DISP16"},
   2287 	{6, "R_SPARC_DISP32"},
   2288 	{7, "R_SPARC_WDISP30"},
   2289 	{8, "R_SPARC_WDISP22"},
   2290 	{9, "R_SPARC_HI22"},
   2291 	{10, "R_SPARC_22"},
   2292 	{11, "R_SPARC_13"},
   2293 	{12, "R_SPARC_LO10"},
   2294 	{13, "R_SPARC_GOT10"},
   2295 	{14, "R_SPARC_GOT13"},
   2296 	{15, "R_SPARC_GOT22"},
   2297 	{16, "R_SPARC_PC10"},
   2298 	{17, "R_SPARC_PC22"},
   2299 	{18, "R_SPARC_WPLT30"},
   2300 	{19, "R_SPARC_COPY"},
   2301 	{20, "R_SPARC_GLOB_DAT"},
   2302 	{21, "R_SPARC_JMP_SLOT"},
   2303 	{22, "R_SPARC_RELATIVE"},
   2304 	{23, "R_SPARC_UA32"},
   2305 	{24, "R_SPARC_PLT32"},
   2306 	{25, "R_SPARC_HIPLT22"},
   2307 	{26, "R_SPARC_LOPLT10"},
   2308 	{27, "R_SPARC_PCPLT32"},
   2309 	{28, "R_SPARC_PCPLT22"},
   2310 	{29, "R_SPARC_PCPLT10"},
   2311 	{30, "R_SPARC_10"},
   2312 	{31, "R_SPARC_11"},
   2313 	{32, "R_SPARC_64"},
   2314 	{33, "R_SPARC_OLO10"},
   2315 	{34, "R_SPARC_HH22"},
   2316 	{35, "R_SPARC_HM10"},
   2317 	{36, "R_SPARC_LM22"},
   2318 	{37, "R_SPARC_PC_HH22"},
   2319 	{38, "R_SPARC_PC_HM10"},
   2320 	{39, "R_SPARC_PC_LM22"},
   2321 	{40, "R_SPARC_WDISP16"},
   2322 	{41, "R_SPARC_WDISP19"},
   2323 	{42, "R_SPARC_GLOB_JMP"},
   2324 	{43, "R_SPARC_7"},
   2325 	{44, "R_SPARC_5"},
   2326 	{45, "R_SPARC_6"},
   2327 	{46, "R_SPARC_DISP64"},
   2328 	{47, "R_SPARC_PLT64"},
   2329 	{48, "R_SPARC_HIX22"},
   2330 	{49, "R_SPARC_LOX10"},
   2331 	{50, "R_SPARC_H44"},
   2332 	{51, "R_SPARC_M44"},
   2333 	{52, "R_SPARC_L44"},
   2334 	{53, "R_SPARC_REGISTER"},
   2335 	{54, "R_SPARC_UA64"},
   2336 	{55, "R_SPARC_UA16"},
   2337 }
   2338 
   2339 func (i R_SPARC) String() string   { return stringName(uint32(i), rsparcStrings, false) }
   2340 func (i R_SPARC) GoString() string { return stringName(uint32(i), rsparcStrings, true) }
   2341 
   2342 // Magic number for the elf trampoline, chosen wisely to be an immediate value.
   2343 const ARM_MAGIC_TRAMP_NUMBER = 0x5c000003
   2344 
   2345 // ELF32 File header.
   2346 type Header32 struct {
   2347 	Ident     [EI_NIDENT]byte /* File identification. */
   2348 	Type      uint16          /* File type. */
   2349 	Machine   uint16          /* Machine architecture. */
   2350 	Version   uint32          /* ELF format version. */
   2351 	Entry     uint32          /* Entry point. */
   2352 	Phoff     uint32          /* Program header file offset. */
   2353 	Shoff     uint32          /* Section header file offset. */
   2354 	Flags     uint32          /* Architecture-specific flags. */
   2355 	Ehsize    uint16          /* Size of ELF header in bytes. */
   2356 	Phentsize uint16          /* Size of program header entry. */
   2357 	Phnum     uint16          /* Number of program header entries. */
   2358 	Shentsize uint16          /* Size of section header entry. */
   2359 	Shnum     uint16          /* Number of section header entries. */
   2360 	Shstrndx  uint16          /* Section name strings section. */
   2361 }
   2362 
   2363 // ELF32 Section header.
   2364 type Section32 struct {
   2365 	Name      uint32 /* Section name (index into the section header string table). */
   2366 	Type      uint32 /* Section type. */
   2367 	Flags     uint32 /* Section flags. */
   2368 	Addr      uint32 /* Address in memory image. */
   2369 	Off       uint32 /* Offset in file. */
   2370 	Size      uint32 /* Size in bytes. */
   2371 	Link      uint32 /* Index of a related section. */
   2372 	Info      uint32 /* Depends on section type. */
   2373 	Addralign uint32 /* Alignment in bytes. */
   2374 	Entsize   uint32 /* Size of each entry in section. */
   2375 }
   2376 
   2377 // ELF32 Program header.
   2378 type Prog32 struct {
   2379 	Type   uint32 /* Entry type. */
   2380 	Off    uint32 /* File offset of contents. */
   2381 	Vaddr  uint32 /* Virtual address in memory image. */
   2382 	Paddr  uint32 /* Physical address (not used). */
   2383 	Filesz uint32 /* Size of contents in file. */
   2384 	Memsz  uint32 /* Size of contents in memory. */
   2385 	Flags  uint32 /* Access permission flags. */
   2386 	Align  uint32 /* Alignment in memory and file. */
   2387 }
   2388 
   2389 // ELF32 Dynamic structure. The ".dynamic" section contains an array of them.
   2390 type Dyn32 struct {
   2391 	Tag int32  /* Entry type. */
   2392 	Val uint32 /* Integer/Address value. */
   2393 }
   2394 
   2395 // ELF32 Compression header.
   2396 type Chdr32 struct {
   2397 	Type      uint32
   2398 	Size      uint32
   2399 	Addralign uint32
   2400 }
   2401 
   2402 /*
   2403  * Relocation entries.
   2404  */
   2405 
   2406 // ELF32 Relocations that don't need an addend field.
   2407 type Rel32 struct {
   2408 	Off  uint32 /* Location to be relocated. */
   2409 	Info uint32 /* Relocation type and symbol index. */
   2410 }
   2411 
   2412 // ELF32 Relocations that need an addend field.
   2413 type Rela32 struct {
   2414 	Off    uint32 /* Location to be relocated. */
   2415 	Info   uint32 /* Relocation type and symbol index. */
   2416 	Addend int32  /* Addend. */
   2417 }
   2418 
   2419 func R_SYM32(info uint32) uint32      { return info >> 8 }
   2420 func R_TYPE32(info uint32) uint32     { return info & 0xff }
   2421 func R_INFO32(sym, typ uint32) uint32 { return sym<<8 | typ }
   2422 
   2423 // ELF32 Symbol.
   2424 type Sym32 struct {
   2425 	Name  uint32
   2426 	Value uint32
   2427 	Size  uint32
   2428 	Info  uint8
   2429 	Other uint8
   2430 	Shndx uint16
   2431 }
   2432 
   2433 const Sym32Size = 16
   2434 
   2435 func ST_BIND(info uint8) SymBind { return SymBind(info >> 4) }
   2436 func ST_TYPE(info uint8) SymType { return SymType(info & 0xF) }
   2437 func ST_INFO(bind SymBind, typ SymType) uint8 {
   2438 	return uint8(bind)<<4 | uint8(typ)&0xf
   2439 }
   2440 func ST_VISIBILITY(other uint8) SymVis { return SymVis(other & 3) }
   2441 
   2442 /*
   2443  * ELF64
   2444  */
   2445 
   2446 // ELF64 file header.
   2447 type Header64 struct {
   2448 	Ident     [EI_NIDENT]byte /* File identification. */
   2449 	Type      uint16          /* File type. */
   2450 	Machine   uint16          /* Machine architecture. */
   2451 	Version   uint32          /* ELF format version. */
   2452 	Entry     uint64          /* Entry point. */
   2453 	Phoff     uint64          /* Program header file offset. */
   2454 	Shoff     uint64          /* Section header file offset. */
   2455 	Flags     uint32          /* Architecture-specific flags. */
   2456 	Ehsize    uint16          /* Size of ELF header in bytes. */
   2457 	Phentsize uint16          /* Size of program header entry. */
   2458 	Phnum     uint16          /* Number of program header entries. */
   2459 	Shentsize uint16          /* Size of section header entry. */
   2460 	Shnum     uint16          /* Number of section header entries. */
   2461 	Shstrndx  uint16          /* Section name strings section. */
   2462 }
   2463 
   2464 // ELF64 Section header.
   2465 type Section64 struct {
   2466 	Name      uint32 /* Section name (index into the section header string table). */
   2467 	Type      uint32 /* Section type. */
   2468 	Flags     uint64 /* Section flags. */
   2469 	Addr      uint64 /* Address in memory image. */
   2470 	Off       uint64 /* Offset in file. */
   2471 	Size      uint64 /* Size in bytes. */
   2472 	Link      uint32 /* Index of a related section. */
   2473 	Info      uint32 /* Depends on section type. */
   2474 	Addralign uint64 /* Alignment in bytes. */
   2475 	Entsize   uint64 /* Size of each entry in section. */
   2476 }
   2477 
   2478 // ELF64 Program header.
   2479 type Prog64 struct {
   2480 	Type   uint32 /* Entry type. */
   2481 	Flags  uint32 /* Access permission flags. */
   2482 	Off    uint64 /* File offset of contents. */
   2483 	Vaddr  uint64 /* Virtual address in memory image. */
   2484 	Paddr  uint64 /* Physical address (not used). */
   2485 	Filesz uint64 /* Size of contents in file. */
   2486 	Memsz  uint64 /* Size of contents in memory. */
   2487 	Align  uint64 /* Alignment in memory and file. */
   2488 }
   2489 
   2490 // ELF64 Dynamic structure. The ".dynamic" section contains an array of them.
   2491 type Dyn64 struct {
   2492 	Tag int64  /* Entry type. */
   2493 	Val uint64 /* Integer/address value */
   2494 }
   2495 
   2496 // ELF64 Compression header.
   2497 type Chdr64 struct {
   2498 	Type      uint32
   2499 	_         uint32 /* Reserved. */
   2500 	Size      uint64
   2501 	Addralign uint64
   2502 }
   2503 
   2504 /*
   2505  * Relocation entries.
   2506  */
   2507 
   2508 /* ELF64 relocations that don't need an addend field. */
   2509 type Rel64 struct {
   2510 	Off  uint64 /* Location to be relocated. */
   2511 	Info uint64 /* Relocation type and symbol index. */
   2512 }
   2513 
   2514 /* ELF64 relocations that need an addend field. */
   2515 type Rela64 struct {
   2516 	Off    uint64 /* Location to be relocated. */
   2517 	Info   uint64 /* Relocation type and symbol index. */
   2518 	Addend int64  /* Addend. */
   2519 }
   2520 
   2521 func R_SYM64(info uint64) uint32    { return uint32(info >> 32) }
   2522 func R_TYPE64(info uint64) uint32   { return uint32(info) }
   2523 func R_INFO(sym, typ uint32) uint64 { return uint64(sym)<<32 | uint64(typ) }
   2524 
   2525 // ELF64 symbol table entries.
   2526 type Sym64 struct {
   2527 	Name  uint32 /* String table index of name. */
   2528 	Info  uint8  /* Type and binding information. */
   2529 	Other uint8  /* Reserved (not used). */
   2530 	Shndx uint16 /* Section index of symbol. */
   2531 	Value uint64 /* Symbol value. */
   2532 	Size  uint64 /* Size of associated object. */
   2533 }
   2534 
   2535 const Sym64Size = 24
   2536 
   2537 type intName struct {
   2538 	i uint32
   2539 	s string
   2540 }
   2541 
   2542 func stringName(i uint32, names []intName, goSyntax bool) string {
   2543 	for _, n := range names {
   2544 		if n.i == i {
   2545 			if goSyntax {
   2546 				return "elf." + n.s
   2547 			}
   2548 			return n.s
   2549 		}
   2550 	}
   2551 
   2552 	// second pass - look for smaller to add with.
   2553 	// assume sorted already
   2554 	for j := len(names) - 1; j >= 0; j-- {
   2555 		n := names[j]
   2556 		if n.i < i {
   2557 			s := n.s
   2558 			if goSyntax {
   2559 				s = "elf." + s
   2560 			}
   2561 			return s + "+" + strconv.FormatUint(uint64(i-n.i), 10)
   2562 		}
   2563 	}
   2564 
   2565 	return strconv.FormatUint(uint64(i), 10)
   2566 }
   2567 
   2568 func flagName(i uint32, names []intName, goSyntax bool) string {
   2569 	s := ""
   2570 	for _, n := range names {
   2571 		if n.i&i == n.i {
   2572 			if len(s) > 0 {
   2573 				s += "+"
   2574 			}
   2575 			if goSyntax {
   2576 				s += "elf."
   2577 			}
   2578 			s += n.s
   2579 			i -= n.i
   2580 		}
   2581 	}
   2582 	if len(s) == 0 {
   2583 		return "0x" + strconv.FormatUint(uint64(i), 16)
   2584 	}
   2585 	if i != 0 {
   2586 		s += "+0x" + strconv.FormatUint(uint64(i), 16)
   2587 	}
   2588 	return s
   2589 }
   2590