private byte[] createPackedLinkEditSegment(ByteProvider linkEditSegmentProvider,
			int packedLinkEditSize) throws IOException {
		byte[] packedLinkEdit = new byte[packedLinkEditSize];

		for (LoadCommand cmd : packedLinkEditDataStarts.keySet()) {
			if (cmd instanceof SymbolTableCommand symbolTable &&
				symbolTable.getNumberOfSymbols() > 0) {
				List<NList> symbols = symbolTable.getSymbols();
				byte[] packedSymbolStringTable = new byte[NList.getSize(symbols)];
				int nlistIndex = 0;
				int stringIndexOrig = symbols.get(0).getSize() * symbols.size();
				int stringIndex = stringIndexOrig + 1; // First byte is always 0
				for (NList nlist : symbols) {
					byte[] nlistArray = nlistToArray(nlist, stringIndex - stringIndexOrig);
					byte[] stringArray = nlist.getString().getBytes(StandardCharsets.US_ASCII);
					System.arraycopy(nlistArray, 0, packedSymbolStringTable, nlistIndex,
						nlistArray.length);
					System.arraycopy(stringArray, 0, packedSymbolStringTable, stringIndex,
						stringArray.length);
					nlistIndex += nlistArray.length;
					stringIndex += stringArray.length + 1; // null terminate
				}
				System.arraycopy(packedSymbolStringTable, 0, packedLinkEdit,
					packedLinkEditDataStarts.get(cmd), packedSymbolStringTable.length);
			}
			else {
				byte[] bytes = linkEditSegmentProvider.readBytes(cmd.getLinkerDataOffset(),
					cmd.getLinkerDataSize());
				System.arraycopy(bytes, 0, packedLinkEdit, packedLinkEditDataStarts.get(cmd),
					bytes.length);
			}
		}

		return packedLinkEdit;
	}
Creates a packed __LINKEDIT segment array

@param linkEditSegmentProvider The {@link ByteProvider} that contains the __LINKEDIT
  segment
@param packedLinkEditSize The size in bytes of the packed __LINKEDIT segment
@return A packed __LINKEDIT segment array
@throws IOException If there was an IO-related error
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/ios/ExtractedMacho.java