LINEUP & SCHEDULE

Rust Unlinked - a Journey Through `rustc`, Linkers, Symbols, and Static Libraries

  • Track A

  • 16:35 - 17:30 (JST)

    • Session Language: English

Understanding Linking is crucial because large Rust projects can spend roughly 50% of build time in linking. If you have ever wondered how the rust compiler, linker, loader, and operating system work together to run your Rust program - this talk might spark your interest. In this talk, Shriram will share a high level overview of the rust compilation pipeline, how the compiler is changing to become demand driven, how rustc uses LLVM, what goes inside a linker, what’s inside the object files, what do the link-time optimization flags mean, why rust prefers static linking, and are there ways to do dynamic linking.

By the end of the talk, you should have a better understanding of how Rust programs are linked, and how the linker magically makes everything fit together like pieces of a puzzle.

Here’s what we’ll cover:

  • Why understanding linking is important?
  • Rust Compilation: A High-Level Overview
    • What is Demand Driven Compilation a.k.a Query Based Compilation?
  • Object Files: What’s inside them? (ELF Format)
  • Symbol Resolution: How the linker matches variable and function names to their memory addresses.
  • A simple program to check if we can invoke the linker directly on object files instead of using cargo
  • Link Time Optimization: How the linker can optimize your code at link time.
  • Why Rust Prefers Static Linking?
    • Understanding ABI
    • Taking a “Stabby” - a Stable ABI for Rust?
  • Experiments with Dynamic Linking

Share it on


Bio

Shriram Balaji

Shriram Balaji

Senior Software Engineer at Microsoft tinkering with systems languages, databases and things on the web


Copyright © Rust.Tokyo 2024 all rights reserved.


特定商取引法に基づく表示

ぜひフォローしてください! @rustlang_tokyo

お問い合わせ: rust-tokyo-staff@googlegroups.com

過去の開催