ElfRelocation getHi20Relocation(ElfSymbol hi20Symbol) {

		Long symValue = hi20Symbol.getValue();

		// Search for first relocation within table whose offset matches the specified hi20Symbol value
		ElfRelocation[] relocations = relocationTable.getRelocations();
		int relIndex = Arrays.binarySearch(relocations, symValue, OffsetComparator.INSTANCE);
		if (relIndex < 0) {
			return null; // relocation not found
		}
		// back-up in the event there is more than one matching relocation offset
		while (relIndex > 0 && relocations[relIndex - 1].getOffset() == symValue) {
			--relIndex;
		}
		// look for hi20 relocation
		while (relIndex < relocations.length && relocations[relIndex].getOffset() == symValue) {
			int typeId = relocations[relIndex].getType();
			if ((typeId == RISCV_ElfRelocationType.R_RISCV_PCREL_HI20.typeId) ||
				(typeId == RISCV_ElfRelocationType.R_RISCV_GOT_HI20.typeId)) {
				return relocations[relIndex];
			}
			++relIndex;
		}
		return null;
	}
Find the HI20 relocation whose offset matches the value of the specified symbol.
@param hi20Symbol ELF symbol which corresponds to HI20 relocation
@return matching relocation or null if not found
Ghidra/Processors/RISCV/src/main/java/ghidra/app/util/bin/format/elf/relocation/RISCV_ElfRelocationContext.java