Email the Author

You can use this page to email Joseph Koshy about Libelf by Example.

Please include an email address so the author can respond to your query

This message will be sent to Joseph Koshy

This site is protected by reCAPTCHA and the Google  Privacy Policy and  Terms of Service apply.

About the Book

This tutorial introduces libelf, a library for reading and writing object code in the Extensible Linking Format (ELF) file format.

The tutorial covers:

  • 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 tutorial is part of the Leanpub for Causes program; the royalties from its purchase go to the NetBSD Foundation, an organisation developing a liberally-licensed open source operating system. The 'source' for this tutorial is itself available under a liberal license; please see the Elftoolchain project site.

If you would like to see any other ELF related topics covered in a future version of the tutorial, or if you have suggestions for improving it, then please do post at the Leanpub forum for the book.


About the Author

Joseph Koshy’s avatar Joseph Koshy

@jkoshynet

Hello there!

I am a software developer. I'm also a computer scientist.

I have spent much of my professional life working on kernels, systems software, performance analysis and tackling problems of scale.

In my free time I contribute to the Elftoolchain and NetBSD open-source projects.

I hope you find my work useful!

Logo white 96 67 2x

Publish Early, Publish Often

  • Path
  • There are many paths, but the one you're on right now on Leanpub is:
  • Libelfbyexample › Email Author › New
    • READERS
    • Newsletters
    • Weekly Sale
    • Monthly Sale
    • Store
    • Home
    • Redeem a Token
    • Search
    • Support
    • Leanpub FAQ
    • Leanpub Author FAQ
    • Search our Help Center
    • How to Contact Us
    • FRONTMATTER PODCAST
    • Featured Episode
    • Episode List
    • MEMBERSHIPS
    • Reader Memberships
    • Department Reader Memberships
    • Author Memberships
    • Your Membership
    • COMPANY
    • About
    • About Leanpub
    • Blog
    • Contact
    • Press
    • Essays
    • AI Services
    • Imagine a world...
    • Manifesto
    • More
    • Partner Program
    • Causes
    • Accessibility
    • AUTHORS
    • Write and Publish on Leanpub
    • Create a Book
    • Create a Bundle
    • Create a Course
    • Create a Track
    • Testimonials
    • Why Leanpub
    • Services
    • TranslateAI
    • TranslateWord
    • TranslateEPUB
    • PublishWord
    • Publish on Amazon
    • CourseAI
    • GlobalAuthor
    • Marketing Packages
    • IndexAI
    • Author Newsletter
    • The Leanpub Author Update
    • Author Support
    • Author Help Center
    • Leanpub Authors Forum
    • The Leanpub Manual
    • Supported Languages
    • The LFM Manual
    • Markua Manual
    • API Docs
    • Organizations
    • Learn More
    • Sign Up
    • LEGAL
    • Terms of Service
    • Copyright Policy
    • Privacy Policy
    • Refund Policy

*   *   *

Leanpub is copyright © 2010-2025 Ruboss Technology Corp.
All rights reserved.

This site is protected by reCAPTCHA
and the Google  Privacy Policy and  Terms of Service apply.

Leanpub requires cookies in order to provide you the best experience. Dismiss