go/src/cmd/link/internal/ld/elf.go

type elfNote

const ARM_MAGIC_TRAMP_NUMBER

type ElfEhdr

type ElfShdr

type ElfPhdr

const ELF64HDRSIZE

const ELF64PHDRSIZE

const ELF64SHDRSIZE

const ELF64RELSIZE

const ELF64RELASIZE

const ELF64SYMSIZE

const ELF32HDRSIZE

const ELF32PHDRSIZE

const ELF32SHDRSIZE

const ELF32SYMSIZE

const ELF32RELSIZE

var (
	elfstrdat
	elfshstrdat
)

const ELFRESERVE

const NSECT

var Nelfsym

var elf64

var elfRelType

var ehdr

var phdr

var shdr

var interp

type ELFArch

type Elfstring

var elfstr

var nelfstr

var buildinfo

/*
Initialize the global variable that describes the ELF header. It will be updated as
we write section and prog headers.
*/
func Elfinit(ctxt *Link) {}

// Make sure PT_LOAD is aligned properly and
// that there is no gap,
// correct ELF loaders will do this implicitly,
// but buggy ELF loaders like the one in some
// versions of QEMU and UPX won't.
func fixElfPhdr(e *ElfPhdr) {}

func elf64phdr(out *OutBuf, e *ElfPhdr) {}

func elf32phdr(out *OutBuf, e *ElfPhdr) {}

func elf64shdr(out *OutBuf, e *ElfShdr) {}

func elf32shdr(out *OutBuf, e *ElfShdr) {}

func elfwriteshdrs(out *OutBuf) uint32 {}

func elfsetstring(ctxt *Link, s loader.Sym, str string, off int) {}

func elfwritephdrs(out *OutBuf) uint32 {}

func newElfPhdr() *ElfPhdr {}

func newElfShdr(name int64) *ElfShdr {}

func getElfEhdr() *ElfEhdr {}

func elf64writehdr(out *OutBuf) uint32 {}

func elf32writehdr(out *OutBuf) uint32 {}

func elfwritehdr(out *OutBuf) uint32 {}

/* Taken directly from the definition document for ELF64. */
func elfhash(name string) uint32 {}

func elfWriteDynEntSym(ctxt *Link, s *loader.SymbolBuilder, tag elf.DynTag, t loader.Sym) {}

func Elfwritedynent(arch *sys.Arch, s *loader.SymbolBuilder, tag elf.DynTag, val uint64) {}

func Elfwritedynentsymplus(ctxt *Link, s *loader.SymbolBuilder, tag elf.DynTag, t loader.Sym, add int64) {}

func elfwritedynentsymsize(ctxt *Link, s *loader.SymbolBuilder, tag elf.DynTag, t loader.Sym) {}

func elfinterp(sh *ElfShdr, startva uint64, resoff uint64, p string) int {}

func elfwriteinterp(out *OutBuf) int {}

const MIPS_FPABI_NONE

const MIPS_FPABI_ANY

const MIPS_FPABI_SINGLE

const MIPS_FPABI_SOFT

const MIPS_FPABI_HIST

const MIPS_FPABI_FPXX

const MIPS_FPABI_FP64

const MIPS_FPABI_FP64A

func elfMipsAbiFlags(sh *ElfShdr, startva uint64, resoff uint64) int {}

// Layout is given by this C definition:
//
//	typedef struct
//	{
//	  /* Version of flags structure.  */
//	  uint16_t version;
//	  /* The level of the ISA: 1-5, 32, 64.  */
//	  uint8_t isa_level;
//	  /* The revision of ISA: 0 for MIPS V and below, 1-n otherwise.  */
//	  uint8_t isa_rev;
//	  /* The size of general purpose registers.  */
//	  uint8_t gpr_size;
//	  /* The size of co-processor 1 registers.  */
//	  uint8_t cpr1_size;
//	  /* The size of co-processor 2 registers.  */
//	  uint8_t cpr2_size;
//	  /* The floating-point ABI.  */
//	  uint8_t fp_abi;
//	  /* Processor-specific extension.  */
//	  uint32_t isa_ext;
//	  /* Mask of ASEs used.  */
//	  uint32_t ases;
//	  /* Mask of general flags.  */
//	  uint32_t flags1;
//	  uint32_t flags2;
//	} Elf_Internal_ABIFlags_v0;
func elfWriteMipsAbiFlags(ctxt *Link) int {}

func elfnote(sh *ElfShdr, startva uint64, resoff uint64, sizes ...int) int {}

func elfwritenotehdr(out *OutBuf, str string, namesz uint32, descsz uint32, tag uint32) *ElfShdr {}

const ELF_NOTE_NETBSD_NAMESZ

const ELF_NOTE_NETBSD_DESCSZ

const ELF_NOTE_NETBSD_TAG

const ELF_NOTE_NETBSD_VERSION

var ELF_NOTE_NETBSD_NAME

func elfnetbsdsig(sh *ElfShdr, startva uint64, resoff uint64) int {}

func elfwritenetbsdsig(out *OutBuf) int {}

func elfnetbsdpax(sh *ElfShdr, startva uint64, resoff uint64) int {}

func elfwritenetbsdpax(out *OutBuf) int {}

const ELF_NOTE_OPENBSD_NAMESZ

const ELF_NOTE_OPENBSD_DESCSZ

const ELF_NOTE_OPENBSD_TAG

const ELF_NOTE_OPENBSD_VERSION

var ELF_NOTE_OPENBSD_NAME

func elfopenbsdsig(sh *ElfShdr, startva uint64, resoff uint64) int {}

func elfwriteopenbsdsig(out *OutBuf) int {}

const ELF_NOTE_FREEBSD_NAMESZ

const ELF_NOTE_FREEBSD_DESCSZ

const ELF_NOTE_FREEBSD_ABI_TAG

const ELF_NOTE_FREEBSD_NOINIT_TAG

const ELF_NOTE_FREEBSD_FEATURE_CTL_TAG

const ELF_NOTE_FREEBSD_VERSION

const ELF_NOTE_FREEBSD_FCTL_ASLR_DISABLE

const ELF_NOTE_FREEBSD_NAME

func elffreebsdsig(sh *ElfShdr, startva uint64, resoff uint64) int {}

// elfwritefreebsdsig writes FreeBSD .note section.
//
// See https://www.netbsd.org/docs/kernel/elf-notes.html for the description of
// a Note element format and
// https://github.com/freebsd/freebsd-src/blob/main/sys/sys/elf_common.h#L790
// for the FreeBSD-specific values.
func elfwritefreebsdsig(out *OutBuf) int {}

func addbuildinfo(ctxt *Link) {}

const ELF_NOTE_BUILDINFO_NAMESZ

const ELF_NOTE_BUILDINFO_TAG

var ELF_NOTE_BUILDINFO_NAME

func elfbuildinfo(sh *ElfShdr, startva uint64, resoff uint64) int {}

func elfgobuildid(sh *ElfShdr, startva uint64, resoff uint64) int {}

func elfwritebuildinfo(out *OutBuf) int {}

func elfwritegobuildid(out *OutBuf) int {}

const ELF_NOTE_GOPKGLIST_TAG

const ELF_NOTE_GOABIHASH_TAG

const ELF_NOTE_GODEPS_TAG

const ELF_NOTE_GOBUILDID_TAG

var ELF_NOTE_GO_NAME

var elfverneed

type Elfaux

type Elflib

func addelflib(list **Elflib, file string, vers string) *Elfaux {}

func elfdynhash(ctxt *Link) {}

func elfphload(seg *sym.Segment) *ElfPhdr {}

func elfphrelro(seg *sym.Segment) {}

func elfshname(name string) *ElfShdr {}

// Create an ElfShdr for the section with name.
// Create a duplicate if one already exists with that name.
func elfshnamedup(name string) *ElfShdr {}

func elfshalloc(sect *sym.Section) *ElfShdr {}

func elfshbits(linkmode LinkMode, sect *sym.Section) *ElfShdr {}

func elfshreloc(arch *sys.Arch, sect *sym.Section) *ElfShdr {}

func elfrelocsect(ctxt *Link, out *OutBuf, sect *sym.Section, syms []loader.Sym) {}

func elfEmitReloc(ctxt *Link) {}

func addgonote(ctxt *Link, sectionName string, tag uint32, desc []byte) {}

func (ctxt *Link) doelf() {}

// Do not write DT_NULL.  elfdynhash will finish it.
func shsym(sh *ElfShdr, ldr *loader.Loader, s loader.Sym) {}

func phsh(ph *ElfPhdr, sh *ElfShdr) {}

func Asmbelfsetup() {}

func asmbElf(ctxt *Link) {}

func elfadddynsym(ldr *loader.Loader, target *Target, syms *ArchSyms, s loader.Sym) {}