Solid reference for when you're wrestling with undefined references, trying to enable LTO without breaking your build, or figuring out why your binary is bloated. Covers GNU ld, gold, and lld selection, the left-to-right link order gotcha that bites everyone, and the full LTO setup for both GCC and Clang including ThinLTO. The symbol visibility and --gc-sections sections are especially practical. It won't teach you linker theory, but if you need to know whether to use --start-group or how to generate a map file to debug where your symbols went, it's all here in working examples.

skills.sh installs
663
GitHub stars
279
last updated
Aug 21, 2026

Install

$ npx -y skills add mohitmishra786/low-level-dev-skills --skill linkers-lto --agent claude-code

Installs into .claude/skills of the current project.

Files

Linkers and LTO

Purpose

Guide agents through linker selection, common linker flags, link-order issues, LTO setup, and symbol-visibility management.

Triggers

  • "I'm getting undefined reference at link time"
  • "How do I enable LTO for a real project?"
  • "Which linker should I use: ld, gold, or lld?"
  • "How do I reduce binary size with --gc-sections?"
  • "How do I write or understand a linker script?"
  • "I have duplicate symbol or weak symbol issues"

Workflow

1. Linker selection

LinkerInvocationStrengths
GNU ld (BFD)default on LinuxUniversal, stable
gold-fuse-ld=goldFaster than ld for C++; supports LTO plugins
lld (LLVM)-fuse-ld=lldFastest, parallel, required for Clang LTO
# Use lld with GCC or Clang
gcc -fuse-ld=lld -o prog ...
clang -fuse-ld=lld -o prog ...

# Check which linker is used
gcc -v -o prog main.c 2>&1 | grep 'Invoking'

2. Essential linker flags

# Pass linker flags via compiler driver:
# -Wl,flag1,flag2   (comma-separated, no spaces)
# -Wl,flag1 -Wl,flag2  (separate -Wl options)

Sponsors

Details

Repository
github.com/mohitmishra786/low-level-dev-skills
First seen
Jun 3, 2026

More from mohitmishra786/low-level-dev-skills

All 54

Recommended

1juliusbrussee avatarcavemanjuliusbrussee/cavemanUltra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman while keeping full technical accuracy. Supports intensity levels618.3Kskills.sh installs
2mattpocock avatargrill-memattpocock/skillsA relentless interview to sharpen a plan or design.1.5Mskills.sh installs
3shadcn avatarimproveshadcn/improveSurvey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on s40Kskills.sh installs
4obra avatarsystematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes326.7Kskills.sh installs
5forrestchang avatarkarpathy-guidelinesforrestchang/andrej-karpathy-skillsBehavioral guidelines to reduce common LLM coding mistakes through explicit assumptions, simplicity, and verifiable success criteria.17.9Kskills.sh installs
6vercel-labs avatarfind-skillsvercel-labs/skillsHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express int4.3Mskills.sh installs