@Override
	public boolean added(Program program, AddressSetView functionSet, TaskMonitor monitor,
			MessageLog log) {
		SymbolTable symbolTable = program.getSymbolTable();
		Listing listing = program.getListing();
		ReferenceManager referenceManager = program.getReferenceManager();
		Symbol tocSymbol = SymbolUtilities.getExpectedLabelOrFunctionSymbol(program,
			PefConstants.TOC, err -> log.error(getName(), err));
		if (tocSymbol == null) {
			return true;
		}
		AddressSet instructionSet =
			getInstructionSet(program, functionSet, listing, tocSymbol, monitor);
		InstructionIterator instructions = listing.getInstructions(instructionSet, true);
		while (instructions.hasNext()) {
			if (monitor.isCancelled()) {
				break;
			}
			Instruction instruction = instructions.next();
			if (instruction.getNumOperands() != 2) {
				continue;
			}
			Object[] operandObjects1 = instruction.getOpObjects(1);//op objects from 1st operand
			if (operandObjects1.length != 2) {
				continue;
			}
			if (!(operandObjects1[0] instanceof Scalar)) {
				continue;
			}
			if (!(operandObjects1[1] instanceof Register)) {
				continue;
			}
			Register register = (Register) operandObjects1[1];
			if (!register.getName().equals("r2")) {
				continue;
			}
			Scalar scalar = (Scalar) operandObjects1[0];
			Address destAddr = createReference(referenceManager, tocSymbol, instruction, scalar);
			markupGlueCode(listing, symbolTable, instruction, destAddr);
		}
		return true;
	}
Creates a reference on any operand that uses
reads an offset from r2.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/PefAnalyzer.java