def find_relocation(func, start, end):
	"""
	Finds a relocation from `start` to `end`. If `start`==`end`, then they will be expanded to the closest instruction boundary
	:param func: function start and end are contained in
	:param start: start address
	:param end: end address
	:return: corrected start and end addresses for the relocation
	"""

	if end != start: # relocation isn't stupid
		return start, end - start
	# relocation is stupid (start==end), so just expand to the whole instruction
	bb = func.get_basic_block_at(start)
	if not bb: # not in a basicblock, don't care.
		return None, None
	bb._buildStartCache()
	for i, insn_start in enumerate(bb._instStarts):
		insn_end = insn_start + bb._instLengths[i]
		if (insn_start < end and start < insn_end) or (start == end and insn_start <= start < insn_end):
			return insn_start, bb._instLengths[i]