Source file src/runtime/vdso_elf32.go

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build linux && (386 || arm)
     6  
     7  package runtime
     8  
     9  // ELF32 structure definitions for use by the vDSO loader
    10  
    11  type elfSym struct {
    12  	st_name  uint32
    13  	st_value uint32
    14  	st_size  uint32
    15  	st_info  byte
    16  	st_other byte
    17  	st_shndx uint16
    18  }
    19  
    20  type elfVerdef struct {
    21  	vd_version uint16 /* Version revision */
    22  	vd_flags   uint16 /* Version information */
    23  	vd_ndx     uint16 /* Version Index */
    24  	vd_cnt     uint16 /* Number of associated aux entries */
    25  	vd_hash    uint32 /* Version name hash value */
    26  	vd_aux     uint32 /* Offset in bytes to verdaux array */
    27  	vd_next    uint32 /* Offset in bytes to next verdef entry */
    28  }
    29  
    30  type elfEhdr struct {
    31  	e_ident     [_EI_NIDENT]byte /* Magic number and other info */
    32  	e_type      uint16           /* Object file type */
    33  	e_machine   uint16           /* Architecture */
    34  	e_version   uint32           /* Object file version */
    35  	e_entry     uint32           /* Entry point virtual address */
    36  	e_phoff     uint32           /* Program header table file offset */
    37  	e_shoff     uint32           /* Section header table file offset */
    38  	e_flags     uint32           /* Processor-specific flags */
    39  	e_ehsize    uint16           /* ELF header size in bytes */
    40  	e_phentsize uint16           /* Program header table entry size */
    41  	e_phnum     uint16           /* Program header table entry count */
    42  	e_shentsize uint16           /* Section header table entry size */
    43  	e_shnum     uint16           /* Section header table entry count */
    44  	e_shstrndx  uint16           /* Section header string table index */
    45  }
    46  
    47  type elfPhdr struct {
    48  	p_type   uint32 /* Segment type */
    49  	p_offset uint32 /* Segment file offset */
    50  	p_vaddr  uint32 /* Segment virtual address */
    51  	p_paddr  uint32 /* Segment physical address */
    52  	p_filesz uint32 /* Segment size in file */
    53  	p_memsz  uint32 /* Segment size in memory */
    54  	p_flags  uint32 /* Segment flags */
    55  	p_align  uint32 /* Segment alignment */
    56  }
    57  
    58  type elfShdr struct {
    59  	sh_name      uint32 /* Section name (string tbl index) */
    60  	sh_type      uint32 /* Section type */
    61  	sh_flags     uint32 /* Section flags */
    62  	sh_addr      uint32 /* Section virtual addr at execution */
    63  	sh_offset    uint32 /* Section file offset */
    64  	sh_size      uint32 /* Section size in bytes */
    65  	sh_link      uint32 /* Link to another section */
    66  	sh_info      uint32 /* Additional section information */
    67  	sh_addralign uint32 /* Section alignment */
    68  	sh_entsize   uint32 /* Entry size if section holds table */
    69  }
    70  
    71  type elfDyn struct {
    72  	d_tag int32  /* Dynamic entry type */
    73  	d_val uint32 /* Integer value */
    74  }
    75  
    76  type elfVerdaux struct {
    77  	vda_name uint32 /* Version or dependency names */
    78  	vda_next uint32 /* Offset in bytes to next verdaux entry */
    79  }
    80  

View as plain text