SlideShare a Scribd company logo
1 of 13
Download to read offline
GCC LTO
f1.c
f2.c
test.c
f1.o
f2.o
test.o
compile&
assemble
compile&
assemble
compile&
assemble
linker test
gcc -flto -c f1.c
gcc -flto -c f2.c
gcc -flto -c test.c
gcc -flto f1.o f2.o test.o -o test
f1.c
f2.c
test.c
LGEN
LGEN
LGEN
f1.o
f2.o
test.o
WPA
test.ltrans0.o
test.ltrans1.o
cc1 -flto -c f1.c
cc1 -flto -c f2.c
cc1 -flto -c test.c
lto1 -fwpa -fltrans-output-list=test.out 
f1.o f2.o test.o
test.out:
test.ltrans0.o
test.ltrans1.o
LTO objects
test.ltrans0.o
test.ltrans1.o
LTRANS
LTRANS
test.ltrans0.l
trans.o
test.ltrans1.l
trans.o
ld test
lto1 -fltrans test.ltrans0.o -o test.ltrans0.s
lto1 -fltrans test.ltrans1.o -o test.ltrans1.s
as test.ltrans0.s -o test.ltrans0.ltrans.o
as test.ltrans1.s -o test.ltrans1.ltrans.o
target objects
$ gcc -v --save-temps f1.o f2.o test.o -O3 -flto -o test
/home/users/kai/gcc-x86/libexec/gcc/x86_64-pc-linux-gnu/6.4.1/collect2 -
plugin /home/users/kai/gcc-x86/libexec/gcc/x86_64-pc-linux-gnu/6.4.1/
liblto_plugin.so -plugin-opt=/home/users/kai/gcc-x86/libexec/gcc/x86_64-pc-
linux-gnu/6.4.1/lto-wrapper -plugin-opt=-fresolution=test.res …
liblto_plugin.so
• Linker will pass transfer vector by onload() in
liblto_plugin.so provided by GCC.
struct ld_plugin_tv {
enum ld_plugin_tag tv_tag;
union {
int tv_val;
const char *tv_string;
ld_plugin_register_claim_file tv_register_claim_file;
…

} tv_u;
};
tv_tag tv_u used by
LDPT_MESSAGE message O
LDPT_API_VERSION 1
LDPT_GNU_LD_VERSION major * 100 + minor
LDPT_LINKER_OUTPUT LDPO_REL / LDPO_EXEC / LDPO_PIE / LDPO_DYN
LDPT_OUTPUT_NAME output_filename
LDPT_REGISTER_CLAIM_FILE_HOOK register_claim_file (claim_file_handler) LD O
LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK register_all_symbols_read (all_symbols_read_handler) LD O
LDPT_REGISTER_CLEANUP_HOOK register_cleanup (cleanup_handler) LD O
LDPT_ADD_SYMBOLS add_symbols GCC O
LDPT_GET_INPUT_FILE get_input_file GCC
LDPT_GET_VIEW get_view GCC
LDPT_RELEASE_INPUT_FILE release_input_file GCC
LDPT_GET_SYMBOLS get_symbols_v1 GCC O
LDPT_GET_SYMBOLS_V2 get_symbols_v2 GCC O
LDPT_ADD_INPUT_FILE add_input_file GCC O
LDPT_ADD_INPUT_LIBRARY add_input_library GCC O
LDPT_SET_EXTRA_LIBRARY_PATH set_extra_library_path GCC
LDPT_OPTION $PREFIX/libexec/gcc/x86_64-unknown-linux-gnu/5.4.1/lto-wrapper
LDPT_OPTION -fresolution=/tmp/ccCVtp8y.res
LDPT_NULL 0
Transfer Vector
claim_file_handler
• called by open_input_bfds () in linker
• process .gnu.lto_.symtab
• call add_symbols
open_input_bfds
claim_file_handler
(extract .gnu.lto_.symtab)
add_symbols
(add symbols to bfd symtab)
all_symbols_read_handler
• called after all symbols read in linker
• write_resolution ()
• get_symbols_v2: get symbol resolution information
• print to the resolution file
• prepare lto arguments
• lto-wrapper -fresolution=test.res -flinker-output=exec f1.o f2.o
test.o
• execute lto-wrapper
• call add_input_file () to add generated target objects.
cleanup_handler
• remove argument files.
• remove generated target objects after LTRANS
lto-wrapper
f1.o
f2.o
test.o
WPA
test.ltrans0.o
test.ltrans1.o
LTO objects
LTRANS
LTRANS
test.ltrans0.l
trans.o
test.ltrans1.l
trans.o
target objects
lto-wrapper
• process options in COLLECT_GCC_OPTIONS
• options given by command line
• decoded_options
• process options, .gnu.lto_.opts, in LTO objects
• options stored in LTO objects (.gnu.lto_.opts)
• merge_and_complain ()
• fdecoded_options
• fork gcc -xlto -c $fdecoded_options $decoded_options -fwpa …
• fork gcc -xlto -c $fdecoded_options $decoded_options -fltrans …
• print output_names to stdout
• GCC will read in output_names and pass to Linker to continue linking process.
Linker liblto_plugin.so lto-wrapper GCC
all_symbols_read_handler
gcc -fwpa
gcc -fltrans
print output_names
add_input_file
exec lto-wrapper

More Related Content

What's hot

What's hot (20)

Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniques
 
Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_Trusted firmware deep_dive_v1.0_
Trusted firmware deep_dive_v1.0_
 
Linux Ethernet device driver
Linux Ethernet device driverLinux Ethernet device driver
Linux Ethernet device driver
 
Hands-on ethernet driver
Hands-on ethernet driverHands-on ethernet driver
Hands-on ethernet driver
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructions
 
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
 
Play with FILE Structure - Yet Another Binary Exploit Technique
Play with FILE Structure - Yet Another Binary Exploit TechniquePlay with FILE Structure - Yet Another Binary Exploit Technique
Play with FILE Structure - Yet Another Binary Exploit Technique
 
Grep
GrepGrep
Grep
 
How to write a TableGen backend
How to write a TableGen backendHow to write a TableGen backend
How to write a TableGen backend
 
Linux MMAP & Ioremap introduction
Linux MMAP & Ioremap introductionLinux MMAP & Ioremap introduction
Linux MMAP & Ioremap introduction
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
malloc & vmalloc in Linux
malloc & vmalloc in Linuxmalloc & vmalloc in Linux
malloc & vmalloc in Linux
 
How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)
 
Dpdk applications
Dpdk applicationsDpdk applications
Dpdk applications
 
Kernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringKernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uring
 
A look into the sanitizer family (ASAN & UBSAN) by Akul Pillai
A look into the sanitizer family (ASAN & UBSAN) by Akul PillaiA look into the sanitizer family (ASAN & UBSAN) by Akul Pillai
A look into the sanitizer family (ASAN & UBSAN) by Akul Pillai
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Understanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panicUnderstanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panic
 

Similar to GCC LTO

Systemtap
SystemtapSystemtap
Systemtap
Feng Yu
 

Similar to GCC LTO (20)

LTO plugin
LTO pluginLTO plugin
LTO plugin
 
Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash Cracking
 
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerPragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
 
Linker and loader upload
Linker and loader   uploadLinker and loader   upload
Linker and loader upload
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of Software
 
A Peek into TFRT
A Peek into TFRTA Peek into TFRT
A Peek into TFRT
 
bcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesbcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challenges
 
BPF Tools 2017
BPF Tools 2017BPF Tools 2017
BPF Tools 2017
 
The true story_of_hello_world
The true story_of_hello_worldThe true story_of_hello_world
The true story_of_hello_world
 
Systemtap
SystemtapSystemtap
Systemtap
 
不深不淺,帶你認識 LLVM (Found LLVM in your life)
不深不淺,帶你認識 LLVM (Found LLVM in your life)不深不淺,帶你認識 LLVM (Found LLVM in your life)
不深不淺,帶你認識 LLVM (Found LLVM in your life)
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021
 
Beginner's guide to linkers
Beginner's guide to linkersBeginner's guide to linkers
Beginner's guide to linkers
 
M.Mozūras - git
M.Mozūras - gitM.Mozūras - git
M.Mozūras - git
 
An Overview of LLVM Link Time Optimization
An Overview of LLVM Link Time Optimization An Overview of LLVM Link Time Optimization
An Overview of LLVM Link Time Optimization
 
Adding a BOLT pass
Adding a BOLT passAdding a BOLT pass
Adding a BOLT pass
 
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
 
Linux Kernel Platform Development: Challenges and Insights
 Linux Kernel Platform Development: Challenges and Insights Linux Kernel Platform Development: Challenges and Insights
Linux Kernel Platform Development: Challenges and Insights
 
Thrift+scribe实现分布式日志收集,并与log4j集成
Thrift+scribe实现分布式日志收集,并与log4j集成Thrift+scribe实现分布式日志收集,并与log4j集成
Thrift+scribe实现分布式日志收集,并与log4j集成
 
ez-clang C++ REPL for bare-metal embedded devices
ez-clang C++ REPL for bare-metal embedded devicesez-clang C++ REPL for bare-metal embedded devices
ez-clang C++ REPL for bare-metal embedded devices
 

More from Wang Hsiangkai (11)

Debug Line Issues After Relaxation.
Debug Line Issues After Relaxation.Debug Line Issues After Relaxation.
Debug Line Issues After Relaxation.
 
Machine Trace Metrics
Machine Trace MetricsMachine Trace Metrics
Machine Trace Metrics
 
Instruction Combine in LLVM
Instruction Combine in LLVMInstruction Combine in LLVM
Instruction Combine in LLVM
 
Something About Dynamic Linking
Something About Dynamic LinkingSomething About Dynamic Linking
Something About Dynamic Linking
 
Effective Modern C++
Effective Modern C++Effective Modern C++
Effective Modern C++
 
GCC GENERIC
GCC GENERICGCC GENERIC
GCC GENERIC
 
LLVM Register Allocation (2nd Version)
LLVM Register Allocation (2nd Version)LLVM Register Allocation (2nd Version)
LLVM Register Allocation (2nd Version)
 
Perf File Format
Perf File FormatPerf File Format
Perf File Format
 
LLVM Register Allocation
LLVM Register AllocationLLVM Register Allocation
LLVM Register Allocation
 
Introduction to Perf
Introduction to PerfIntroduction to Perf
Introduction to Perf
 
SSA - PHI-functions Placements
SSA - PHI-functions PlacementsSSA - PHI-functions Placements
SSA - PHI-functions Placements
 

Recently uploaded

Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Lisi Hocke
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Marc Lester
 

Recently uploaded (20)

UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
 
The Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationThe Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test Automation
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Era
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
 
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
Workshop -  Architecting Innovative Graph Applications- GraphSummit MilanWorkshop -  Architecting Innovative Graph Applications- GraphSummit Milan
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
 
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
 
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
 
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
 
Encryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key ConceptsEncryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key Concepts
 
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConEffective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeCon
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
 

GCC LTO

  • 2. f1.c f2.c test.c f1.o f2.o test.o compile& assemble compile& assemble compile& assemble linker test gcc -flto -c f1.c gcc -flto -c f2.c gcc -flto -c test.c gcc -flto f1.o f2.o test.o -o test
  • 3. f1.c f2.c test.c LGEN LGEN LGEN f1.o f2.o test.o WPA test.ltrans0.o test.ltrans1.o cc1 -flto -c f1.c cc1 -flto -c f2.c cc1 -flto -c test.c lto1 -fwpa -fltrans-output-list=test.out f1.o f2.o test.o test.out: test.ltrans0.o test.ltrans1.o LTO objects
  • 4. test.ltrans0.o test.ltrans1.o LTRANS LTRANS test.ltrans0.l trans.o test.ltrans1.l trans.o ld test lto1 -fltrans test.ltrans0.o -o test.ltrans0.s lto1 -fltrans test.ltrans1.o -o test.ltrans1.s as test.ltrans0.s -o test.ltrans0.ltrans.o as test.ltrans1.s -o test.ltrans1.ltrans.o target objects
  • 5. $ gcc -v --save-temps f1.o f2.o test.o -O3 -flto -o test /home/users/kai/gcc-x86/libexec/gcc/x86_64-pc-linux-gnu/6.4.1/collect2 - plugin /home/users/kai/gcc-x86/libexec/gcc/x86_64-pc-linux-gnu/6.4.1/ liblto_plugin.so -plugin-opt=/home/users/kai/gcc-x86/libexec/gcc/x86_64-pc- linux-gnu/6.4.1/lto-wrapper -plugin-opt=-fresolution=test.res …
  • 6. liblto_plugin.so • Linker will pass transfer vector by onload() in liblto_plugin.so provided by GCC. struct ld_plugin_tv { enum ld_plugin_tag tv_tag; union { int tv_val; const char *tv_string; ld_plugin_register_claim_file tv_register_claim_file; …
 } tv_u; };
  • 7. tv_tag tv_u used by LDPT_MESSAGE message O LDPT_API_VERSION 1 LDPT_GNU_LD_VERSION major * 100 + minor LDPT_LINKER_OUTPUT LDPO_REL / LDPO_EXEC / LDPO_PIE / LDPO_DYN LDPT_OUTPUT_NAME output_filename LDPT_REGISTER_CLAIM_FILE_HOOK register_claim_file (claim_file_handler) LD O LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK register_all_symbols_read (all_symbols_read_handler) LD O LDPT_REGISTER_CLEANUP_HOOK register_cleanup (cleanup_handler) LD O LDPT_ADD_SYMBOLS add_symbols GCC O LDPT_GET_INPUT_FILE get_input_file GCC LDPT_GET_VIEW get_view GCC LDPT_RELEASE_INPUT_FILE release_input_file GCC LDPT_GET_SYMBOLS get_symbols_v1 GCC O LDPT_GET_SYMBOLS_V2 get_symbols_v2 GCC O LDPT_ADD_INPUT_FILE add_input_file GCC O LDPT_ADD_INPUT_LIBRARY add_input_library GCC O LDPT_SET_EXTRA_LIBRARY_PATH set_extra_library_path GCC LDPT_OPTION $PREFIX/libexec/gcc/x86_64-unknown-linux-gnu/5.4.1/lto-wrapper LDPT_OPTION -fresolution=/tmp/ccCVtp8y.res LDPT_NULL 0 Transfer Vector
  • 8. claim_file_handler • called by open_input_bfds () in linker • process .gnu.lto_.symtab • call add_symbols open_input_bfds claim_file_handler (extract .gnu.lto_.symtab) add_symbols (add symbols to bfd symtab)
  • 9. all_symbols_read_handler • called after all symbols read in linker • write_resolution () • get_symbols_v2: get symbol resolution information • print to the resolution file • prepare lto arguments • lto-wrapper -fresolution=test.res -flinker-output=exec f1.o f2.o test.o • execute lto-wrapper • call add_input_file () to add generated target objects.
  • 10. cleanup_handler • remove argument files. • remove generated target objects after LTRANS
  • 12. lto-wrapper • process options in COLLECT_GCC_OPTIONS • options given by command line • decoded_options • process options, .gnu.lto_.opts, in LTO objects • options stored in LTO objects (.gnu.lto_.opts) • merge_and_complain () • fdecoded_options • fork gcc -xlto -c $fdecoded_options $decoded_options -fwpa … • fork gcc -xlto -c $fdecoded_options $decoded_options -fltrans … • print output_names to stdout • GCC will read in output_names and pass to Linker to continue linking process.
  • 13. Linker liblto_plugin.so lto-wrapper GCC all_symbols_read_handler gcc -fwpa gcc -fltrans print output_names add_input_file exec lto-wrapper