func (x addrRange) hasAddr(addr uint32) bool {
	return x.addr <= addr && addr <= x.addr+x.size
}
hasAddr returns true if the range contains the given address, or if the
address is one past the end of the range.
package elf
import (
	"bytes"
	"debug/elf"
	"encoding/binary"
	"errors"
	"fmt"
	"io"
	"moria.us/elf2dos/module"
)
const objAbsolute int32 = int32(^uint32(0) >> 1)
type wrappedError struct {
	location string
	inner    error
}
func (e *wrappedError) Error() string {
	return fmt.Sprintf("%s: %v", e.location, e.inner)
}
func wrapError(e error, loc string) error {
	if we, ok := e.(*wrappedError); ok {
		return &wrappedError{
			location: loc + ": " + we.location,
			inner:    we.inner,
		}
	}
	return &wrappedError{
		location: loc,
		inner:    e,
	}
}
func wrapErrorf(e error, f string, a ...interface{}) error {
	return wrapError(e, fmt.Sprintf(f, a...))
}
func wrapErrorSection(e error, i int, s *elf.Section) error {
	return wrapErrorf(e, "section %d %q", i, s.Name)
}
func wrapErrorSegment(e error, i int) error {
	return wrapErrorf(e, "segment %d", i)
}
const ptGNUEHFrame elf.ProgType = 0x6474e551
type addrRange struct {
	addr uint32
	size uint32
}