Understanding the Go Compiler: The Linker

Go’s linker explained — readers split: “just a linker,” “too big,” “I love Go”

TLDR: A friendly explainer shows how Go’s linker stitches code together, removes unused parts, and makes a single, runnable app. Comments erupted into a size debate—some say Go binaries are chunky while praising TinyGo—while a former skeptic professed new love for Go’s reliability, reigniting the “convenience vs. kilobytes” fight.

The article breaks down Go’s “linker” in plain terms: it glues many compiled pieces together, fixes all the addresses, throws away unused bits, and spits out a single app your computer can run. But the comments stole the show. One reader shrugged, basically saying, “so it’s just a normal linker?” Another lit up the size debate, claiming Go apps feel chunky even with code trimming turned on, while shouting out TinyGo for making tiny builds. Meanwhile, a longtime skeptic showed up with a plot twist: after years of reluctance, they now love Go for backend work, calling it “bulletproof.”

That spark set off a classic internet split: skeptics versus converts. On one side, “what’s special here?” On the other, “the simplicity and reliability are the point.” Size-shamers argued that Go’s “hello world” is hefty; defenders replied that Go tends to pack everything into one self-contained file (handy for deployment), which naturally weighs more. Cue the light ribbing about “thicc binaries” and the eternal trade-off: convenience vs. kilobytes.

Bottom line: the explainer aimed to demystify linking, but the crowd turned it into a vibes check on Go itself—is it boring-but-solid or big-and-basic? Depends which comment you click.

Key Points

  • The Go linker combines per-package object files (.o) into a single executable the OS can run.
  • It performs four main tasks: symbol resolution, relocation, dead code elimination, and layout/executable generation.
  • Object files contain defined and referenced symbols plus relocations; the linker connects cross-file references.
  • Relocation patches placeholder addresses after final code/data layout is determined.
  • The output format is OS-specific: ELF (Linux), Mach‑O (macOS), and PE (Windows).

Hottest takes

"I can see no difference to an ordinary linker." — Surac
"Go binaries have large minimal size" — hbogert
"I’ve grown to love golang for backend web work." — jjcm
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.