lld The LLVM Linker Friday, April 13, 2012

Slides:



Advertisements
Similar presentations
Hand-Held Devices and Embedded Systems Course Student: Tomás Sánchez López Student ID:
Advertisements

1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Programs in Memory Bryce Boe 2012/08/29 CS32, Summer 2012 B.
Overview of programming in C C is a fast, efficient, flexible programming language Paradigm: C is procedural (like Fortran, Pascal), not object oriented.
Chapter 11 Implementing an Assembler and a Linker Using C++ and Java.
Copyright 2013 – Noah Mendelsohn Compiling C Programs Noah Mendelsohn Tufts University Web:
Software & Services Group, Developer Products Division Copyright© 2010, Intel Corporation. All rights reserved. *Other brands and names are the property.
UEE072HM Linking HLL and ALP An example on ARM. Embedded and Real-Time Systems We will mainly look at embedded systems –Systems which have the computer.
Program Development Tools The GNU (GNU’s Not Unix) Toolchain The GNU toolchain has played a vital role in the development of the Linux kernel, BSD, and.
Lecture 10: Linking and loading. Lecture 10 / Page 2AE4B33OSS 2011 Contents Linker vs. loader Linking the executable Libraries Loading executable ELF.
1 Starting a Program The 4 stages that take a C++ program (or any high-level programming language) and execute it in internal memory are: Compiler - C++
Together, We make the difference. MCLinker Intermediate Representation Luba Tang 2013/2/24.
Characteristics of Realtime and Embedded Systems Chapter 1 6/10/20151.
Modern Compiler Internal Representations Silvius Rus 1/23/2002.
1 UQC122S3 Real-Time and Embedded Systems GCC as a cross compiler.
Executable XML Present by 吳昆澤. Outline  Introduction  Simkin  Jelly  o:XML  Conclusion.
1 Real-Time System Design Developing a Cross Compiler and libraries for a target system.
Guide To UNIX Using Linux Third Edition
Tangle: A General Purpose, Concurrent, Object Oriented, Actor Based Programming Language Chris Wailes and Graham Price.
COP4020 Programming Languages
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Introduction to The Linaro Toolchain Embedded Processors Training Multicore Software Applications Literature Number: SPRPXXX 1.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
Week 4 - Friday.  What did we talk about last time?  Some extra systems programming stuff  Scope.
Computer Software. Evolution of Programming Languages Machine Languages Assembly Languages High-Level Languages Fourth-Generation Languages.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
University of Maryland Compiler-Assisted Binary Parsing Tugrul Ince PD Week – 27 March 2012.
Together, We make the difference. Introduction to LLVM and MCLinker Luba Tang.
High-level Languages.
Natawut NupairojAssembly Language1 Introduction to Assembly Programming.
Enabling the ARM Learning in INDIA ARM DEVELOPMENT TOOL SETUP.
SB ScriptBasic Introduction to ScriptBasic There are more people writing programs in BASIC than the number of people capable programming.
Together, We make the difference. Create a Working Linker with the MCLinker framework Luba Tang 2013/02/24.
Old Chapter 10: Programming Tools A Developer’s Candy Store.
Programming With C.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
FLUKA GUI Status FLUKA Meeting CERN, 10/7/2006.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Topic 2d High-Level languages and Systems Software
Programming with Visual Studio.NET A short review of the process.
Exam Format  105 Total Points  25 Points Short Answer  20 Points Fill in the Blank  15 Points T/F  45 Points Multiple Choice  The above are approximations.
Low-Level Virtual Machine support for Eclipse C/C++ Development Tooling Petri Tuononen - 17/5/2011.
Paradyn Project Paradyn / Dyninst Week Madison, Wisconsin April 12-14, 2010 Binary Rewriting with Dyninst Madhavi Krishnan and Dan McNulty.
The Assembly Language Level Part C – Linking and Loading.
ECE 103 Engineering Programming Chapter 7 Compiling C Programs Herbert G. Mayer, PSU CS Status 6/19/2015 Initial content copied verbatim from ECE 103 material.
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
Week 4 - Friday.  What did we talk about last time?  Some extra systems programming stuff  Scope.
An overview of C Language. Overview of C C language is a general purpose and structured programming language developed by 'Dennis Ritchie' at AT &T's.
CS252: Systems Programming Ninghui Li Based on Slides by Gustavo Rodriguez-Rivera Topic 2: Program Structure and Using GDB.
C Programming Lecture 3 : C Introduction 1 Lecture notes : courtesy of Woo Kyun and Chang Byung-Mo.
Hello world !!! ASCII representation of hello.c.
Visual Programming Borland Delphi. Developing Applications Borland Delphi is an object-oriented, visual programming environment to develop 32-bit applications.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Object Files & Linking. Object Sections Compiled code store as object files – Linux : ELF : Extensible Linking Format – Windows : PE : Portable Execution.
Introduction To Software Development Environment.
Program Execution in Linux David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Computer System Structures
Simone Campanoni LLVM Simone Campanoni
Microprocessor and Assembly Language
-by Nisarg Vasavada (Compiled*)
Program Execution in Linux
CS 1308 Exam 2 Review.
Chapter 4: Threads.
Assembly Language for Intel-Based Computers
Computer Architecture
Embedded System Development Lecture 13 4/11/2007
Program Execution in Linux
Let’s start from the beginning
Computer Terms Review from what language did C++ originate?
Overview of System Development for Windows CE.NET
Presentation transcript:

lld The LLVM Linker Friday, April 13, 2012 2012 LLVM Euro - Michael Spencer lld Friday, April 13, 2012 The LLVM Linker

What is lld? A system linker Produce final libraries and executables, no other tools or runtime required Understands platform ABI 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

What is lld? A system linker Modular and embeddable Designed as a set of libraries As with all LLVM/Clang tools, the main executable code is quite short. Can be embedded into other tools such as custom language compilers. 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

What is lld? A system linker Modular and embeddable Portable (both host and target) Currently tested on Mac, Linux, and Windows Target specific code is isolated for both OS and CPU architecture 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

What is lld? A system linker Modular and embeddable Portable (both host and target) Compatible Driver to support multiple styles (gnu-ld, ld64, link.exe) Supports ELF, COFF (including MinGW), Mach-O, and LLVM IR Support for a restricted subset of linker scripts is planned 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

What is lld? A system linker Modular and embeddable Portable (both host and target) Compatible Extensible Both LLVM IR and atom graph passes can be added 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

Why a new linker? Performance Linking is a speed bump in the way of fast iteration gold may be fast, but gnu-ld and link.exe are not, and gold is ELF only Link time was the #1 complaint from PS3 developers. 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

Why a new linker? Performance Portability gold and gnu-ld are UNIX-oriented, link.exe is Windows only, and ld64 is Darwin only. 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

Why a new linker? Performance Portability Reliable cross linking No single linker can currently be used to reliably cross link 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

What makes lld different? Atom Model An atom is an indivisible chunk of code or data It has a set of attributes such as type, name, and scope It has a list of references to other atoms References represent relocations and other relationships such as grouping. 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

Atom Model An atom is an indivisible chunk of code or data An atom 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

Atom Model It has a set of attributes such as type, name, and scope name: main type: code scope: global But not all atoms have names type: data scope: static content: "Hello, World!" 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

Atom Model It has a list of references to other atoms name: main type: code scope: global name: printf def: undefined type: data scope: static content: "Hello, World!" 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

Atom Model References represent relocations and other relationships such as grouping. name: main type: code scope: global offset: 24 type: R_X86_64_PC32 addend: -4 offset: 12 type: R_X86_64_32S name: printf def: undefined type: data scope: static content: "Hello, World!" 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

What makes lld different? Atom Model LLVM IR and atom graph passes In addition to the standard LLVM passes, other passes can run at pre and post LLVM IR link phases lld passes can be run over the atom graph at different stages of the link Branch island generation Order file C++ Open Multi-Methods… Obviously LTO, but also other passes that fit here. 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

What makes lld different? Atom Model LLVM IR and atom graph passes Uniform text, binary, and in memory representation lld supports a human-readable YAML input and output format to aid in testing and debugging 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

Uniform Representation # RUN: lld-core %s 2>&1 | FileCheck %s # CHECK: duplicate symbol --- atoms: - name: _foo scope: global type: data type: code ... 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

What makes lld different? Atom Model LLVM IR and atom graph passes Uniform text, binary, and in memory representation lld supports a human readable YAML input and output format to aid in testing and debugging lld also adds a binary representation of the in memory atom model The purpose of this is purely for speed The goal is for LLVM to eventually produce these natively 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

What makes lld different? Atom Model LLVM IR and atom graph passes Uniform text, binary, and in memory representation C++11 lld has been developed using C++11 from the beginning Dogfooding Clang and libc++ Makes it easier to write faster code C++11 atomics and memory model for multithreading 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

Project Status Atom graph and resolving work with YAML as input and output lld native binary reading and writing COFF and Mach-O are already in progress The Mach-O writer can produce a Hello World executable from multiple YAML files 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

Patches Welcome Open Projects http://lld.llvm.org/open_projects.html 2012 LLVM Euro - Michael Spencer Friday, April 13, 2012

Questions? bigcheesegs@gmail.com Friday, April 13, 2012 2012 LLVM Euro - Michael Spencer Questions? Friday, April 13, 2012 bigcheesegs@gmail.com