Gdb Internals a Guide to the Internals of the GNU Debugger

Total Page:16

File Type:pdf, Size:1020Kb

Gdb Internals a Guide to the Internals of the GNU Debugger gdb Internals A guide to the internals of the GNU debugger John Gilmore Cygnus Solutions Second Edition: Stan Shebs Cygnus Solutions Cygnus Solutions Revision TEXinfo 2004-02-19.09 Copyright c 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”. i Table of Contents Scope of this Document ....................... 1 1 Requirements.............................. 1 2 Overall Structure .......................... 1 2.1 The Symbol Side ............................................ 2 2.2 The Target Side ............................................. 2 2.3 Configurations .............................................. 2 3 Algorithms ................................ 2 3.1 Frames ..................................................... 2 3.2 Prologue Analysis ........................................... 3 3.3 Breakpoint Handling ........................................ 5 3.4 Single Stepping ............................................. 6 3.5 Signal Handling ............................................. 6 3.6 Thread Handling ............................................ 6 3.7 Inferior Function Calls ....................................... 6 3.8 Longjmp Support ........................................... 7 3.9 Watchpoints ................................................ 7 3.9.1 x86 Watchpoints ........................................ 9 3.10 Checkpoints .............................................. 11 3.11 Observing changes in gdb internals ......................... 12 4 User Interface ............................ 12 4.1 Command Interpreter ...................................... 12 4.2 UI-Independent Output—the ui_out Functions............... 13 4.2.1 Overview and Terminology ............................. 13 4.2.2 General Conventions ................................... 14 4.2.3 Table, Tuple and List Functions ........................ 14 4.2.4 Item Output Functions ................................. 16 4.2.5 Utility Output Functions ............................... 17 4.2.6 Examples of Use of ui_out functions .................... 18 4.3 Console Printing ........................................... 21 4.4 TUI ....................................................... 21 5 libgdb.................................... 21 5.1 libgdb 1.0.................................................. 21 5.2 libgdb 2.0.................................................. 22 5.3 The libgdb Model ......................................... 22 5.4 CLI support ............................................... 22 5.5 libgdb components ........................................ 23 ii 6 Symbol Handling ......................... 23 6.1 Symbol Reading............................................ 23 6.2 Partial Symbol Tables ...................................... 24 6.3 Types ..................................................... 26 Fundamental Types (e.g., FT_VOID, FT_BOOLEAN). ............... 26 Type Codes (e.g., TYPE_CODE_PTR, TYPE_CODE_ARRAY). .......... 26 Builtin Types (e.g., builtin_type_void, builtin_type_char)... 26 6.4 Object File Formats ........................................ 26 6.4.1 a.out ................................................. 26 6.4.2 COFF ................................................ 26 6.4.3 ECOFF ............................................... 27 6.4.4 XCOFF ............................................... 27 6.4.5 PE ................................................... 27 6.4.6 ELF .................................................. 27 6.4.7 SOM ................................................. 27 6.4.8 Other File Formats .................................... 27 6.5 Debugging File Formats .................................... 27 6.5.1 stabs ................................................. 27 6.5.2 COFF ................................................ 28 6.5.3 Mips debug (Third Eye)................................ 28 6.5.4 DWARF 1 ............................................ 28 6.5.5 DWARF 2 ............................................ 28 6.5.6 SOM ................................................. 28 6.6 Adding a New Symbol Reader to gdb ....................... 28 6.7 Memory Management for Symbol Files....................... 28 7 Language Support ........................ 29 7.1 Adding a Source Language to gdb........................... 29 8 Host Definition ........................... 31 8.1 Adding a New Host ........................................ 31 8.2 Host Conditionals .......................................... 32 9 Target Architecture Definition............. 34 9.1 Operating System ABI Variant Handling ..................... 34 9.2 Registers and Memory ...................................... 36 9.3 Pointers Are Not Always Addresses .......................... 36 9.4 Address Classes ............................................ 38 9.5 Raw and Virtual Register Representations.................... 39 9.6 Using Different Register and Memory Data Representations ... 40 9.7 Frame Interpretation ....................................... 41 9.8 Inferior Call Setup ......................................... 42 9.9 Compiler Characteristics .................................... 42 9.10 Target Conditionals ....................................... 42 9.11 Adding a New Target...................................... 57 9.12 Converting an existing Target Architecture to Multi-arch ..... 58 9.12.1 Preparation .......................................... 58 iii 9.12.2 Add the multi-arch initialization code .................. 58 9.12.3 Update multi-arch incompatible mechanisms ............ 59 9.12.4 Prepare for multi-arch level to one ..................... 59 9.12.5 Set multi-arch level one ............................... 59 9.12.6 Convert remaining macros ............................. 59 9.12.7 Set multi-arch level to two............................. 60 9.12.8 Delete the TM file .................................... 60 10 Target Vector Definition ................. 60 10.1 File Targets............................................... 60 10.2 Standard Protocol and Remote Stubs ....................... 60 10.3 ROM Monitor Interface.................................... 60 10.4 Custom Protocols ......................................... 61 10.5 Transport Layer........................................... 61 10.6 Builtin Simulator.......................................... 61 11 Native Debugging ....................... 61 11.1 Native core file Support.................................... 62 11.2 ptrace .................................................... 62 11.3 /proc..................................................... 63 11.4 win32 .................................................... 63 11.5 shared libraries............................................ 63 11.6 Native Conditionals ....................................... 63 12 Support Libraries........................ 65 12.1 BFD ..................................................... 65 12.2 opcodes .................................................. 65 12.3 readline .................................................. 65 12.4 mmalloc .................................................. 65 12.5 libiberty .................................................. 66 12.5.1 obstacks in gdb ..................................... 66 12.6 gnu-regex ................................................. 66 12.7 include ................................................... 67 13 Coding.................................. 67 13.1 Cleanups ................................................. 67 13.2 Per-architecture module data............................... 68 13.3 Wrapping Output Lines.................................... 70 13.4 gdb Coding Standards .................................... 70 13.4.1 ISO C ............................................... 70 13.4.2 Memory Management ................................. 70 13.4.3 Compiler Warnings ................................... 71 13.4.4 Formatting ........................................... 72 13.4.5 Comments ........................................... 72 13.4.6 C Usage ............................................. 73 13.4.7 Function Prototypes .................................. 73 13.4.8 Internal Error Recovery ............................... 73 iv 13.4.9 File Names ........................................... 74 13.4.10 Include Files ........................................ 74 13.4.11 Clean Design and Portable Implementation ............ 74 14 Porting gdb ............................. 76 15 Versions and Branches ................... 77 15.1 Versions .................................................. 77 15.2 Release Branches .......................................... 78 15.3 Vendor Branches .......................................... 78 15.4 Experimental Branches .................................... 79 15.4.1 Guidelines ........................................... 79 15.4.2 Tags ................................................. 79 16 Start of New Year Procedure ............. 80 17 Releasing gdb ........................... 80 17.1 Branch Commit Policy .................................... 80 17.2 Obsoleting code ........................................... 81 17.3 Before the Branch ......................................... 81 17.3.1
Recommended publications
  • The GNU Linker
    The GNU linker ld (GNU Binutils) Version 2.37 Steve Chamberlain Ian Lance Taylor Red Hat Inc [email protected], [email protected] The GNU linker Edited by Jeffrey Osier ([email protected]) Copyright c 1991-2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled \GNU Free Documentation License". i Table of Contents 1 Overview :::::::::::::::::::::::::::::::::::::::: 1 2 Invocation ::::::::::::::::::::::::::::::::::::::: 3 2.1 Command-line Options ::::::::::::::::::::::::::::::::::::::::: 3 2.1.1 Options Specific to i386 PE Targets :::::::::::::::::::::: 40 2.1.2 Options specific to C6X uClinux targets :::::::::::::::::: 47 2.1.3 Options specific to C-SKY targets :::::::::::::::::::::::: 48 2.1.4 Options specific to Motorola 68HC11 and 68HC12 targets :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 48 2.1.5 Options specific to Motorola 68K target :::::::::::::::::: 48 2.1.6 Options specific to MIPS targets ::::::::::::::::::::::::: 49 2.1.7 Options specific to PDP11 targets :::::::::::::::::::::::: 49 2.2 Environment Variables :::::::::::::::::::::::::::::::::::::::: 50 3 Linker Scripts:::::::::::::::::::::::::::::::::: 51 3.1 Basic Linker Script Concepts :::::::::::::::::::::::::::::::::: 51 3.2 Linker Script
    [Show full text]
  • The “Stabs” Debug Format
    The \stabs" debug format Julia Menapace, Jim Kingdon, David MacKenzie Cygnus Support Cygnus Support Revision TEXinfo 2017-08-23.19 Copyright c 1992{2021 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Julia Menapace, Jim Kingdon, and David MacKenzie. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled \GNU Free Documentation License". i Table of Contents 1 Overview of Stabs ::::::::::::::::::::::::::::::: 1 1.1 Overview of Debugging Information Flow ::::::::::::::::::::::: 1 1.2 Overview of Stab Format ::::::::::::::::::::::::::::::::::::::: 1 1.3 The String Field :::::::::::::::::::::::::::::::::::::::::::::::: 2 1.4 A Simple Example in C Source ::::::::::::::::::::::::::::::::: 3 1.5 The Simple Example at the Assembly Level ::::::::::::::::::::: 4 2 Encoding the Structure of the Program ::::::: 7 2.1 Main Program :::::::::::::::::::::::::::::::::::::::::::::::::: 7 2.2 Paths and Names of the Source Files :::::::::::::::::::::::::::: 7 2.3 Names of Include Files:::::::::::::::::::::::::::::::::::::::::: 8 2.4 Line Numbers :::::::::::::::::::::::::::::::::::::::::::::::::: 9 2.5 Procedures ::::::::::::::::::::::::::::::::::::::::::::::::::::: 9 2.6 Nested Procedures::::::::::::::::::::::::::::::::::::::::::::: 11 2.7 Block Structure
    [Show full text]
  • The GNU Configure and Build System
    The GNU configure and build system Ian Lance Taylor Copyright c 1998 Cygnus Solutions Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the con- ditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another lan- guage, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. i Table of Contents 1 Introduction ............................... 1 1.1 Goals................................................... 1 1.2 Tools ................................................... 1 1.3 History ................................................. 1 1.4 Building ................................................ 2 2 Getting Started............................ 3 2.1 Write configure.in ....................................... 4 2.2 Write Makefile.am ....................................... 6 2.3 Write acconfig.h......................................... 7 2.4 Generate files ........................................... 8 2.5 Example................................................ 8 2.5.1 First Try....................................... 9 2.5.2 Second Try.................................... 10 2.5.3 Third
    [Show full text]
  • Cygwin User's Guide
    Cygwin User’s Guide Cygwin User’s Guide ii Copyright © Cygwin authors Permission is granted to make and distribute verbatim copies of this documentation provided the copyright notice and this per- mission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this documentation under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this documentation into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. Cygwin User’s Guide iii Contents 1 Cygwin Overview 1 1.1 What is it? . .1 1.2 Quick Start Guide for those more experienced with Windows . .1 1.3 Quick Start Guide for those more experienced with UNIX . .1 1.4 Are the Cygwin tools free software? . .2 1.5 A brief history of the Cygwin project . .2 1.6 Highlights of Cygwin Functionality . .3 1.6.1 Introduction . .3 1.6.2 Permissions and Security . .3 1.6.3 File Access . .3 1.6.4 Text Mode vs. Binary Mode . .4 1.6.5 ANSI C Library . .4 1.6.6 Process Creation . .5 1.6.6.1 Problems with process creation . .5 1.6.7 Signals . .6 1.6.8 Sockets . .6 1.6.9 Select . .7 1.7 What’s new and what changed in Cygwin . .7 1.7.1 What’s new and what changed in 3.2 .
    [Show full text]
  • Integrating the GNU Debugger with Cycle Accurate Models a Case Study Using a Verilator Systemc Model of the Openrisc 1000
    Integrating the GNU Debugger with Cycle Accurate Models A Case Study using a Verilator SystemC Model of the OpenRISC 1000 Jeremy Bennett Embecosm Application Note 7. Issue 1 Published March 2009 Legal Notice This work is licensed under the Creative Commons Attribution 2.0 UK: England & Wales License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/uk/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. This license means you are free: • to copy, distribute, display, and perform the work • to make derivative works under the following conditions: • Attribution. You must give the original author, Jeremy Bennett of Embecosm (www.embecosm.com), credit; • For any reuse or distribution, you must make clear to others the license terms of this work; • Any of these conditions can be waived if you get permission from the copyright holder, Embecosm; and • Nothing in this license impairs or restricts the author's moral rights. The software for the SystemC cycle accurate model written by Embecosm and used in this document is licensed under the GNU General Public License (GNU General Public License). For detailed licensing information see the file COPYING in the source code. Embecosm is the business name of Embecosm Limited, a private limited company registered in England and Wales. Registration number 6577021. ii Copyright © 2009 Embecosm Limited Table of Contents 1. Introduction ................................................................................................................ 1 1.1. Why Use Cycle Accurate Modeling .................................................................... 1 1.2. Target Audience ................................................................................................ 1 1.3. Open Source ..................................................................................................... 2 1.4. Further Sources of Information ......................................................................... 2 1.4.1.
    [Show full text]
  • Using Ld the GNU Linker
    Using ld The GNU linker ld version 2 January 1994 Steve Chamberlain Cygnus Support Cygnus Support [email protected], [email protected] Using LD, the GNU linker Edited by Jeffrey Osier (jeff[email protected]) Copyright c 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another lan- guage, under the above conditions for modified versions. Chapter 1: Overview 1 1 Overview ld combines a number of object and archive files, relocates their data and ties up symbol references. Usually the last step in compiling a program is to run ld. ld accepts Linker Command Language files written in a superset of AT&T’s Link Editor Command Language syntax, to provide explicit and total control over the linking process. This version of ld uses the general purpose BFD libraries to operate on object files. This allows ld to read, combine, and write object files in many different formats—for example, COFF or a.out. Different formats may be linked together to produce any available kind of object file. See Chapter 5 [BFD], page 47, for more information. Aside from its flexibility, the gnu linker is more helpful than other linkers in providing diagnostic information.
    [Show full text]
  • Jaké Je to Vyvíjet Prekladace?
    Jak to zacalo?ˇ What’s GNU? Gnu’s Not Unix! AMD64 port a SUSE GCC dnes Jaké je to vyvíjet prekladaˇ ce?ˇ Jan Hubickaˇ Katedra aplikované matematiky Filosofické problémy informatiky Jak to zacalo?ˇ What’s GNU? Gnu’s Not Unix! AMD64 port a SUSE GCC dnes Co je GCC GNU Compiler collection: • Prekladaˇ cˇ C, C++, obj-C, obj-C++, Fortranu, Ady, Go,. • Podporující více než 50 procesor˚ua nekolikˇ set target˚u(kombinací procesor+OS) • Vyvjený od 80. let jako jeden ze základních balík˚uGNU projektu • První verze vydaná v roce 1987 • Verze 8 vyjde tento týden? • 10m rádek,ˇ cca 100-150 aktivních vývojár˚u,odhademˇ 2000 clovˇ ekoletˇ Hacker na MIT od 1971. V záríˇ 1983 oznamuje GNU operating system. 1984 ochází a venujeˇ se GNU projektu. Zacalˇ vyvíjet základní nástroje Emacs, GCC, GDB, make, . Jak to zacalo?ˇ What’s GNU? Gnu’s Not Unix! AMD64 port a SUSE GCC dnes Richard Mathew Stallman (RMS) vs Xerox 9700 Hacker na MIT od 1971. V záríˇ 1983 oznamuje GNU operating system. 1984 ochází a venujeˇ se GNU projektu. Zacalˇ vyvíjet základní nástroje Emacs, GCC, GDB, make, . Jak to zacalo?ˇ What’s GNU? Gnu’s Not Unix! AMD64 port a SUSE GCC dnes Richard Mathew Stallman (RMS) vs Xerox 9700 Jak to zacalo?ˇ What’s GNU? Gnu’s Not Unix! AMD64 port a SUSE GCC dnes Richard Mathew Stallman (RMS) vs Xerox 9700 Hacker na MIT od 1971. V záríˇ 1983 oznamuje GNU operating system. 1984 ochází a venujeˇ se GNU projektu. Zacalˇ vyvíjet základní nástroje Emacs, GCC, GDB, make, .
    [Show full text]
  • GNU / Linux and Free Software
    GNU / Linux and Free Software GNU / Linux and Free Software An introduction Michael Opdenacker Free Electrons http://free-electrons.com Created with OpenOffice.org 2.x GNU / Linux and Free Software © Copyright 2004-2007, Free Electrons Creative Commons Attribution-ShareAlike 2.5 license http://free-electrons.com Sep 15, 2009 1 Rights to copy Attribution ± ShareAlike 2.5 © Copyright 2004-2007 You are free Free Electrons to copy, distribute, display, and perform the work [email protected] to make derivative works to make commercial use of the work Document sources, updates and translations: Under the following conditions http://free-electrons.com/articles/freesw Attribution. You must give the original author credit. Corrections, suggestions, contributions and Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license translations are welcome! identical to this one. For any reuse or distribution, you must make clear to others the license terms of this work. Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above. License text: http://creativecommons.org/licenses/by-sa/2.5/legalcode GNU / Linux and Free Software © Copyright 2004-2007, Free Electrons Creative Commons Attribution-ShareAlike 2.5 license http://free-electrons.com Sep 15, 2009 2 Contents Unix and its history Free Software licenses and legal issues Free operating systems Successful project highlights Free Software
    [Show full text]
  • Free As in Freedom (2.0): Richard Stallman and the Free Software Revolution
    Free as in Freedom (2.0): Richard Stallman and the Free Software Revolution Sam Williams Second edition revisions by Richard M. Stallman i This is Free as in Freedom 2.0: Richard Stallman and the Free Soft- ware Revolution, a revision of Free as in Freedom: Richard Stallman's Crusade for Free Software. Copyright c 2002, 2010 Sam Williams Copyright c 2010 Richard M. Stallman Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled \GNU Free Documentation License." Published by the Free Software Foundation 51 Franklin St., Fifth Floor Boston, MA 02110-1335 USA ISBN: 9780983159216 The cover photograph of Richard Stallman is by Peter Hinely. The PDP-10 photograph in Chapter 7 is by Rodney Brooks. The photo- graph of St. IGNUcius in Chapter 8 is by Stian Eikeland. Contents Foreword by Richard M. Stallmanv Preface by Sam Williams vii 1 For Want of a Printer1 2 2001: A Hacker's Odyssey 13 3 A Portrait of the Hacker as a Young Man 25 4 Impeach God 37 5 Puddle of Freedom 59 6 The Emacs Commune 77 7 A Stark Moral Choice 89 8 St. Ignucius 109 9 The GNU General Public License 123 10 GNU/Linux 145 iii iv CONTENTS 11 Open Source 159 12 A Brief Journey through Hacker Hell 175 13 Continuing the Fight 181 Epilogue from Sam Williams: Crushing Loneliness 193 Appendix A { Hack, Hackers, and Hacking 209 Appendix B { GNU Free Documentation License 217 Foreword by Richard M.
    [Show full text]
  • Anthony J. Massa
    EMBEDDED SOFTWARE DEVELOPMENT WITH ECOS™ Anthony J. Massa EMBEDDED SOFTWARE DEVELOPMENT WITH ECOS Anthony J. Massa PRENTICE HALL PROFESSIONAL TECHNICAL REFERENCE UPPER SADDLE RIVER, NJ 07458 WWW.PHPTR.COM WWW.PHPTR.COM/MASSA/ Library of Congress Cataloging-in-Publication Data Massa, Anthony J. Embedded software development with eCos / Anthony J. Massa p. cm.--(Bruce Perens' Open source series) ISBN 0-13-035473-2 1. Embedded computer systems--Programming. 2. Application software--Development. 3. Real-time data processing. I. Title. II. Series. QA76.6 .M364317 2002 005.26--dc21 2002035507 Editorial/production supervision: Techne Group Cover design director: Jerry Votta Cover design: Anthony Gemmellaro Art director: Gail Cocker-Bogusz Interior design: Meg Van Arsdale Manufacturing buyer: Maura Zaldivar Editor-in-Chief: Mark L. Taub Editorial assistant: Kate Wolf Marketing manager: Bryan Gambrel Full-service production manager: Anne R. Garcia © 2003 Pearson Education, Inc. Publishing as Prentice Hall Professional Technical Reference Upper Saddle River, New Jersey 07458 This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at <http://www.opencontent.org/openpub/>). Prentice Hall books are widely used by corporations and government agencies for training, marketing, and resale. For information regarding corporate and government bulk discounts please contact: Corporate and Government Sales (800) 382-3419 or [email protected] Other company and product names mentioned herein are the trademarks or registered trademarks of their respective owners. All rights reserved. No part of this book may be reproduced, in any form or by any means, without permission in writing from the publisher.
    [Show full text]
  • Linker Script Guide Emprog
    Linker Script Guide Emprog Emprog ThunderBench™ Linker Script Guide Version 1.2 ©May 2013 Page | 1 Linker Script Guide Emprog 1 - Linker Script guide 2 -Arm Specific Options Page | 2 Linker Script Guide Emprog 1 The Linker Scripts Every link is controlled by a linker script. This script is written in the linker command language. The main purpose of the linker script is to describe how the sections in the input files should be mapped into the output file, and to control the memory layout of the output file. Most linker scripts do nothing more than this. However, when necessary, the linker script can also direct the linker to perform many other operations, using the commands described below. The linker always uses a linker script. If you do not supply one yourself, the linker will use a default script that is compiled into the linker executable. You can use the ‘--verbose’ command line option to display the default linker script. Certain command line options, such as ‘-r’ or ‘-N’, will affect the default linker script. You may supply your own linker script by using the ‘-T’ command line option. When you do this, your linker script will replace the default linker script. You may also use linker scripts implicitly by naming them as input files to the linker, as though they were files to be linked. 1.1 Basic Linker Script Concepts We need to define some basic concepts and vocabulary in order to describe the linker script language. The linker combines input files into a single output file. The output file and each input file are in a special data format known as an object file format.
    [Show full text]
  • Linkers and Loaders Do?
    Linkers & Loaders by John R. Levine Table of Contents 1 Table of Contents Chapter 0: Front Matter ........................................................ 1 Dedication .............................................................................................. 1 Introduction ............................................................................................ 1 Who is this book for? ......................................................................... 2 Chapter summaries ............................................................................. 3 The project ......................................................................................... 4 Acknowledgements ............................................................................ 5 Contact us ........................................................................................... 6 Chapter 1: Linking and Loading ........................................... 7 What do linkers and loaders do? ............................................................ 7 Address binding: a historical perspective .............................................. 7 Linking vs. loading .............................................................................. 10 Tw o-pass linking .............................................................................. 12 Object code libraries ........................................................................ 15 Relocation and code modification .................................................... 17 Compiler Drivers .................................................................................
    [Show full text]