Libelf by Example

A tutorial introduction to the ELF(3) & GELF(3) APIs

by Joseph Koshy

DescriptionTable of ContentsDetailsHashtagsReport an issue

Book Description

This tutorial introduces libelf, a library for reading and writing object code in the Extensible Linking Format (ELF) file format.
- Getting started with libelf: obtaining a handle to an ELF object, establishing a working ELF version, and handling errors reported by libelf.
- How ELF data structures are laid out in-memory and on disk, the notions of "file representation" and "memory representation", how to write applications that can handle non-native binaries.
- ELF Segments and the ELF Program Header Table, retrieving the program header table from an ELF executable and the meaning of the fields of a program header table entry.
- How data is stored inside ELF sections, the ELF Section Header Table, and how to traverse the sections in an ELF object.
- How to create new ELF objects: the rules for ordering individual API calls, the default object layout implemented by libelf, and how to specify custom layouts.
- ar archives: their structure, and how to read the contents of these archives using the APIs provided by libelf.

The example programs in this tutorial are written in the C programming language.

While written for the libelf implementation that is part of the Elftoolchain open-source project, this tutorial is expected to be compatible with other libelf implementations, such as that offered by the GNU project.

This open book is licensed under a Open Publication License (OPL). You can download Libelf by Example ebook for free in PDF format (1.1 MB).

Table of Contents

Chapter 1
Chapter 2
Getting Started
Chapter 3
Peering Inside an ELF Object
Chapter 4
Examining the Program Header Table
Chapter 5
Looking at Sections
Chapter 6
Creating New ELF Objects
Chapter 7
Processing ar archives
Chapter 8

Book Details

Computer Science
PDF Size
1.1 MB
Open Publication License

Book Hashtags

Related Books

Learning R
R is a programming language and free software environment for statistical computing and graphics. It is an unofficial and free R ebook created for educational purposes. All the content is extracted from Stack Overflow Documentation, which is written by many hardworking individuals at Stack Overflow....
R Notes for Professionals
The R Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow....
Mergers and Alliances in Higher Education
Higher education in Europe and beyond faces a series of major challenges. The economic crisis has accelerated expectations of an increased role in addressing economic and societal challenges while, at the same time, putting pressure on available finances. Broader trends such as shifting student demographics and expectations, globalisation and mobil...
Programming Persistent Memory
Beginning and experienced programmers will use this comprehensive guide to persistent memory programming. You will understand how persistent memory brings together several new software/hardware requirements, and offers great promise for better performance and faster application startup times - a huge leap forward in byte-addressable capacity compar...
Measurement and Control of Charged Particle Beams
This advanced textbook and reference is the first comprehensive and systematic review of all methods used for the measurement, correction, and control of the beam dynamics of modern particle accelerators. Based on material presented in several lectures at the US Particle Accelerator School, the text is intended for graduate students starting resear...
SAT/SMT by Example
SAT/SMT solvers can be viewed as solvers of huge systems of equations. The difference is that SMT solvers takes systems in arbitrary format, while SAT solvers are limited to boolean equations in CNF 1 form. A lot of real world problems can be represented as problems of solving system of equations....