Long branches in compilers, assemblers, and linkers
Summary
Long branches impose constraints on PC-relative branches across architectures. The article explains how compilers, assemblers, and linkers collaborate to resolve out-of-range branches via branch relaxation, instruction relaxation, and range-extension thunks. It also covers per-architecture limits and various linker approaches (lld, Mach-O, mold, GNU ld) for handling large binaries.