Limit search to available items
Book Cover
E-book
Author Stevanovic, Milan, author

Title Advanced C and C++ compiling / Milan Stevanovic
Published [Berkeley, CA] : Apress, 2014
New York, NY : Distributed to the Book trade worldwide by Springer, [2014]
©2014
Online access available from:
ProQuest Ebook Central (owned titles)    View Resource Record  

Copies

Description 1 online resource (xviii, 307 pages) : illustrations
Contents Ch. 1 Multitasking OS Basics -- Useful Abstractions -- Memory Hierarchy and Caching Strategy -- Virtual Memory -- Virtual Addressing -- Process Memory Division Scheme -- The Roles of Binaries, Compiler, Linker, and Loader -- Summary -- ch. 2 Simple Program Lifetime Stages -- Initial Assumptions -- Code Writing -- Concept illustration: Demo Project -- Compiling -- Introductory Definitions -- Related Definitions -- The Stages of Compiling -- Object File Properties -- Compilation Process Limitations -- Linking -- Linking Stages -- Linker's Viewpoint -- Executable File Properties -- Variety of Section Types -- A Variety of Symbol Types -- ch. 3 Program Execution Stages -- Importance of the Shell -- Kernel Role -- Loader Role -- Loader-Specific View of a Binary Film (Sections vs. Segments) -- Program Loading Stage -- Executing Program Entry Point -- The Loader Finds the Entry Point -- The Role of _start() Function
The Role of_libc_start_main() Function -- Stack and Calling Conventions -- ch. 4 The Impact of Reusing Concept -- Static Libraries -- Dynamic Libraries -- Dynamic vs. Shared Libraries -- Dynamic Linking in More Detail -- Peculiarities of Dynamic Linking on Windows -- Unique Nature of Dynamic Library -- Application Binary Interface (ABI) -- Static vs. Dynamic Libraries Comparison Points -- Differences in Import Selectiveness Criteria -- Deployment Dilemma Scenarios -- Useful Comparison Analogies -- The Conclusion: The Impact of Binary Reuse Concept -- ch. 5 Working with Static Libraries -- Creating Static Library -- Creating Linux Static Library -- Creating a Windows Static Library -- Using the Static Library -- Recommended Use Case Scenarios -- Static Libraries Tips and Tricks -- Potential for Losing the Symbol Visibility and Uniqueness -- Counterindicated Use Case Scenarios -- Specific Rules of Linking Static Libraries
Converting Static to Dynamic Library -- Static Libraries Issues on 64-bit Linux -- ch. 6 Designing Dynamic Libraries: Basics -- Creating the Dynamic Library -- Creating the Dynamic Library in Linux -- Creating the Dynamic Library in Windows -- Designing Dynamic Libraries -- Designing the Binary Interface -- Designing the Application Binary Interface -- Controlling Dynamic Library Symbols' Visibility -- Linking Completion Requirements -- Dynamic Linking Modes -- Statically Aware (Load-Time) Dynamic Linking -- Runtime Dynamic Linking -- Dynamic Linking Modes Comparison -- ch. 7 Locating the Libraries -- Typical Library Use Case Scenarios -- Development Use Case Scenario -- End User Runtime Use Case Scenario -- Build Time Library Location Rules -- Linux Build Time Library Location Rules -- Windows Build Time Library Location Rules -- Runtime Dynamic Library Location Rules -- Linux Runtime Dynamic Library Location Rules
Windows Runtime Dynamic Library Location Rules -- Linux Demo of Build Time and Runtime Conventions -- ch. 8 Designing Dynamic Libraries: Advanced Topics -- Why Resolved Memory Addresses Are a Must -- General Problem of Resolving References -- Which Symbols Are Likely to Suffer from Address Translation? -- Problems Caused by Address Translation -- Scenario 1 Client Binary Needs to Know the Address of Dynamic Library Symbols -- Scenario 2 Loaded Library No Longer Knows the Addresses of Its Own Symbols -- Linker-Loader Coordination -- Overall Strategy -- Tactics -- Linker Directives Overview -- Linker-Loader Coordination Implementation Techniques -- Load Time Relocation (LTR) -- Position Independent Code (PIC) -- ch. 9 Handling Duplicate Symbols When Linking In Dynamic Libraries -- Duplicate Symbols Definition -- Typical Duplicate Symbols Scenarios -- Duplicate Symbols Default Handling -- Duplicate Local Symbols Are Allowed
Duplicate Symbols Handling When Linking in Dynamic Libraries -- General Strategies of Eliminating Duplicate Symbols Problems -- Linker's Criteria in the Approximate Algorithm of Resolving Dynamic Libraries' Duplicate Symbols -- Analyses of Specific Duplicate Names Cases -- Case 1 Client Binary Symbol Collides with Dynamic Library ABI Function -- Case 2 ABI Symbols of Different Dynamic Libraries Collide -- Case 3 Dynamic Library ABI Symbol Collides with Another Dynamic Library Local Symbol -- Case 4 Dynamic Library Non-exported Symbol Collides with Another Dynamic Library Non-exported Symbol -- Final Remark: Linking Does Not Provide Any Kind of Namespace Inheritance -- ch. 10 Dynamic Libraries Versioning -- Gradation of Versions and their Impact on Backwards Compatibility -- Major Version Code Changes -- Minor Version Code Changes -- Patch Version -- Linux Dynamic Library Versioning Schemes -- Linux Soname-based Versioning Scheme
Linux Symbol Versioning Scheme -- Windows Dynamic Libraries Versioning -- DLL Version Information -- Specifying DLL Version Information -- Querying and Retrieving DLL Version Information -- ch. 11 Dynamic Libraries: Miscellaneous Topics -- Plug-in Concept -- Rules of Exporting -- Popular Plug-in Architectures -- Tips and Tricks -- Practical Implications of Working with Dynamic Libraries -- Miscellaneous Tips -- ch. 12 Linux Toolbox -- Quick Insight Tools -- file Utility Program -- size Utility Program -- Detailed Analysis Tools -- Idd -- nm -- objdump -- readelf -- Deployment Phase Tools -- chrpath -- patchelf -- strip -- Idconfig -- Runtime Analysis Tools -- strace -- addr2line -- gdb (GNU Debugger) -- Static Library Tools -- ar -- ch. 13 Linux How To's -- Debugging the Linking -- Determining the Binary File Type -- Determining the Binary File Entry Point -- Determining the Executable Entry Point -- Determining the Dynamic Library Entry Point
List Symbols -- List and Examine Sections -- Listing the Available Sections -- Examining Specific Sections -- List and Examine Segments -- Disassembling the Code -- Disassembling the Binary File -- Disassembling the Running Process -- Identifying the Debug Build -- Listing Load-time Dependencies -- Listing the Libraries Known to the Loader -- Listing Dynamically Linked Libraries -- strace Utility -- LD_DEBUG Environment Variable -- /proc/<ID>/maps File -- Isof Utility -- Programmatic Way -- Creating and Maintaining the Static Library -- ch. 14 Windows Toolbox -- Library Manager (lib.exe) -- lib.exe as a Static Library Tool -- lib.exe in the Realm of Dynamic Libraries (Import Library Tool) -- dumpbin Utility -- Identifying the Binary File Type -- Listing the DLL Exported Symbols -- Listing and Examining the Sections -- Disassembling the Code -- Identifying the Debug Build -- Listing the Load Time Dependencies -- Dependency Walker
Summary Learning how to write C/C++ code is only the first step. To be a serious programmer, you need to understand the structure and purpose of the binary files produced by the compiler: object files, static libraries, shared libraries, and, of course, executables. Advanced C and C++ Compiling explains the build process in detail and shows how to integrate code from other developers in the form of deployed libraries as well as how to resolve issues and potential mismatches between your own and external code trees. With the proliferation of open source, understanding these issues is increasingly the responsibility of the individual programmer. Advanced C and C++ Compiling brings all of the information needed to move from intermediate to expert programmer together in one place -- an engineering guide on the topic of C/C++ binaries to help you get the most accurate and pertinent information in the quickest possible time
Notes Includes index
English
Online resource; title from PDF title page (EBSCO, viewed November 30, 2017)
Subject Compilers (Computer programs)
C (Computer program language)
C++ (Computer program language)
Compiling (Electronic computers)
Software engineering.
COMPUTERS -- Programming Languages -- C.
COMPUTERS -- Programming Languages -- C++.
Software engineering
C (Computer program language)
C++ (Computer program language)
Compilers (Computer programs)
Compiling (Electronic computers)
Form Electronic book
ISBN 9781430266686
1430266686
Other Titles Advanced C and C Plus Plus compiling