FD.io VPP  v16.06
Vector Packet Processing
elf.h File Reference
+ Include dependency graph for elf.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  elf_first_header_t
 
struct  elf32_file_header_t
 
struct  elf64_file_header_t
 
struct  elf32_section_header_t
 
struct  elf64_section_header_t
 
struct  elf32_segment_header_t
 
struct  elf64_segment_header_t
 
struct  elf32_symbol_t
 
struct  elf64_symbol_t
 
struct  elf_symbol_info_t
 
struct  elf32_relocation_t
 
struct  elf64_relocation_t
 
struct  elf_relocation_with_addend_t
 
struct  elf32_dynamic_entry_t
 
struct  elf64_dynamic_entry_t
 
struct  elf_dynamic_version_definition_t
 
struct  elf_dynamic_version_definition_aux_t
 
struct  elf_dynamic_version_need_t
 
struct  elf_dynamic_version_need_aux_t
 
union  elf_dynamic_version_need_union_t
 
struct  elf_note_t
 
struct  elf_symbol_table_t
 
struct  elf_relocation_table_t
 
struct  elf_section_t
 
struct  elf_segment_t
 
struct  elf_main_t
 

Macros

#define foreach_elf_file_class   _ (CLASS_NONE) _ (32BIT) _ (64BIT)
 
#define foreach_elf_data_encoding
 
#define ELF_VERSION_NONE   (0)
 
#define ELF_VERSION_CURRENT   (1)
 
#define foreach_elf_abi
 
#define foreach_elf_file_type
 
#define foreach_elf_architecture
 
#define foreach_elf32_file_header
 
#define foreach_elf64_file_header
 
#define foreach_elf32_section_header
 
#define foreach_elf64_section_header
 
#define foreach_elf32_segment_header
 
#define foreach_elf64_segment_header
 
#define foreach_elf32_symbol_header
 
#define foreach_elf64_symbol_header
 
#define foreach_elf_symbol_reserved_section_index
 
#define ELF_SYMBOL_SECTION_RESERVED_LO   0xff00
 
#define ELF_SYMBOL_SECTION_RESERVED_HI   0xffff
 
#define ELF_SYMBOL_SECTION_ARCH_SPECIFIC_LO   0xff00
 
#define ELF_SYMBOL_SECTION_ARCH_SPECIFIC_HI   0xff1f
 
#define ELF_SYMBOL_SECTION_OS_SPECIFIC_LO   0xff20
 
#define ELF_SYMBOL_SECTION_OS_SPECIFIC_HI   0xff3f
 
#define foreach_elf_section_type
 
#define foreach_elf_section_flag
 
#define foreach_elf_symbol_binding
 
#define foreach_elf_symbol_type
 
#define foreach_elf_symbol_visibility
 
#define foreach_elf_symbol_info_bound_to
 
#define foreach_elf_symbol_info_flags
 
#define elf_relocation_next(r, type)
 
#define foreach_elf_segment_type
 
#define foreach_elf_segment_flag
 
#define foreach_elf32_dynamic_entry_header
 
#define foreach_elf64_dynamic_entry_header
 
#define foreach_elf_dynamic_entry_type
 
#define ELF_DYNAMIC_FLAGS_ORIGIN   (1 << 0) /* Object may use DF_ORIGIN */
 
#define ELF_DYNAMIC_FLAGS_SYMBOLIC   (1 << 1) /* Symbol resolutions starts here */
 
#define ELF_DYNAMIC_FLAGS_TEXT_RELOCATIONS   (1 << 2) /* Object contains text relocations */
 
#define ELF_DYNAMIC_FLAGS_BIND_NOW   (1 << 3) /* No lazy binding for this object */
 
#define ELF_DYNAMIC_FLAGS_STATIC_TLS   (1 << 4) /* Module uses the static TLS model */
 
#define DF_1_NOW   0x00000001 /* Set RTLD_NOW for this object. */
 
#define DF_1_GLOBAL   0x00000002 /* Set RTLD_GLOBAL for this object. */
 
#define DF_1_GROUP   0x00000004 /* Set RTLD_GROUP for this object. */
 
#define DF_1_NODELETE   0x00000008 /* Set RTLD_NODELETE for this object.*/
 
#define DF_1_LOADFLTR   0x00000010 /* Trigger filtee loading at runtime.*/
 
#define DF_1_INITFIRST   0x00000020 /* Set RTLD_INITFIRST for this object*/
 
#define DF_1_NOOPEN   0x00000040 /* Set RTLD_NOOPEN for this object. */
 
#define DF_1_ORIGIN   0x00000080 /* $ORIGIN must be handled. */
 
#define DF_1_DIRECT   0x00000100 /* Direct binding enabled. */
 
#define DF_1_TRANS   0x00000200
 
#define DF_1_INTERPOSE   0x00000400 /* Object is used to interpose. */
 
#define DF_1_NODEFLIB   0x00000800 /* Ignore default lib search path. */
 
#define DF_1_NODUMP   0x00001000 /* Object can't be dldump'ed. */
 
#define DF_1_CONFALT   0x00002000 /* Configuration alternative created.*/
 
#define DF_1_ENDFILTEE   0x00004000 /* Filtee terminates filters search. */
 
#define DF_1_DISPRELDNE   0x00008000 /* Disp reloc applied at build time. */
 
#define DF_1_DISPRELPND   0x00010000 /* Disp reloc applied at run-time. */
 
#define DTF_1_PARINIT   0x00000001
 
#define DTF_1_CONFEXP   0x00000002
 
#define DF_P1_LAZYLOAD   0x00000001 /* Lazyload following object. */
 
#define DF_P1_GROUPPERM
 
#define ELF_DYNAMIC_VERSION_FILE   (1 << 0) /* Version definition of file itself */
 
#define ELF_DYNAMIC_VERSION_WEAK   (1 << 1) /* Weak version identifier */
 
#define ELF_DYNAMIC_VERSYM_LOCAL   0 /* Symbol is local. */
 
#define ELF_DYNAMIC_VERSYM_GLOBAL   1 /* Symbol is global. */
 
#define ELF_DYNAMIC_VERSYM_RESERVED_LO   0xff00 /* Beginning of reserved entries. */
 
#define ELF_DYNAMIC_VERSYM_ELIMINATE   0xff01 /* Symbol is to be eliminated. */
 
#define foreach_elf_dynamic_version_need_field
 
#define foreach_elf_dynamic_version_need_aux_field
 
#define ELF_NOTE_SOLARIS   "SUNW Solaris"
 
#define ELF_NOTE_GNU   "GNU"
 
#define ELF_NOTE_PAGESIZE_HINT   1
 
#define ELF_NOTE_ABI   1
 
#define ELF_NOTE_OS_LINUX   0
 
#define ELF_NOTE_OS_GNU   1
 
#define ELF_NOTE_OS_SOLARIS2   2
 
#define ELF_NOTE_OS_FREEBSD   3
 
#define foreach_elf_x86_64_relocation_type
 
#define FORMAT_ELF_MAIN_SYMBOLS   (1 << 0)
 
#define FORMAT_ELF_MAIN_RELOCATIONS   (1 << 1)
 
#define FORMAT_ELF_MAIN_DYNAMIC   (1 << 2)
 

Enumerations

enum  elf_file_class_t { ELF_N_FILE_CLASS }
 
enum  elf_data_encoding_t { ELF_N_DATA_ENCODING }
 
enum  elf_abi_t { foreach_elf_abi }
 
enum  elf_file_type_t { foreach_elf_file_type }
 
enum  elf_architecture_t { foreach_elf_architecture }
 
enum  elf_section_type_t { ELF_SECTION_OS_SPECIFIC_HI = 0x6fffffff }
 
enum  elf_section_flag_bit_t { foreach_elf_section_flag }
 
enum  elf_section_flag_t { foreach_elf_section_flag }
 
enum  elf_segment_type_t { foreach_elf_segment_type }
 
enum  elf_segment_flag_bit_t { foreach_elf_segment_flag }
 
enum  elf_segment_flag_t { foreach_elf_segment_flag }
 
enum  elf_dynamic_entry_type_t { foreach_elf_dynamic_entry_type }
 

Functions

always_inline void elf_symbol_table_free (elf_symbol_table_t *s)
 
always_inline u8elf_symbol_name (elf_symbol_table_t *t, elf64_symbol_t *sym)
 
always_inline void elf_relocation_table_free (elf_relocation_table_t *r)
 
always_inline void elf_main_init (elf_main_t *em)
 
always_inline void elf_main_free (elf_main_t *em)
 
always_inline void elf_get_segment_contents (elf_main_t *em, void *data, uword segment_index)
 
always_inline voidelf_get_section_contents (elf_main_t *em, uword section_index, uword elt_size)
 
always_inline void elf_set_section_contents (elf_main_t *em, uword section_index, void *new_contents, uword n_content_bytes)
 
always_inline u8elf_section_name (elf_main_t *em, elf_section_t *s)
 
always_inline u8 elf_swap_u8 (elf_main_t *em, u8 x)
 
always_inline u16 elf_swap_u16 (elf_main_t *em, u16 x)
 
always_inline u32 elf_swap_u32 (elf_main_t *em, u32 x)
 
always_inline u64 elf_swap_u64 (elf_main_t *em, u64 x)
 
clib_error_telf_read_file (elf_main_t *em, char *file_name)
 
clib_error_telf_write_file (elf_main_t *em, char *file_name)
 
clib_error_telf_delete_named_section (elf_main_t *em, char *section_name)
 
clib_error_telf_parse (elf_main_t *em, void *data, uword data_bytes)
 
void elf_parse_symbols (elf_main_t *em)
 
clib_error_telf_get_section_by_name (elf_main_t *em, char *section_name, elf_section_t **result)
 
clib_error_telf_get_section_by_start_address (elf_main_t *em, uword start_address, elf_section_t **result)
 
void elf_create_section_with_contents (elf_main_t *em, char *section_name, elf64_section_header_t *header, void *contents, uword n_content_bytes)
 
uword elf_delete_segment_with_type (elf_main_t *em, elf_segment_type_t segment_type)
 
void elf_set_dynamic_entries (elf_main_t *em)
 

Variables

format_function_t format_elf_main
 
format_function_t format_elf_symbol
 

Macro Definition Documentation

#define DF_1_CONFALT   0x00002000 /* Configuration alternative created.*/

Definition at line 653 of file elf.h.

#define DF_1_DIRECT   0x00000100 /* Direct binding enabled. */

Definition at line 648 of file elf.h.

#define DF_1_DISPRELDNE   0x00008000 /* Disp reloc applied at build time. */

Definition at line 655 of file elf.h.

#define DF_1_DISPRELPND   0x00010000 /* Disp reloc applied at run-time. */

Definition at line 656 of file elf.h.

#define DF_1_ENDFILTEE   0x00004000 /* Filtee terminates filters search. */

Definition at line 654 of file elf.h.

#define DF_1_GLOBAL   0x00000002 /* Set RTLD_GLOBAL for this object. */

Definition at line 641 of file elf.h.

#define DF_1_GROUP   0x00000004 /* Set RTLD_GROUP for this object. */

Definition at line 642 of file elf.h.

#define DF_1_INITFIRST   0x00000020 /* Set RTLD_INITFIRST for this object*/

Definition at line 645 of file elf.h.

#define DF_1_INTERPOSE   0x00000400 /* Object is used to interpose. */

Definition at line 650 of file elf.h.

#define DF_1_LOADFLTR   0x00000010 /* Trigger filtee loading at runtime.*/

Definition at line 644 of file elf.h.

#define DF_1_NODEFLIB   0x00000800 /* Ignore default lib search path. */

Definition at line 651 of file elf.h.

#define DF_1_NODELETE   0x00000008 /* Set RTLD_NODELETE for this object.*/

Definition at line 643 of file elf.h.

#define DF_1_NODUMP   0x00001000 /* Object can't be dldump'ed. */

Definition at line 652 of file elf.h.

#define DF_1_NOOPEN   0x00000040 /* Set RTLD_NOOPEN for this object. */

Definition at line 646 of file elf.h.

#define DF_1_NOW   0x00000001 /* Set RTLD_NOW for this object. */

Definition at line 640 of file elf.h.

#define DF_1_ORIGIN   0x00000080 /* $ORIGIN must be handled. */

Definition at line 647 of file elf.h.

#define DF_1_TRANS   0x00000200

Definition at line 649 of file elf.h.

#define DF_P1_GROUPPERM
Value:
0x00000002 /* Symbols from next object are not
generally available. */

Definition at line 664 of file elf.h.

#define DF_P1_LAZYLOAD   0x00000001 /* Lazyload following object. */

Definition at line 663 of file elf.h.

#define DTF_1_CONFEXP   0x00000002

Definition at line 660 of file elf.h.

#define DTF_1_PARINIT   0x00000001

Definition at line 659 of file elf.h.

#define ELF_DYNAMIC_FLAGS_BIND_NOW   (1 << 3) /* No lazy binding for this object */

Definition at line 635 of file elf.h.

#define ELF_DYNAMIC_FLAGS_ORIGIN   (1 << 0) /* Object may use DF_ORIGIN */

Definition at line 632 of file elf.h.

#define ELF_DYNAMIC_FLAGS_STATIC_TLS   (1 << 4) /* Module uses the static TLS model */

Definition at line 636 of file elf.h.

#define ELF_DYNAMIC_FLAGS_SYMBOLIC   (1 << 1) /* Symbol resolutions starts here */

Definition at line 633 of file elf.h.

#define ELF_DYNAMIC_FLAGS_TEXT_RELOCATIONS   (1 << 2) /* Object contains text relocations */

Definition at line 634 of file elf.h.

#define ELF_DYNAMIC_VERSION_FILE   (1 << 0) /* Version definition of file itself */

Definition at line 685 of file elf.h.

#define ELF_DYNAMIC_VERSION_WEAK   (1 << 1) /* Weak version identifier */

Definition at line 686 of file elf.h.

#define ELF_DYNAMIC_VERSYM_ELIMINATE   0xff01 /* Symbol is to be eliminated. */

Definition at line 692 of file elf.h.

#define ELF_DYNAMIC_VERSYM_GLOBAL   1 /* Symbol is global. */

Definition at line 690 of file elf.h.

#define ELF_DYNAMIC_VERSYM_LOCAL   0 /* Symbol is local. */

Definition at line 689 of file elf.h.

#define ELF_DYNAMIC_VERSYM_RESERVED_LO   0xff00 /* Beginning of reserved entries. */

Definition at line 691 of file elf.h.

#define ELF_NOTE_ABI   1

Definition at line 763 of file elf.h.

#define ELF_NOTE_GNU   "GNU"

Definition at line 745 of file elf.h.

#define ELF_NOTE_OS_FREEBSD   3

Definition at line 771 of file elf.h.

#define ELF_NOTE_OS_GNU   1

Definition at line 769 of file elf.h.

#define ELF_NOTE_OS_LINUX   0

Definition at line 768 of file elf.h.

#define ELF_NOTE_OS_SOLARIS2   2

Definition at line 770 of file elf.h.

#define ELF_NOTE_PAGESIZE_HINT   1

Definition at line 751 of file elf.h.

#define ELF_NOTE_SOLARIS   "SUNW Solaris"

Definition at line 742 of file elf.h.

#define elf_relocation_next (   r,
  type 
)
Value:
((void *) ((r) + 1) \
+ ((type) == ELF_SECTION_RELOCATION_ADD ? sizeof ((r)->addend[0]) : 0))
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS

Definition at line 488 of file elf.h.

#define ELF_SYMBOL_SECTION_ARCH_SPECIFIC_HI   0xff1f

Definition at line 345 of file elf.h.

#define ELF_SYMBOL_SECTION_ARCH_SPECIFIC_LO   0xff00

Definition at line 344 of file elf.h.

#define ELF_SYMBOL_SECTION_OS_SPECIFIC_HI   0xff3f

Definition at line 347 of file elf.h.

#define ELF_SYMBOL_SECTION_OS_SPECIFIC_LO   0xff20

Definition at line 346 of file elf.h.

#define ELF_SYMBOL_SECTION_RESERVED_HI   0xffff

Definition at line 343 of file elf.h.

#define ELF_SYMBOL_SECTION_RESERVED_LO   0xff00

Definition at line 342 of file elf.h.

#define ELF_VERSION_CURRENT   (1)

Definition at line 55 of file elf.h.

#define ELF_VERSION_NONE   (0)

Definition at line 54 of file elf.h.

#define foreach_elf32_dynamic_entry_header
Value:
_ (u32, type) \
_ (u32, data)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
unsigned int u32
Definition: types.h:88

Definition at line 539 of file elf.h.

#define foreach_elf32_file_header
Value:
_ (u32, entry_point) \
_ (u32, segment_header_file_offset) \
_ (u32, section_header_file_offset) \
_ (u32, flags) \
_ (u16, n_bytes_this_header) \
_ (u16, segment_header_size) \
_ (u16, segment_header_count) \
_ (u16, section_header_size) \
_ (u16, section_header_count) \
_ (u16, section_header_string_table_index)
unsigned int u32
Definition: types.h:88
unsigned short u16
Definition: types.h:57
u32 flags
Definition: vhost-user.h:73

Definition at line 213 of file elf.h.

#define foreach_elf32_section_header
Value:
_ (u32, name) \
_ (u32, type) \
_ (u32, flags) \
_ (u32, exec_address) \
_ (u32, file_offset) \
_ (u32, file_size) \
_ (u32, link) \
_ (u32, additional_info) \
_ (u32, align) \
_ (u32, entry_size)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
unsigned int u32
Definition: types.h:88
u32 flags
Definition: vhost-user.h:73

Definition at line 238 of file elf.h.

#define foreach_elf32_segment_header
Value:
_ (u32, type) \
_ (u32, file_offset) \
_ (u32, virtual_address) \
_ (u32, physical_address) \
_ (u32, file_size) \
_ (u32, memory_size) \
_ (u32, flags) \
_ (u32, align)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
unsigned int u32
Definition: types.h:88
u32 flags
Definition: vhost-user.h:73

Definition at line 263 of file elf.h.

#define foreach_elf32_symbol_header
Value:
_ (u32, name) \
_ (u32, value) \
_ (u32, size) \
/* binding upper 4 bits; type lower 4 bits */ \
_ (u8, binding_and_type) \
_ (u8, visibility) \
_ (u16, section_index)
unsigned int u32
Definition: types.h:88
u32 size
Definition: vhost-user.h:74
unsigned short u16
Definition: types.h:57
unsigned char u8
Definition: types.h:56

Definition at line 284 of file elf.h.

#define foreach_elf64_dynamic_entry_header
Value:
_ (u64, type) \
_ (u64, data)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
unsigned long u64
Definition: types.h:89

Definition at line 543 of file elf.h.

#define foreach_elf64_file_header
Value:
_ (u64, entry_point) \
_ (u64, segment_header_file_offset) \
_ (u64, section_header_file_offset) \
_ (u32, flags) \
_ (u16, n_bytes_this_header) \
_ (u16, segment_header_size) \
_ (u16, segment_header_count) \
_ (u16, section_header_size) \
_ (u16, section_header_count) \
_ (u16, section_header_string_table_index)
unsigned long u64
Definition: types.h:89
unsigned int u32
Definition: types.h:88
unsigned short u16
Definition: types.h:57
u32 flags
Definition: vhost-user.h:73

Definition at line 225 of file elf.h.

#define foreach_elf64_section_header
Value:
_ (u32, name) \
_ (u32, type) \
_ (u64, flags) \
_ (u64, exec_address) \
_ (u64, file_offset) \
_ (u64, file_size) \
_ (u32, link) \
_ (u32, additional_info) \
_ (u64, align) \
_ (u64, entry_size)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
unsigned long u64
Definition: types.h:89
unsigned int u32
Definition: types.h:88
u32 flags
Definition: vhost-user.h:73

Definition at line 250 of file elf.h.

#define foreach_elf64_segment_header
Value:
_ (u32, type) \
_ (u32, flags) \
_ (u64, file_offset) \
_ (u64, virtual_address) \
_ (u64, physical_address) \
_ (u64, file_size) \
_ (u64, memory_size) \
_ (u64, align)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
unsigned long u64
Definition: types.h:89
unsigned int u32
Definition: types.h:88
u32 flags
Definition: vhost-user.h:73

Definition at line 273 of file elf.h.

#define foreach_elf64_symbol_header
Value:
_ (u32, name) \
_ (u8, binding_and_type) \
_ (u8, visibility) \
_ (u16, section_index) \
_ (u64, value) \
_ (u64, size)
unsigned long u64
Definition: types.h:89
unsigned int u32
Definition: types.h:88
u32 size
Definition: vhost-user.h:74
unsigned short u16
Definition: types.h:57
unsigned char u8
Definition: types.h:56

Definition at line 293 of file elf.h.

#define foreach_elf_abi
Value:
_ (SYSV, 0) \
_ (HPUX, 1) \
_ (NETBSD, 2) \
_ (LINUX, 3) \
_ (SOLARIS, 6) \
_ (AIX, 7) \
_ (IRIX, 8) \
_ (FREEBSD, 9) \
_ (COMPAQ_TRU64, 10) \
_ (MODESTO, 11) \
_ (OPENBSD, 12) \
_ (ARM, 97) \
_ (STANDALONE, 255)

Definition at line 57 of file elf.h.

#define foreach_elf_architecture

Definition at line 85 of file elf.h.

#define foreach_elf_data_encoding
Value:
_ (ENCODING_NONE) \
_ (TWOS_COMPLEMENT_LITTLE_ENDIAN) \
_ (TWOS_COMPLEMENT_BIG_ENDIAN)

Definition at line 49 of file elf.h.

#define foreach_elf_dynamic_entry_type

Definition at line 559 of file elf.h.

#define foreach_elf_dynamic_version_need_aux_field
Value:
_ (u32, hash) \
_ (u16, flags) \
_ (u16, versym_index) \
_ (u32, name) \
_ (u32, next_offset)
unsigned int u32
Definition: types.h:88
unsigned short u16
Definition: types.h:57
u32 flags
Definition: vhost-user.h:73

Definition at line 702 of file elf.h.

#define foreach_elf_dynamic_version_need_field
Value:
_ (u16, version) \
_ (u16, aux_count) \
_ (u32, file_name_offset) \
_ (u32, first_aux_offset) \
_ (u32, next_offset)
unsigned int u32
Definition: types.h:88
unsigned short u16
Definition: types.h:57

Definition at line 695 of file elf.h.

#define foreach_elf_file_class   _ (CLASS_NONE) _ (32BIT) _ (64BIT)

Definition at line 46 of file elf.h.

#define foreach_elf_file_type
Value:
_ (NONE, 0) \
_ (RELOC, 1) \
_ (EXEC, 2) \
_ (SHARED, 3) \
_ (CORE, 4) \
_ (OS_SPECIFIC_LO, 0xfe00) \
_ (OS_SPECIFIC_HI, 0xfeff) \
_ (ARCH_SPECIFIC_LO, 0xff00) \
_ (ARCH_SPECIFIC_HI, 0xffff)

Definition at line 73 of file elf.h.

foreach_elf_section_flag
Value:
_ (WRITE, 0) \
_ (ALLOC, 1) \
_ (EXEC, 2) \
_ (MERGE, 3) \
_ (STRING_TABLE, 5) \
_ (INFO_LINK, 6) \
_ (PRESERVE_LINK_ORDER, 7) \
_ (OS_NON_CONFORMING, 8) \
_ (GROUP, 9) \
_ (TLS, 10) \
_ (OS_SPECIFIC_LO, 20) \
_ (OS_SPECIFIC_HI, 27) \
_ (ARCH_SPECIFIC_LO, 28) \
_ (ARCH_SPECIFIC_HI, 31)

Definition at line 382 of file elf.h.

#define foreach_elf_section_type
Value:
_ (UNUSED, 0) \
_ (PROGRAM_DATA, 1) \
_ (SYMBOL_TABLE, 2) \
_ (STRING_TABLE, 3) \
_ (RELOCATION_ADD, 4) \
_ (SYMBOL_TABLE_HASH, 5) \
_ (DYNAMIC, 6) /* Dynamic linking information */ \
_ (NOTE, 7) /* Notes */ \
_ (NO_BITS, 8) /* Program space with no data (bss) */ \
_ (RELOCATION, 9) /* Relocation entries, no addends */ \
_ (DYNAMIC_SYMBOL_TABLE, 11) /* Dynamic linker symbol table */ \
_ (INIT_ARRAY, 14) /* Array of constructors */ \
_ (FINI_ARRAY, 15) /* Array of destructors */ \
_ (PREINIT_ARRAY, 16) /* Array of pre-constructors */ \
_ (GROUP, 17) /* Section group */ \
_ (SYMTAB_SHNDX, 18) /* Extended section indices */ \
_ (OS_SPECIFIC_LO, 0x60000000) /* Start OS-specific */ \
_ (GNU_LIBLIST, 0x6ffffff7) /* Prelink library list */ \
_ (CHECKSUM, 0x6ffffff8) /* Checksum for DSO content. */ \
_ (SUNW_MOVE, 0x6ffffffa) \
_ (SUNW_COMDAT, 0x6ffffffb) \
_ (SUNW_SYMINFO, 0x6ffffffc) \
_ (GNU_VERDEF, 0x6ffffffd) /* Version definition section. */ \
_ (GNU_VERNEED, 0x6ffffffe) /* Version needs section. */ \
_ (GNU_VERSYM, 0x6fffffff) /* Version symbol table. */ \
_ (ARCH_SPECIFIC_LO, 0x70000000) /* Start of processor-specific */ \
_ (ARCH_SPECIFIC_HI, 0x7fffffff) /* End of processor-specific */ \
_ (APP_SPECIFIC_LO, 0x80000000) /* Start of application-specific */ \
_ (APP_SPECIFIC_HI, 0x8fffffff) /* End of application-specific */

Definition at line 350 of file elf.h.

foreach_elf_segment_flag
Value:
_ (EXEC, 0) \
_ (WRITE, 1) \
_ (READ, 2) \
_ (OS_SPECIFIC_LO, 20) \
_ (OS_SPECIFIC_HI, 27) \
_ (ARCH_SPECIFIC_LO, 28) \
_ (ARCH_SPECIFIC_HI, 31)

Definition at line 512 of file elf.h.

#define foreach_elf_segment_type
Value:
_ (UNUSED, 0) \
_ (LOAD, 1) /* Loadable program segment */ \
_ (DYNAMIC, 2) /* Dynamic linking information */ \
_ (INTERP, 3) /* Program interpreter */ \
_ (NOTE, 4) /* Auxiliary information */ \
_ (SEGMENT_TABLE, 6) /* Entry for header table itself */ \
_ (TLS, 7) /* Thread-local storage segment */ \
_ (OS_SPECIFIC_LO, 0x60000000) /* Start of OS-specific */ \
_ (GNU_EH_FRAME, 0x6474e550) /* GCC .eh_frame_hdr segment */ \
_ (GNU_STACK, 0x6474e551) /* Indicates stack executability */ \
_ (GNU_RELRO, 0x6474e552) /* Read-only after relocation */ \
_ (SUNW_BSS, 0x6ffffffa) /* Sun specific BSS */ \
_ (SUNW_STACK, 0x6ffffffb) /* Sun specific stack */ \
_ (OS_SPECIFIC_HI, 0x6fffffff) /* End of OS-specific */ \
_ (ARCH_SPECIFIC_LO, 0x70000000) /* Start of processor-specific */ \
_ (ARCH_SPECIFIC_HI, 0x7fffffff) /* End of processor-specific */

Definition at line 493 of file elf.h.

#define foreach_elf_symbol_binding
Value:
_ (LOCAL, 0) /* Local symbol */ \
_ (GLOBAL, 1) /* Global symbol */ \
_ (WEAK, 2) /* Weak symbol */ \
_ (OS_SPECIFIC_LO, 10) /* Start of OS-specific */ \
_ (OS_SPECIFIC_HI, 12) /* End of OS-specific */ \
_ (ARCH_SPECIFIC_LO, 13) /* Start of processor-specific */ \
_ (ARCH_SPECIFIC_HI, 15) /* End of processor-specific */

Definition at line 418 of file elf.h.

#define foreach_elf_symbol_info_bound_to
Value:
_ (SELF, 0xffff) /* Symbol bound to self */ \
_ (PARENT, 0xfffe) /* Symbol bound to parent */ \
_ (RESERVED_LO, 0xff00) \
_ (RESERVED_HI, 0xffff)

Definition at line 456 of file elf.h.

#define foreach_elf_symbol_info_flags
Value:
_ (DIRECT) /* Direct bound symbol */ \
_ (PASS_THRU) /* Pass-thru symbol for translator */ \
_ (COPY) /* Symbol is a copy-reloc */ \
_ (LAZY_LOAD) /* Symbol bound to object to be lazy loaded */

Definition at line 463 of file elf.h.

#define foreach_elf_symbol_reserved_section_index
Value:
_ (ABSOLUTE, 0xfff1) /* Associated symbol is absolute */ \
_ (COMMON, 0xfff2) /* Associated symbol is common */ \
_ (XINDEX, 0xffff) /* Index is in extra table. */

Definition at line 337 of file elf.h.

#define foreach_elf_symbol_type
Value:
_ (NONE, 0) \
_ (DATA, 1) /* Symbol is a data object */ \
_ (CODE, 2) /* Symbol is a code object */ \
_ (SECTION, 3) /* Symbol associated with a section */ \
_ (FILE, 4) /* Symbol's name is file name */ \
_ (COMMON, 5) /* Symbol is a common data object */ \
_ (TLS, 6) /* Symbol is thread-local data */ \
_ (OS_SPECIFIC_LO, 10) /* Start of OS-specific */ \
_ (OS_SPECIFIC_HI, 12) /* End of OS-specific */ \
_ (ARCH_SPECIFIC_LO, 13) /* Start of processor-specific */ \
_ (ARCH_SPECIFIC_HI, 15) /* End of processor-specific */

Definition at line 428 of file elf.h.

#define foreach_elf_symbol_visibility
Value:
_ (DEFAULT, 0) /* Default symbol visibility rules */ \
_ (INTERNAL, 1) /* Processor specific hidden class */ \
_ (HIDDEN, 2) /* Unavailable in other modules */ \
_ (PROTECTED, 3) /* Not preemptible, not exported */

Definition at line 442 of file elf.h.

#define foreach_elf_x86_64_relocation_type
Value:
_ (NONE, 0) /* No reloc */ \
_ (DIRECT_64, 1) /* Direct 64 bit */ \
_ (PC_REL_I32, 2) /* PC relative 32 bit signed */ \
_ (GOT_REL_32, 3) /* 32 bit GOT entry */ \
_ (PLT_REL_32, 4) /* 32 bit PLT address */ \
_ (COPY, 5) /* Copy symbol at runtime */ \
_ (CREATE_GOT, 6) /* Create GOT entry */ \
_ (CREATE_PLT, 7) /* Create PLT entry */ \
_ (RELATIVE, 8) /* Adjust by program base */ \
_ (PC_REL_I32_GOT, 9) /* 32 bit PC relative offset to GOT */ \
_ (DIRECT_U32, 10) /* Direct 32 bit zero extended */ \
_ (DIRECT_I32, 11) /* Direct 32 bit sign extended */ \
_ (DIRECT_U16, 12) /* Direct 16 bit zero extended */ \
_ (PC_REL_I16, 13) /* 16 bit sign extended pc relative */ \
_ (DIRECT_I8, 14) /* Direct 8 bit sign extended */ \
_ (PC_REL_I8, 15) /* 8 bit sign extended pc relative */ \
_ (DTPMOD64, 16) /* ID of module containing symbol */ \
_ (DTPOFF64, 17) /* Offset in module's TLS block */ \
_ (TPOFF64, 18) /* Offset in initial TLS block */ \
_ (TLSGD, 19) /* 32 bit signed PC relative offset to two GOT entries for GD symbol */ \
_ (TLSLD, 20) /* 32 bit signed PC relative offset to two GOT entries for LD symbol */ \
_ (DTPOFF32, 21) /* Offset in TLS block */ \
_ (GOTTPOFF, 22) /* 32 bit signed PC relative offset to GOT entry for IE symbol */ \
_ (TPOFF32, 23) /* Offset in initial TLS, block) */

Definition at line 774 of file elf.h.

#define FORMAT_ELF_MAIN_DYNAMIC   (1 << 2)

Definition at line 998 of file elf.h.

#define FORMAT_ELF_MAIN_RELOCATIONS   (1 << 1)

Definition at line 997 of file elf.h.

#define FORMAT_ELF_MAIN_SYMBOLS   (1 << 0)

Definition at line 996 of file elf.h.

Enumeration Type Documentation

enum elf_abi_t
Enumerator
foreach_elf_abi 

Definition at line 178 of file elf.h.

Enumerator
foreach_elf_architecture 

Definition at line 188 of file elf.h.

Enumerator
ELF_N_DATA_ENCODING 

Definition at line 169 of file elf.h.

Enumerator
foreach_elf_dynamic_entry_type 

Definition at line 625 of file elf.h.

Enumerator
ELF_N_FILE_CLASS 

Definition at line 164 of file elf.h.

Enumerator
foreach_elf_file_type 

Definition at line 182 of file elf.h.

Enumerator
foreach_elf_section_flag 

Definition at line 405 of file elf.h.

Enumerator
foreach_elf_section_flag 

Definition at line 411 of file elf.h.

Enumerator
ELF_SECTION_OS_SPECIFIC_HI 

Definition at line 398 of file elf.h.

Enumerator
foreach_elf_segment_flag 

Definition at line 527 of file elf.h.

Enumerator
foreach_elf_segment_flag 

Definition at line 533 of file elf.h.

Enumerator
foreach_elf_segment_type 

Definition at line 521 of file elf.h.

Function Documentation

void elf_create_section_with_contents ( elf_main_t em,
char *  section_name,
elf64_section_header_t header,
void contents,
uword  n_content_bytes 
)

Definition at line 1870 of file elf.c.

clib_error_t* elf_delete_named_section ( elf_main_t em,
char *  section_name 
)

Definition at line 1855 of file elf.c.

+ Here is the call graph for this function:

uword elf_delete_segment_with_type ( elf_main_t em,
elf_segment_type_t  segment_type 
)

Definition at line 1918 of file elf.c.

clib_error_t* elf_get_section_by_name ( elf_main_t em,
char *  section_name,
elf_section_t **  result 
)

Definition at line 47 of file elf.c.

+ Here is the caller graph for this function:

clib_error_t* elf_get_section_by_start_address ( elf_main_t em,
uword  start_address,
elf_section_t **  result 
)

Definition at line 67 of file elf.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void* elf_get_section_contents ( elf_main_t em,
uword  section_index,
uword  elt_size 
)

Definition at line 936 of file elf.h.

+ Here is the caller graph for this function:

always_inline void elf_get_segment_contents ( elf_main_t em,
void data,
uword  segment_index 
)

Definition at line 926 of file elf.h.

always_inline void elf_main_free ( elf_main_t em)

Definition at line 903 of file elf.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void elf_main_init ( elf_main_t em)

Definition at line 897 of file elf.h.

+ Here is the caller graph for this function:

clib_error_t* elf_parse ( elf_main_t em,
void data,
uword  data_bytes 
)

Definition at line 951 of file elf.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void elf_parse_symbols ( elf_main_t em)

Definition at line 846 of file elf.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* elf_read_file ( elf_main_t em,
char *  file_name 
)

Definition at line 1286 of file elf.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void elf_relocation_table_free ( elf_relocation_table_t r)

Definition at line 828 of file elf.h.

+ Here is the caller graph for this function:

always_inline u8* elf_section_name ( elf_main_t em,
elf_section_t s 
)

Definition at line 974 of file elf.h.

+ Here is the caller graph for this function:

void elf_set_dynamic_entries ( elf_main_t em)

Definition at line 875 of file elf.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline void elf_set_section_contents ( elf_main_t em,
uword  section_index,
void new_contents,
uword  n_content_bytes 
)

Definition at line 961 of file elf.h.

+ Here is the caller graph for this function:

always_inline u16 elf_swap_u16 ( elf_main_t em,
u16  x 
)

Definition at line 985 of file elf.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline u32 elf_swap_u32 ( elf_main_t em,
u32  x 
)

Definition at line 989 of file elf.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline u64 elf_swap_u64 ( elf_main_t em,
u64  x 
)

Definition at line 993 of file elf.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

always_inline u8 elf_swap_u8 ( elf_main_t em,
u8  x 
)

Definition at line 981 of file elf.h.

always_inline u8* elf_symbol_name ( elf_symbol_table_t t,
elf64_symbol_t sym 
)

Definition at line 818 of file elf.h.

+ Here is the caller graph for this function:

always_inline void elf_symbol_table_free ( elf_symbol_table_t s)

Definition at line 811 of file elf.h.

+ Here is the caller graph for this function:

clib_error_t* elf_write_file ( elf_main_t em,
char *  file_name 
)

Definition at line 1678 of file elf.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

format_function_t format_elf_main

Definition at line 1000 of file elf.h.

format_function_t format_elf_symbol

Definition at line 1001 of file elf.h.