private long resolveRelativeOffset(long val, DwarfDecodeContext context)
			throws MemoryAccessException {
		Program prog = context.getProgram();
		Address addr = context.getAddress();

		AddressSpace ram = prog.getAddressFactory().getDefaultAddressSpace();

		if ((val == 0 || val == addr.getOffset()) && isIndirect) {
			// if val is 0 don't dereference a null pointer
			// if val is unchanged, don't enter a dereference-loop via ptrVal() below
			return val;
		}

		switch (appMode) {
			case DW_EH_PE_absptr:
				// just pass this through
				break;

			case DW_EH_PE_aligned:

				break;

			case DW_EH_PE_datarel:
				val = context.getEhBlock().getStart().add(val).getOffset();
				break;

			case DW_EH_PE_funcrel:
				val = context.getFunctionEntryPoint().add(val).getOffset();
				break;

			case DW_EH_PE_pcrel:
				val = addr.add(val).getOffset();
				break;

			case DW_EH_PE_texrel:
				MemoryBlock txt = prog.getMemory().getBlock(".text");

				val = txt.getStart().add(val).getOffset();
				break;

			default:
				break;

		}

		if (isIndirect) {
			Address toDeref = prog.getAddressFactory().getAddress(ram.getSpaceID(), val);
			val = ptrval(prog, toDeref);
		}

		return val;
	}
Get the DWARF-encoded integer value as stored by the context
@param context Stores program location and decode parameters
@return the integer value
@throws MemoryAccessException if the data can't be read
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/exceptionhandlers/gcc/AbstractDwarfEHDecoder.java