Linker and Link-Time Optimisation (LTO) skill. An agent skill from mohitmishra786/low-level-dev-skills.

MITAuto-check passed

Install Linkers Lto

skills CLI
$ npx skills add mohitmishra786/low-level-dev-skills --skill linkers-lto -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mohitmishra786/low-level-dev-skills linkers-lto --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/binaries/linkers-lto .claude/skills/linkers-lto && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
linkers-lto
GitHub stars
252
Token cost
~1.4k tokens
SKILL.md length
316 words
Files
2 (incl. references)
Skills in repo
138
Repo updated
First seen
Licence
MIT

At a glance

Linker and Link-Time Optimisation (LTO) skill. An agent skill from mohitmishra786/low-level-dev-skills.

  • Works in 9 steps: Linker selection → Essential linker flags → Link order matters (GNU ld) → …
  • Configuring GNU ld
  • SKILL.md covers Purpose, Triggers, Workflow and Related skills
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Linkers Lto is an agent skill from mohitmishra786/low-level-dev-skills. Linker and Link-Time Optimisation (LTO) skill. Use when configuring GNU ld, gold, or lld linker flags, diagnosing link-order issues or undefined symbols at link time, enabling LTO safely in real projects, or understanding inter-module optimisation trade-offs. Activates on queries about linker flags, -flto, thin LTO, LTCG, --gc-sections, link order errors, weak symbols, or linker scripts.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/flags.md`).

The repository describes itself as: A curated suite of AI agent skills for systems and low-level programming with C/C++, Rust, and Zig toolchains, covering compilers, debuggers, profilers, build systems…. The licence is MIT.

When your agent uses it

  • Configuring GNU ld
  • Lld linker flags
  • Diagnosing link-order issues
  • Undefined symbols at link time

Example prompts

  • “/linkers-lto”

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. Linker selection
  2. Essential linker flags
  3. Link order matters (GNU ld)
  4. LTO with GCC
  5. LTO with Clang / lld
  6. Dead-code stripping
  7. Symbol visibility
  8. Common linker errors
  9. Linker map file

What it can do on your machine

Read from SKILL.md and the folder at commit bdc5847. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Linkers Lto loads about 1.4k tokens when it runs, and up to ~3.2k if it reads all its reference files. Until then it costs about 101 tokens; SKILL.md has 316 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~101
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mohitmishra786/low-level-dev-skills at commit bdc5847, republished under its MIT licence (© mohitmishra786). 316 words, ~1,412 tokens.

Download SKILL.mdSave it as .claude/skills/linkers-lto/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
linkers-lto
description
Linker and Link-Time Optimisation (LTO) skill. Use when configuring GNU ld, gold, or lld linker flags, diagnosing link-order issues or undefined symbols at link time, enabling LTO safely in real projects, or understanding inter-module optimisation trade-offs. Activates on queries about linker flags, -flto, thin LTO, LTCG, --gc-sections, link order errors, weak symbols, or linker scripts.

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
bash
# 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
bash
# Pass linker flags via compiler driver:
# -Wl,flag1,flag2   (comma-separated, no spaces)
# -Wl,flag1 -Wl,flag2  (separate -Wl options)

gcc main.c -o prog \
  -Wl,-rpath,/opt/mylibs/lib \     # runtime library search path
  -Wl,--as-needed \                 # only link libraries that are actually used
  -Wl,--gc-sections \               # remove unused sections (requires -ffunction-sections -fdata-sections)
  -Wl,-z,relro \                    # mark relocations read-only after startup
  -Wl,-z,now \                      # resolve all symbols at startup (full RELRO)
  -L/opt/mylibs/lib -lfoo

GNU ld processes archives left-to-right. A library must come after the objects that need it.

bash
# Wrong: libfoo provides symbols needed by main.o
gcc main.o -lfoo libdep.a -o prog   # can fail if libdep.a needs libfoo

# Correct: dependencies after dependents
gcc main.o -lfoo -ldep -o prog

# If there are circular deps between archives:
gcc main.o -Wl,--start-group -lfoo -lbar -Wl,--end-group -o prog
# --start-group/--end-group: repeat search until no new symbols resolved
4. LTO with GCC
bash
# Compile
gcc -O2 -flto -ffunction-sections -fdata-sections -c foo.c -o foo.o
gcc -O2 -flto -ffunction-sections -fdata-sections -c bar.c -o bar.o

# Link (must pass -flto again)
gcc -O2 -flto -Wl,--gc-sections foo.o bar.o -o prog

# Archives: must use gcc-ar / gcc-ranlib, not plain ar
gcc-ar rcs libfoo.a foo.o
gcc-ranlib libfoo.a

Parallel LTO:

bash
gcc -O2 -flto=auto foo.o bar.o -o prog   # uses jobserver
gcc -O2 -flto=4   foo.o bar.o -o prog    # 4 parallel jobs
5. LTO with Clang / lld
bash
# Full LTO
clang -O2 -flto -fuse-ld=lld foo.c bar.c -o prog

# ThinLTO (faster, nearly same quality)
clang -O2 -flto=thin -fuse-ld=lld foo.c bar.c -o prog

# LTO with cmake: set globally
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)   # enables -flto

ThinLTO caches work: subsequent builds that reuse unchanged modules are faster. Cache location: specify with -Wl,--thinlto-cache-dir=/tmp/thinlto-cache.

6. Dead-code stripping
bash
# Compile with per-function/per-data sections
gcc -O2 -ffunction-sections -fdata-sections -c foo.c -o foo.o

# Link with garbage collection
gcc -Wl,--gc-sections foo.o -o prog

# Verify what was removed
gcc -Wl,--gc-sections -Wl,--print-gc-sections foo.o -o prog 2>&1 | head -20

On macOS, the linker strips dead code by default (-dead_strip).

7. Symbol visibility

Controlling visibility reduces DSO size and enables better LTO:

bash
# Hide all symbols by default, export explicitly
gcc -fvisibility=hidden -O2 -shared -fPIC foo.c -o libfoo.so

# In source, mark exports:
__attribute__((visibility("default"))) int my_public_function(void);

Or use a version script:

text
# foo.ver
{
  global: my_public_function; my_other_public;
  local: *;
};
bash
gcc -Wl,--version-script=foo.ver -shared -fPIC -o libfoo.so foo.o
8. Common linker errors
ErrorCauseFix
undefined reference to 'foo'Missing library or wrong orderAdd -lfoo; move after the object that needs it
multiple definition of 'foo'Symbol defined in two TUsRemove duplicate; use static or extern
cannot find -lfooLibrary not in search pathAdd -L/path/to/lib; install dev package
relocation truncatedAddress overflow in relocationUse -mcmodel=large; restructure image
version 'GLIBC_2.33' not foundBinary needs newer glibcLink statically or rebuild on older host
circular referenceArchives mutually dependUse --start-group/--end-group
9. Linker map file
bash
# Generate a map file (shows symbol → section → file)
gcc -Wl,-Map=prog.map -o prog foo.o bar.o
less prog.map

Useful for debugging binary size and symbol placement.

For a comprehensive linker and LTO flags reference, see references/flags.md.

  • Use skills/binaries/elf-inspection for examining the resulting binary
  • Use skills/compilers/gcc or skills/compilers/clang for compile-phase LTO flags
  • Use skills/binaries/binutils for ar, strip, objcopy

© mohitmishra786, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/binaries/linkers-lto of mohitmishra786/low-level-dev-skills.

  • SKILL.md
  • references/flags.md

Open the folder on GitHubat commit bdc5847

Compare with similar skills

Linkers Lto next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Linkers Lto compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Linkers Lto this skillmohitmishra786/low-level-dev-skills252—~1.4kAutomated safety check: PassMIT
Configure Channelopenclaw/openclaw392k—~946Automated safety check: PassMIT
Internal Linksthedaviddias/Front-End-Checklist74k—~770Automated safety check: PassMIT
External Linksthedaviddias/Front-End-Checklist74k—~773Automated safety check: PassMIT
Invalid Linksthedaviddias/Front-End-Checklist74k—~806Automated safety check: PassMIT
ConfigurationBuilderIO/agent-native7.1k—~2.1kAutomated safety check: PassNone

Similar skills

  • Configure Channel

    openclaw/openclaw

    Configure and prove a chat channel with non-interactive one-liners; secrets only as SecretRefs.

    392k GitHub stars~946 tokensUpdated today
    Auto-check passed
  • Internal Links

    thedaviddias/Front-End-Checklist

    A skill your agent uses when auditing a site's internal link structure, identifying pages that need more incoming links, generating contextual linking opportunities between related content, or…

    74k GitHub stars~770 tokensUpdated 5 days ago
    Marketing & SEOAuto-check passed
  • External Links

    thedaviddias/Front-End-Checklist

    A skill your agent uses when auditing content pages for citation quality, suggesting authoritative sources to link for factual claims, or reviewing whether a page's external link attributes…

    74k GitHub stars~773 tokensUpdated 5 days ago
    Research & ScienceAuto-check passed
  • Invalid Links

    thedaviddias/Front-End-Checklist

    A skill your agent uses when auditing a page's link elements for crawlability, reviewing JavaScript-heavy SPAs where navigation may not use <a href tags, or checking that dynamically generated links…

    74k GitHub stars~806 tokensUpdated 5 days ago
    Marketing & SEOAuto-check passed
  • Configuration

    BuilderIO/agent-native

    Where a configuration value belongs — app config schema, agent-native.config.ts, or an environment variable — and how the layers resolve.

    7.1k GitHub stars~2.1k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • SEO Aeo Internal Linking

    sickn33/agentic-awesome-skills

    Maps internal link opportunities between pages with relevant anchor text, placement instructions, orphan-page detection, and cannibalisation checks.

    47k GitHub starsUsed in 1 repo~2.3k tokens
    Marketing & SEOAuto-check passed

More from mohitmishra786/low-level-dev-skills

All 138 skills in this repo
  • ARM and AArch64 Assembly

    mohitmishra786/low-level-dev-skills

    Guides reading and writing AArch64 and ARM Thumb assembly: compiler output, inline asm, registers, the AAPCS calling convention and NEON or SVE basics.

    252 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • RISC-V Assembly Guide

    mohitmishra786/low-level-dev-skills

    Reference for RISC-V assembly on RV32 and RV64: register names and calling convention, extension naming, GCC and Clang inline asm, and QEMU with GDB debugging.

    252 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • x86-64 Assembly Reference

    mohitmishra786/low-level-dev-skills

    Explains x86-64 registers, the System V AMD64 calling convention, and how to read compiler-generated or inline assembly.

    252 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Bazel for C and C++

    mohitmishra786/low-level-dev-skills

    Guides your agent through Bazel for C/C++ projects: BUILD files, Bzlmod dependencies, toolchain registration, remote execution, dependency queries and sandbox debugging.

    252 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Binary Hardening

    mohitmishra786/low-level-dev-skills

    Binary hardening skill for security-hardened C/C++ builds. An agent skill from mohitmishra786/low-level-dev-skills.

    252 GitHub stars~2k tokensUpdated 3 mo ago
    Auto-check passed
  • Binutils

    mohitmishra786/low-level-dev-skills

    GNU binutils skill for binary manipulation and analysis. An agent skill from mohitmishra786/low-level-dev-skills.

    252 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Linkers Lto

What does Linkers Lto do?

Linker and Link-Time Optimisation (LTO) skill. An agent skill from mohitmishra786/low-level-dev-skills. Linkers Lto is an agent skill from mohitmishra786/low-level-dev-skills. Linker and Link-Time Optimisation (LTO) skill.

When should I use Linkers Lto?

Linkers Lto fits situations like: configuring GNU ld; lld linker flags; diagnosing link-order issues; undefined symbols at link time.

How do I install Linkers Lto in Claude Code?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill linkers-lto -a claude-code`. Or copy the skill folder (skills/binaries/linkers-lto in mohitmishra786/low-level-dev-skills) into .claude/skills/linkers-lto in your project. Claude Code loads it when a task matches its description.

How do I install Linkers Lto in Codex?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill linkers-lto -a codex`. Or copy the skill folder (skills/binaries/linkers-lto in mohitmishra786/low-level-dev-skills) into .agents/skills/linkers-lto in your project. Codex loads it when a task matches its description.

Can I use Linkers Lto in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mohitmishra786/low-level-dev-skills --skill linkers-lto -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/linkers-lto, .gemini/skills/linkers-lto, .github/skills/linkers-lto and .opencode/skills/linkers-lto in your project.

What does Linkers Lto need to run?

SKILL.md names no scripts, command-line tools or credentials: Linkers Lto is instructions for the agent only.

Does Linkers Lto access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Linkers Lto safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Linkers Lto use?

Linkers Lto is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Linkers Lto use?

About 1.4k tokens (SKILL.md is roughly 5.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.8k tokens, read only when the agent opens those files.

What are the alternatives to Linkers Lto?

Skills that share tags, products or a category with Linkers Lto: Configure Channel (openclaw/openclaw, 392k stars), Internal Links (thedaviddias/Front-End-Checklist, 74k stars), External Links (thedaviddias/Front-End-Checklist, 74k stars) and Invalid Links (thedaviddias/Front-End-Checklist, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Linkers Lto?

mohitmishra786 (a GitHub user) maintains it in mohitmishra786/low-level-dev-skills, which has 252 GitHub stars. The repository holds 138 skills in this directory. The repository was last updated on June 27, 2026.

Source: mohitmishra786/low-level-dev-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.