const SHT_ARM_ATTRIBUTES … type ElfSect … type ElfObj … type ElfSym … const TagFile … const TagCPUName … const TagCPURawName … const TagCompatibility … const TagNoDefaults … const TagAlsoCompatibleWith … const TagABIVFPArgs … type elfAttribute … type elfAttributeList … func (a *elfAttributeList) string() string { … } func (a *elfAttributeList) uleb128() uint64 { … } // Read an elfAttribute from the list following the rules used on ARM systems. func (a *elfAttributeList) armAttr() elfAttribute { … } func (a *elfAttributeList) done() bool { … } // Look for the attribute that indicates the object uses the hard-float ABI (a // file-level attribute with tag Tag_VFP_arch and value 1). Unfortunately the // format used means that we have to parse all of the file-level attributes to // find the one we are looking for. This format is slightly documented in "ELF // for the ARM Architecture" but mostly this is derived from reading the source // to gold and readelf. func parseArmAttributes(e binary.ByteOrder, data []byte) (found bool, ehdrFlags uint32, err error) { … } // Load loads the ELF file pn from f. // Symbols are installed into the loader, and a slice of the text symbols is returned. // // On ARM systems, Load will attempt to determine what ELF header flags to // emit by scanning the attributes in the ELF file being loaded. The // parameter initEhdrFlags contains the current header flags for the output // object, and the returned ehdrFlags contains what this Load function computes. // TODO: find a better place for this logic. func Load(l *loader.Loader, arch *sys.Arch, localSymVersion int, f *bio.Reader, pkg string, length int64, pn string, initEhdrFlags uint32) (textp []loader.Sym, ehdrFlags uint32, err error) { … } func section(elfobj *ElfObj, name string) *ElfSect { … } func elfmap(elfobj *ElfObj, sect *ElfSect) (err error) { … } func readelfsym(l *loader.Loader, arch *sys.Arch, elfobj *ElfObj, i int, elfsym *ElfSym, needSym int, localSymVersion int) (err error) { … } // Return the size of the relocated field, and the size of the addend as the first // and second values. Note, the addend may be larger than the relocation field in // some cases when a relocated value is split across multiple relocations. func relSize(arch *sys.Arch, pn string, elftype uint32) (uint8, uint8, error) { … } func cstring(x []byte) string { … }