private long fixup(long fileOffset, long adjustment, int size, SegmentCommand segment)
			throws IOException, IllegalArgumentException {
		if (size != 4 && size != 8) {
			throw new IllegalArgumentException("Size must be 4 or 8 (got " + size + ")");
		}
		long value = reader.readUnsignedValue(fileOffset, size);
		long ret = value;
		value += adjustment;

		try {
			ret = getPackedOffset(value, segment);
			byte[] newBytes = toBytes(ret, size);
			System.arraycopy(newBytes, 0, packed, (int) getPackedOffset(fileOffset, textSegment),
				newBytes.length);
		}
		catch (NotFoundException e) {
			Msg.warn(this, e.getMessage());
		}

		return ret;
	}
Fixes up the bytes at the given container file offset to map to the correct offset in the
packed Mach-O.  The provided file offset is assumed to map to a field in a load command.
 
@param fileOffset The container file offset to fix-up
@param adjustment A value to add to the bytes at the given container file offset prior to 
  looking them up in the packed Mach-O
@param size The number of bytes to fix-up (must be 4 or 8)
@param segment The segment that the value at the file offset is associated with
@return The newly fixed up value (or the original value if there was a graceful failure)
@throws IOException If there was an IO-related error
@throws IllegalArgumentException if size is an unsupported value
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/ios/ExtractedMacho.java