UbixOS V2 2.0

Data Structures | Macros | Typedefs | Functions
elf.h File Reference
`#include <sys/types.h>`
`#include <i386/elf.h>`
`#include <sys/elf32.h>`
`#include <sys/elf64.h>`
`#include <ubixos/ubthread.h>`
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_file

## Macros
#define | __i386__ 1
#define | elfExecutable 0x002
#define | elfLibrary 0x003

## Typedefs
typedef struct elf_file * | elf_file_t

## Functions
int | elf_load_file (kTask_t *p, const char *file, uint32_t *addr, uint32_t *entry)
char * | elfGetPhType (int)
char * | elfGetRelType (int)
char * | elfGetShType (int)

## Macro Definition Documentation

## ◆ __i386__

#define __i386__ 1

Definition at line 32 of file elf.h.

## ◆ elfExecutable

#define elfExecutable 0x002

Definition at line 80 of file elf.h.

## ◆ elfLibrary

#define elfLibrary 0x003

Definition at line 81 of file elf.h.

## Typedef Documentation

## ◆ elf_file_t

typedef struct elf_file * elf_file_t

## Function Documentation

## ◆ elf_load_file()

int elf_load_file | ( | kTask_t * | p,
|  | const char * | file,
|  | uint32_t * | addr,
|  | uint32_t * | entry
| ) |  |

Definition at line 37 of file elf.c.

References _current, Elf32_Ehdr::e_entry, Elf32_Ehdr::e_ident, Elf32_Ehdr::e_phnum, Elf32_Ehdr::e_phoff, Elf32_Ehdr::e_type, ET_DYN, ET_EXEC, fclose(), fopen(), fread(), fseek(), taskStruct::id, K_PANIC, kfree(), kmalloc(), memset(), Elf32_Phdr::p_memsz, Elf32_Phdr::p_vaddr, PAGE_DEFAULT, PAGE_PRESENT, PAGE_USER, PT_LOAD, vmm_findFreePage(), vmm_remapPage(), and vmm_setPageAttributes().

Here is the call graph for this function:

## ◆ elfGetPhType()

char* elfGetPhType | ( | int |  | ) |

Definition at line 163 of file elf.c.

References elfPhType, and phTypeName.

## ◆ elfGetRelType()

char* elfGetRelType | ( | int |  | ) |

Definition at line 167 of file elf.c.

References elfRelType, and relTypeName.

Referenced by kmod_load(), and ldEnable().

## ◆ elfGetShType()

char* elfGetShType | ( | int |  | ) |

Definition at line 159 of file elf.c.

References elfShType, and shTypeName.