This goes all the way back to OPTASM in the 80s, if not earlier:
http://archives.scovetta.com/pub/walnut-creek/JSAGE/ZNODE3/I...
https://books.google.com/books?id=FC-L2faxEVkC&pg=PA43&lpg=P...
FASM is well known for this too:
https://en.wikipedia.org/wiki/FASM#Design
Essentially, the byte array holding the instruction has to be re-allocated because it has to grow larger
No it doesn't - just do one pass to figure out the maximum size (i.e. all instructions are the longest variant), and allocate a buffer of that size. You can be somewhat more intelligent by not increasing the size for the jumps that won't ever grow - e.g. backward ones ones whose target has been resolved already, and there aren't enough possibly-growing jumps between it and the current position to overflow the offset. Now iterate the code generation, moving the necessary bytes in the buffer forward when you hit a forward reference that's too far, until you reach the end. All done and ready to output, without any excess copying or messing around with linked lists. That's what the older assemblers which had this optimisation did, and they were plenty fast. (Rule of thumb: pointer chasing and small allocations are bad. Arrays and big blocks are good.)