z/OS Common Debug Architecture User's Guide
|
Previous topic |
Next topic |
Contents |
Index |
Contact z/OS |
Library |
PDF
Initializing libelf z/OS Common Debug Architecture User's Guide SC14-7310-00 |
|
|
This topic describes how the consumer application initializes libelf to process the information within an ELF object file. Steps to initialize libelf
The application uses the elf_begin operation to create an ELF descriptor. This operation requires a file descriptor for the ELF object file. For example, the application is given the name of the file from a command line parameter. It then acquires the descriptor with the following code:
Then validate the libelf interface, using the following code:
Then create an ELF descriptor with the given ELF object file, using the following code:
Note: Other operations
that can be used are elf_begin_b and elf_begin_c.
Consult the libelf documentation for details on using
these operations.
To determine if the input ELF object file is a well-formed ELF object file, use the elf_getident operations. For example:
To determine if the ELF descriptor represents a 32-bit ELF object or a 64-bit ELF object. It uses the elf32_getehdr and elf64_getehdr operations. For example:
After this sequence the ELF
descriptor has been identified as:
If the processing was successful, then elf contains the ELF descriptor object which is used to interfact with libdwarf.
|
Copyright IBM Corporation 1990, 2013 |