You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: elf.go
    path of file: ./repos/fq/format/elf
    
    the code of the file until where you have to start completion: package elf

// https://refspecs.linuxbase.org/elf/gabi4+/contents.html
// https://man7.org/linux/man-pages/man5/elf.5.html
// https://github.com/torvalds/linux/blob/master/include/uapi/linux/elf.h
// https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=include/elf/external.h;hb=HEAD

// TODO: dwarf

import (
	"strings"

	"github.com/wader/fq/format"
	"github.com/wader/fq/pkg/decode"
	"github.com/wader/fq/pkg/interp"
	"github.com/wader/fq/pkg/scalar"
)

func init() {
	interp.RegisterFormat(
		format.ELF,
		&decode.Format{
			Description: "Executable and Linkable Format",
			Groups:      []*decode.Group{format.Probe},
			DecodeFn:    elfDecode,
		})
}

const (
	LITTLE_ENDIAN = 1
	BIG_ENDIAN    = 2
)

var endianNames = scalar.UintMapSymStr{
	LITTLE_ENDIAN: "little_endian",
	BIG_ENDIAN:    "big_endian",
}

var classBits = scalar.UintMapSymUint{
	1: 32,
	2: 64,
}

const (
	CLASS_32 = 1
	CLASS_64 = 2
)

var osABINames = scalar.UintMapSymStr{

    
func elfReadSectionHeaders(d *decode.D, ec *elfContext) {
	for i := 0; i < ec.shNum; i++ {
		d.SeekAbs(ec.shOff + int64(i)*ec.shEntSize)
		var sh sectionHeader

		switch ec.archBits {
		case 32:
			sh.name = int(d.U32())
			sh.typ = int(d.U32())
			d.U32()                      // flags
			sh.addr = int64(d.U32() * 8) // addr
			sh.offset = int64(d.U32()) * 8
			sh.size = int64(d.U32()) * 8
			d.U32() // link
			d.U32() // info
			d.U32() // addralign
			sh.entSize = int64(d.U32()) * 8
		case 64:
			sh.name = int(d.U32())
			sh.typ = int(d.U32())
			d.U64()                      // addr
			sh.addr = int64(d.U64() * 8) // flags
			sh.offset = int64(d.U64()) * 8
			sh.size = int64(d.U64()) * 8
			d.U32() // link
			d.U32() // info
			d.U64() // addralign
			sh.entSize = int64(d.U64()) * 8
		default:
			panic("unreachable")
		}

		switch sh.typ {
		case SHT_DYNAMIC:
			d.SeekAbs(sh.offset)
			sh.dc = elfReadDynamicTags(d, ec)
		case SHT_SYMTAB:
			d.SeekAbs(sh.offset)
			sh.symbols = elfReadSymbolTable(d, ec, sh)
		}

		ec.sections = append(ec.sections, sh)
	}

	// for dynamic linking sections find offset to string table by looking up
	// section by address using string stable address
	for i := range ec.sections {
		sh := &ec.sections[i]
		if sh.typ != SHT_DYNAMIC {
			continue
		}
		if i, ok := ec.sectionIndexByAddr(sh.dc.strTabPtr); ok {
			strTabSh := ec.sections[i]
			sh.dc.strTab = readStrTab(d, strTabSh.offset, sh.dc.strSzVal/8)
		}
	}

	// provide default empty string tables to be more robust
	ec.strTabMap = map[string]string{
		STRTAB_DYNSTR:   "",
		STRTAB_SHSTRTAB: "",
		STRTAB_STRTAB:   "",
	}
	var shStrTab string
	if ec.shStrNdx < len(ec.sections) {
		shStr := ec.sections[ec.shStrNdx]
		shStrTab = readStrTab(d, shStr.offset, shStr.size/8)

		for _, sh := range ec.sections {
			if sh.typ != SHT_STRTAB {
				continue
			}
			ec.strTabMap[strIndexNull(sh.name, shStrTab)] = readStrTab(d, sh.offset, sh.size/8)
		}
	}
}