Menu

- Learn
- Documentation
  - Language Reference
  - Library Reference
  - Command-line Reference
  - Feature Overview
  - Articles
- Downloads
- Packages
- Community
  - Blog
  - Orgs using D
  - Twitter
  - Forums
  - IRC
  - Community Discord
  - Wiki
  - GitHub
  - Issues
  - Get involved
  - Contributors
  - Foundation
  - Security Team
  - Donate
  - Sponsors
- Resources
  - Tour
  - Books
  - Tutorials
  - Tools
  - Editors
  - IDEs
  - run.dlang.io
  - Visual D
  - Acknowledgments
  - D Style
  - Glossary
  - Sitemap

Search
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

# core.internal.elf.dl

Simplifies working with shared ELF objects of the current process.

Reference http://www.dwarfstd.org/

License:
Boost License 1.0.
Authors:
Martin Kinkelin

Source core/internal/elf/dl.d

struct `SharedObjects`;
  Enables iterating over the process' currently loaded shared objects.
  alias `Callback` = int delegate(SharedObject) nothrow @nogc;
  static nothrow @nogc int `opApply`(scope Callback `dg`);
struct `SharedObject`;
  A loaded shared ELF object/binary, i.e., executable or shared library.
  static nothrow @nogc SharedObject `thisExecutable`();
    Returns the executable of the current process.
  static nothrow @nogc bool `findForAddress`(scope const void* `address`, out SharedObject `result`);
    Tries to find the shared object containing the specified address in one of its segments.
    Returns:
    True on success.
  dl_phdr_info `info`;
    OS-dependent info structure.
  const nothrow @nogc @property void* `baseAddress`();
    Returns the base address of the object.
  const nothrow @nogc const(char)[] `name`();
    Returns the name of (usually: path to) the object. Null-terminated.
  const char[] `getPath`(size_t N)(ref char[N] `buffer`)
  if (N > 1);
    Tries to fill the specified buffer with the path to the ELF file, according to the /proc//maps file.
    Returns:
    The filled slice (null-terminated), or null if an error occurs.
  const nothrow @nogc int `opApply`(scope int delegate(const ref Elf_Phdr) nothrow @nogc `dg`);
    Iterates over this object's segments.
  const nothrow @nogc bool `findSegmentForAddress`(scope const void* `address`, out const(Elf_Phdr)* `result`);
    Tries to find the segment containing the specified address.
    Returns:
    True on success.

Copyright © 1999-2023 by the D Language Foundation | Page generated by Ddoc on Wed Feb 15 22:42:49 2023