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