Libbfd the Binary File Descriptor Library

Total Page:16

File Type:pdf, Size:1020Kb

Libbfd the Binary File Descriptor Library libbfd The Binary File Descriptor Library First Edition|BFD version < 3.0 % Since no product is stable before version 3.0 :-) Original Document Created: April 1991 Steve Chamberlain Cygnus Support Free Software Foundation [email protected] BFD, 1.5 TEXinfo 2009-03-28.05 Copyright c 1991-2016 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 Introduction::::::::::::::::::::::::::::::::::::: 1 1.1 History :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 1 1.2 How To Use BFD :::::::::::::::::::::::::::::::::::::::::::::: 1 1.3 What BFD Version 2 Can Do :::::::::::::::::::::::::::::::::: 2 1.3.1 Information Loss :::::::::::::::::::::::::::::::::::::::::: 2 1.3.2 The BFD canonical object-file format :::::::::::::::::::::: 3 2 BFD Front End ::::::::::::::::::::::::::::::::: 5 2.1 typedef bfd ::::::::::::::::::::::::::::::::::::::::::::::::::: 5 2.2 Error reporting ::::::::::::::::::::::::::::::::::::::::::::::: 12 2.2.1 Type bfd_error_type ::::::::::::::::::::::::::::::::::: 12 2.2.1.1 bfd_get_error:::::::::::::::::::::::::::::::::::::: 13 2.2.1.2 bfd_set_error:::::::::::::::::::::::::::::::::::::: 13 2.2.1.3 bfd_errmsg ::::::::::::::::::::::::::::::::::::::::: 13 2.2.1.4 bfd_perror ::::::::::::::::::::::::::::::::::::::::: 13 2.2.2 BFD error handler ::::::::::::::::::::::::::::::::::::::: 13 2.2.2.1 bfd_set_error_handler :::::::::::::::::::::::::::: 13 2.2.2.2 bfd_set_error_program_name :::::::::::::::::::::: 14 2.2.2.3 bfd_get_error_handler :::::::::::::::::::::::::::: 14 2.2.3 BFD assert handler :::::::::::::::::::::::::::::::::::::: 14 2.2.3.1 bfd_set_assert_handler ::::::::::::::::::::::::::: 14 2.2.3.2 bfd_get_assert_handler ::::::::::::::::::::::::::: 14 2.3 Miscellaneous ::::::::::::::::::::::::::::::::::::::::::::::::: 14 2.3.1 Miscellaneous functions::::::::::::::::::::::::::::::::::: 14 2.3.1.1 bfd_get_reloc_upper_bound ::::::::::::::::::::::: 15 2.3.1.2 bfd_canonicalize_reloc ::::::::::::::::::::::::::: 15 2.3.1.3 bfd_set_reloc:::::::::::::::::::::::::::::::::::::: 15 2.3.1.4 bfd_set_file_flags:::::::::::::::::::::::::::::::: 15 2.3.1.5 bfd_get_arch_size ::::::::::::::::::::::::::::::::: 15 2.3.1.6 bfd_get_sign_extend_vma:::::::::::::::::::::::::: 16 2.3.1.7 bfd_set_start_address :::::::::::::::::::::::::::: 16 2.3.1.8 bfd_get_gp_size ::::::::::::::::::::::::::::::::::: 16 2.3.1.9 bfd_set_gp_size ::::::::::::::::::::::::::::::::::: 16 2.3.1.10 bfd_scan_vma:::::::::::::::::::::::::::::::::::::: 16 2.3.1.11 bfd_copy_private_header_data::::::::::::::::::: 17 2.3.1.12 bfd_copy_private_bfd_data :::::::::::::::::::::: 17 2.3.1.13 bfd_merge_private_bfd_data ::::::::::::::::::::: 17 2.3.1.14 bfd_set_private_flags ::::::::::::::::::::::::::: 17 2.3.1.15 Other functions :::::::::::::::::::::::::::::::::: 18 2.3.1.16 bfd_alt_mach_code:::::::::::::::::::::::::::::::: 20 2.3.1.17 bfd_emul_get_maxpagesize ::::::::::::::::::::::: 20 2.3.1.18 bfd_emul_set_maxpagesize ::::::::::::::::::::::: 20 2.3.1.19 bfd_emul_get_commonpagesize :::::::::::::::::::: 20 ii 2.3.1.20 bfd_emul_set_commonpagesize :::::::::::::::::::: 21 2.3.1.21 bfd_demangle:::::::::::::::::::::::::::::::::::::: 21 2.3.1.22 bfd_update_compression_header ::::::::::::::::: 21 2.3.1.23 bfd_check_compression_header::::::::::::::::::: 21 2.3.1.24 bfd_get_compression_header_size ::::::::::::::: 21 2.3.1.25 bfd_convert_section_size ::::::::::::::::::::::: 22 2.3.1.26 bfd_convert_section_contents::::::::::::::::::: 22 2.3.1.27 struct bfd_iovec ::::::::::::::::::::::::::::::::: 22 2.3.1.28 bfd_get_mtime :::::::::::::::::::::::::::::::::::: 23 2.3.1.29 bfd_get_size:::::::::::::::::::::::::::::::::::::: 23 2.3.1.30 bfd_mmap :::::::::::::::::::::::::::::::::::::::::: 23 2.4 Memory Usage :::::::::::::::::::::::::::::::::::::::::::::::: 24 2.5 Initialization :::::::::::::::::::::::::::::::::::::::::::::::::: 24 2.5.1 Initialization functions ::::::::::::::::::::::::::::::::::: 24 2.5.1.1 bfd_init ::::::::::::::::::::::::::::::::::::::::::: 24 2.6 Sections::::::::::::::::::::::::::::::::::::::::::::::::::::::: 24 2.6.1 Section input::::::::::::::::::::::::::::::::::::::::::::: 24 2.6.2 Section output ::::::::::::::::::::::::::::::::::::::::::: 25 2.6.3 Link orders :::::::::::::::::::::::::::::::::::::::::::::: 25 2.6.4 typedef asection :::::::::::::::::::::::::::::::::::::::::: 26 2.6.5 Section prototypes ::::::::::::::::::::::::::::::::::::::: 38 2.6.5.1 bfd_section_list_clear ::::::::::::::::::::::::::: 38 2.6.5.2 bfd_get_section_by_name:::::::::::::::::::::::::: 38 2.6.5.3 bfd_get_next_section_by_name :::::::::::::::::::: 39 2.6.5.4 bfd_get_linker_section ::::::::::::::::::::::::::: 39 2.6.5.5 bfd_get_section_by_name_if :::::::::::::::::::::: 39 2.6.5.6 bfd_get_unique_section_name ::::::::::::::::::::: 39 2.6.5.7 bfd_make_section_old_way::::::::::::::::::::::::: 40 2.6.5.8 bfd_make_section_anyway_with_flags ::::::::::::: 40 2.6.5.9 bfd_make_section_anyway:::::::::::::::::::::::::: 40 2.6.5.10 bfd_make_section_with_flags :::::::::::::::::::: 40 2.6.5.11 bfd_make_section ::::::::::::::::::::::::::::::::: 41 2.6.5.12 bfd_get_next_section_id::::::::::::::::::::::::: 41 2.6.5.13 bfd_set_section_flags ::::::::::::::::::::::::::: 41 2.6.5.14 bfd_rename_section :::::::::::::::::::::::::::::: 41 2.6.5.15 bfd_map_over_sections ::::::::::::::::::::::::::: 41 2.6.5.16 bfd_sections_find_if :::::::::::::::::::::::::::: 42 2.6.5.17 bfd_set_section_size :::::::::::::::::::::::::::: 42 2.6.5.18 bfd_set_section_contents ::::::::::::::::::::::: 42 2.6.5.19 bfd_get_section_contents ::::::::::::::::::::::: 43 2.6.5.20 bfd_malloc_and_get_section ::::::::::::::::::::: 43 2.6.5.21 bfd_copy_private_section_data ::::::::::::::::: 43 2.6.5.22 bfd_generic_is_group_section::::::::::::::::::: 43 2.6.5.23 bfd_generic_discard_group :::::::::::::::::::::: 43 2.7 Symbols :::::::::::::::::::::::::::::::::::::::::::::::::::::: 44 2.7.1 Reading symbols ::::::::::::::::::::::::::::::::::::::::: 44 2.7.2 Writing symbols:::::::::::::::::::::::::::::::::::::::::: 45 2.7.3 Mini Symbols :::::::::::::::::::::::::::::::::::::::::::: 45 iii 2.7.4 typedef asymbol:::::::::::::::::::::::::::::::::::::::::: 46 2.7.5 Symbol handling functions ::::::::::::::::::::::::::::::: 49 2.7.5.1 bfd_get_symtab_upper_bound :::::::::::::::::::::: 49 2.7.5.2 bfd_is_local_label:::::::::::::::::::::::::::::::: 49 2.7.5.3 bfd_is_local_label_name:::::::::::::::::::::::::: 49 2.7.5.4 bfd_is_target_special_symbol :::::::::::::::::::: 49 2.7.5.5 bfd_canonicalize_symtab:::::::::::::::::::::::::: 50 2.7.5.6 bfd_set_symtab :::::::::::::::::::::::::::::::::::: 50 2.7.5.7 bfd_print_symbol_vandf ::::::::::::::::::::::::::: 50 2.7.5.8 bfd_make_empty_symbol :::::::::::::::::::::::::::: 50 2.7.5.9 _bfd_generic_make_empty_symbol ::::::::::::::::: 50 2.7.5.10 bfd_make_debug_symbol ::::::::::::::::::::::::::: 51 2.7.5.11 bfd_decode_symclass ::::::::::::::::::::::::::::: 51 2.7.5.12 bfd_is_undefined_symclass :::::::::::::::::::::: 51 2.7.5.13 bfd_symbol_info :::::::::::::::::::::::::::::::::: 51 2.7.5.14 bfd_copy_private_symbol_data::::::::::::::::::: 51 2.8 Archives :::::::::::::::::::::::::::::::::::::::::::::::::::::: 52 2.8.1 Archive functions::::::::::::::::::::::::::::::::::::::::: 52 2.8.1.1 bfd_get_next_mapent :::::::::::::::::::::::::::::: 52 2.8.1.2 bfd_set_archive_head ::::::::::::::::::::::::::::: 53 2.8.1.3 bfd_openr_next_archived_file :::::::::::::::::::: 53 2.9 File formats::::::::::::::::::::::::::::::::::::::::::::::::::: 53 2.9.1 File format functions ::::::::::::::::::::::::::::::::::::: 53 2.9.1.1 bfd_check_format :::::::::::::::::::::::::::::::::: 53 2.9.1.2 bfd_check_format_matches::::::::::::::::::::::::: 54 2.9.1.3 bfd_set_format :::::::::::::::::::::::::::::::::::: 54 2.9.1.4 bfd_format_string ::::::::::::::::::::::::::::::::: 54 2.10 Relocations :::::::::::::::::::::::::::::::::::::::::::::::::: 54 2.10.1 typedef arelent :::::::::::::::::::::::::::::::::::::::::: 55 2.10.1.1 enum complain_overflow :::::::::::::::::::::::::: 58 2.10.1.2 reloc_howto_type ::::::::::::::::::::::::::::::::: 58 2.10.1.3 The HOWTO Macro ::::::::::::::::::::::::::::::::::: 60 2.10.1.4 bfd_get_reloc_size :::::::::::::::::::::::::::::: 61 2.10.1.5 arelent_chain :::::::::::::::::::::::::::::::::::: 61 2.10.1.6 bfd_check_overflow :::::::::::::::::::::::::::::: 61 2.10.1.7 bfd_perform_relocation :::::::::::::::::::::::::: 62 2.10.1.8 bfd_install_relocation :::::::::::::::::::::::::: 62 2.10.2 The howto manager ::::::::::::::::::::::::::::::::::::: 62 2.10.2.1 bfd_reloc_code_type ::::::::::::::::::::::::::::: 63 2.10.2.2 bfd_reloc_type_lookup :::::::::::::::::::::::::: 135 2.10.2.3 bfd_default_reloc_type_lookup :::::::::::::::: 135 2.10.2.4 bfd_get_reloc_code_name ::::::::::::::::::::::: 135 2.10.2.5 bfd_generic_relax_section ::::::::::::::::::::: 135 2.10.2.6 bfd_generic_gc_sections ::::::::::::::::::::::: 136 2.10.2.7 bfd_generic_lookup_section_flags ::::::::::::: 136 2.10.2.8 bfd_generic_merge_sections :::::::::::::::::::: 136 2.10.2.9 bfd_generic_get_relocated_section_contents :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 136 iv 2.11 Core files ::::::::::::::::::::::::::::::::::::::::::::::::::: 136 2.11.1 Core file functions:::::::::::::::::::::::::::::::::::::: 136 2.11.1.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]
  • 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]
  • 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]
  • Interaktívny Disassembler Prohlášení
    VYSOKÉ UČENÍ TECHNICKÉ V BRNĚ BRNO UNIVERSITY OF TECHNOLOGY FAKULTA INFORMAČNÍCH TECHNOLOGIÍ ÚSTAV INFORMAČNÝCH SYSTÉMŮ FACULTY OF INFORMATION TECHNOLOGY DEPARTMENT OF INFORMATION SYSTEMS INTERAKTÍVNY DISASSEMBLER BAKALÁŘSKÁ PRÁCE BACHELOR'S THESIS AUTOR PRÁCE Milan Mrva AUTHOR BRNO 2011 VYSOKÉ UČENÍ TECHNICKÉ V BRNĚ BRNO UNIVERSITY OF TECHNOLOGY FAKULTA INFORMAČNÍCH TECHNOLOGIÍ ÚSTAV INFORMAČNÝCH SYSTÉMŮ FACULTY OF INFORMATION TECHNOLOGY DEPARTMENT OF INFORMATION SYSTEMS INTERAKTIVNÍ ZPĚTNÝ ASSEMBLER INTERACTIVE DISASSEMBLER BAKALÁŘSKÁ PRÁCE BACHELOR'S THESIS AUTOR PRÁCE Milan Mrva AUTHOR VEDOUCÍ PRÁCE Ing. Jakub Křoustek SUPERVISOR BRNO 2011 Abstrakt V práci jsou popsané postupy a nástroje zpětného inženýrství v rámci softwaru. Uvedené jsou techniky ochrany před rozkladem či zkoumáním obsahu spustitelného souboru. Představené jsou příklady programů zabývajících se zpětným překladem. Dále se práce zaobírá architekturou procesoru s důrazem na mikroprocesory Intel a Motorola. Jsou ukázané rozdílné formáty spustitelných souborů. Byl implementovaný generický modulovatelný zpětný assembler.V tomto textu je představená jak jeho struktura, tak zásuvné moduly, které prezentují tři různé techniky disassemblovaní. Jeden z modulů používa vícevláknový parser, který je vlastním návrhem autora. Tyto přístupy jsou v závěru porovnané a je nastíněn další vývoj. Abstract This thesis describes procedures and tools of reverse engineering in terms of software development. There are introduces different techniques of protection against decomposition of executables. The work also mentions some programs used for decomposition analysis. Furthermore it contains information about architecture of processing units, with emphasis on microprocessors Intel and Motorola. Variety of executable formats is shown. Generic retargetable disassembler was implemented. There is a description of its structure and plugins. These plugins represents three algorithms used for disassembling a program.
    [Show full text]
  • Automated Malware Analysis Report for Zphoenixminer.Exe
    ID: 333796 Sample Name: zphoenixminer.exe Cookbook: default.jbs Time: 23:37:39 Date: 23/12/2020 Version: 31.0.0 Red Diamond Table of Contents Table of Contents 2 Analysis Report zphoenixminer.exe 4 Overview 4 General Information 4 Detection 4 Signatures 4 Classification 4 Startup 4 Malware Configuration 4 Yara Overview 4 Memory Dumps 4 Unpacked PEs 5 Sigma Overview 6 Signature Overview 6 AV Detection: 6 Networking: 6 Key, Mouse, Clipboard, Microphone and Screen Capturing: 6 E-Banking Fraud: 7 Spam, unwanted Advertisements and Ransom Demands: 7 System Summary: 7 Persistence and Installation Behavior: 7 Hooking and other Techniques for Hiding and Protection: 7 HIPS / PFW / Operating System Protection Evasion: 7 Stealing of Sensitive Information: 7 Remote Access Functionality: 7 Mitre Att&ck Matrix 7 Behavior Graph 8 Screenshots 9 Thumbnails 9 Antivirus, Machine Learning and Genetic Malware Detection 9 Initial Sample 9 Dropped Files 9 Unpacked PE Files 10 Domains 10 URLs 10 Domains and IPs 10 Contacted Domains 10 URLs from Memory and Binaries 10 Contacted IPs 12 Public 12 General Information 12 Simulations 13 Behavior and APIs 13 Joe Sandbox View / Context 13 IPs 13 Domains 13 ASN 14 JA3 Fingerprints 14 Dropped Files 14 Created / dropped Files 14 Static File Info 19 General 20 File Icon 20 Static PE Info 20 General 20 Entrypoint Preview 20 Copyright null 2020 Page 2 of 34 Data Directories 21 Sections 22 Resources 22 Imports 24 Exports 24 Version Infos 25 Possible Origin 25 Network Behavior 25 TCP Packets 25 Code Manipulations 26 Statistics
    [Show full text]
  • Using As the Gnu Assembler
    Using as The gnu Assembler Version 2.14.90.0.7 The Free Software Foundation Inc. thanks The Nice Computer Company of Australia for loaning Dean Elsner to write the first (Vax) version of as for Project gnu. The proprietors, management and staff of TNCCA thank FSF for distracting the boss while they got some work done. Dean Elsner, Jay Fenlason & friends Using as Edited by Cygnus Support Copyright c 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 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". Chapter 1: Overview 1 1 Overview This manual is a user guide to the gnu assembler as. Here is a brief summary of how to invoke as. For details, see Chapter 2 [Command-Line Options], page 15. as [-a[cdhlns][=file]] [-D][{defsym sym=val] [-f][{gstabs][{gstabs+] [{gdwarf2][{help] [-I dir][-J][-K][-L] [{listing-lhs-width=NUM][{listing-lhs-width2=NUM] [{listing-rhs-width=NUM][{listing-cont-lines=NUM] [{keep-locals][-o objfile][-R][{statistics][-v] [-version][{version][-W][{warn][{fatal-warnings] [-w][-x][-Z][{target-help][target-options] [{|files ...] Target Alpha options: [-mcpu] [-mdebug | -no-mdebug] [-relax][-g][-Gsize] [-F][-32addr] Target ARC options: [-marc[5|6|7|8]] [-EB|-EL] Target ARM
    [Show full text]
  • Net Yaroze for Linux Setting up GCC for Net Yaroze Development Under Linux 16 February 2000
    Net Yaroze For Linux Setting Up GCC For Net Yaroze Development Under Linux 16 February 2000 Christian Bauer Copyright c 1999, 2000 Christian Bauer Permission is granted to make and distribute verbatim copies of this manual provided the copy- right notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the condi- tions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. i Table of Contents Net Yaroze For Linux ............................ 1 1 Introduction.................................. 2 2 Downloading the necessary software ........... 3 3 Preparing for the installation .................. 4 4 Setting up binutils ............................ 6 4.1 Unpacking binutils .......................................... 6 4.2 Configuring binutils ......................................... 6 4.3 Compiling binutils ........................................... 6 4.4 Installing binutils............................................ 6 5 Setting up GCC .............................. 8 5.1 Unpacking GCC............................................. 8 5.2 Configuring GCC............................................ 8 5.3 Compiling GCC ............................................. 9 5.4 Installing GCC .............................................. 9 5.5 Final touches .............................................. 10 6 A little example ............................. 11 6.1 Setting up
    [Show full text]
  • Why Does My Program Not Link Or Not Execute Global Constructors
    Ns-3 Application Note Why Don’t Those #@(%!~& Libraries Work? Craig Dowell [email protected] Background Consider the following program int main(int argc, char **argv) { myprintf("Hello World\n"); } When you compile this program, the compiler determines that there is no function called myprintf in the compilation unit (the source file) and marks the function as an unresolved reference. When the executable is linked, the linker looks through its list of libraries looking for an implementation of the function myprintf. The linker handles providing an implementation in one of two ways depending on the kind of file providing the implementation. • If the implementation is found in a static library (e.g., libcore.a), the linker copies the implementation of myprintf into the executable. The linker must then recursively search for further unresolved references in the myprintf function and resolve them by (possibly) looking in other libraries. This continues until the executable contains all of the code required to execute myprintf (there are no unresolved references). • If the implementation of myprintf is found in a dynamic library (e.g., libcore.so), the linker adds a note to itself that the unresolved reference can be resolved by loading the dynamic library. The linker recursively searches for further unresolved references and continues until all references are resolved. What happens when you run the resulting program depends on the kind of library to which you linked. • If you linked to static libraries, your program is self-contained. It will be loaded into memory and executed, starting at a system-dependent entry point.
    [Show full text]
  • Gnu Assembler
    Using as The gnu Assembler (Sourcery G++ Lite 2010q1-188) Version 2.19.51 The Free Software Foundation Inc. thanks The Nice Computer Company of Australia for loaning Dean Elsner to write the first (Vax) version of as for Project gnu. The proprietors, management and staff of TNCCA thank FSF for distracting the boss while they gotsome work done. Dean Elsner, Jay Fenlason & friends Using as Edited by Cygnus Support Copyright c 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002, 2006, 2007, 2008, 2009 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 1.1 Structure of this Manual :::::::::::::::::::::::::::::::::::::: 14 1.2 The GNU Assembler :::::::::::::::::::::::::::::::::::::::::: 15 1.3 Object File Formats::::::::::::::::::::::::::::::::::::::::::: 15 1.4 Command Line ::::::::::::::::::::::::::::::::::::::::::::::: 15 1.5 Input Files :::::::::::::::::::::::::::::::::::::::::::::::::::: 16 1.6 Output (Object) File:::::::::::::::::::::::::::::::::::::::::: 16 1.7 Error and Warning Messages :::::::::::::::::::::::::::::::::: 16 2 Command-Line Options::::::::::::::::::::::: 19 2.1 Enable Listings: `-a[cdghlns]'
    [Show full text]
  • 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 2007-09-03.05 Copyright c 1990-2013 Free Software Foundation, Inc. Contributed by Cygnus Solutions. Written by John Gilmore. Second Edition by Stan Shebs. 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 Scope of this Document :::::::::::::::::::::::::::: 1 1 Summary :::::::::::::::::::::::::::::::::::::::: 1 1.1 Requirements :::::::::::::::::::::::::::::::::::::::::::::::::: 1 1.2 Contributors ::::::::::::::::::::::::::::::::::::::::::::::::::: 1 2 Overall Structure ::::::::::::::::::::::::::::::: 2 2.1 The Symbol Side ::::::::::::::::::::::::::::::::::::::::::::::: 2 2.2 The Target Side :::::::::::::::::::::::::::::::::::::::::::::::: 2 2.3 Configurations ::::::::::::::::::::::::::::::::::::::::::::::::: 2 2.4 Source Tree Structure :::::::::::::::::::::::::::::::::::::::::: 3 3 Algorithms :::::::::::::::::::::::::::::::::::::: 4 3.1 Prologue Analysis :::::::::::::::::::::::::::::::::::::::::::::: 4 3.2 Breakpoint Handling ::::::::::::::::::::::::::::::::::::::::::: 6 3.3 Single Stepping ::::::::::::::::::::::::::::::::::::::::::::::::
    [Show full text]