FrostWing
A lightweight raw-control operating system.
Loading...
Searching...
No Matches
fdlfcn.h
1#ifndef __FDLFCN_H_
2#define __FDLFCN_H_ 1
3
4#include <heap.h>
5#include <executables/elf.h>
6
7// signifies that (for example dlysm) should look through the list of loaded so files and find the address of the given symbol
8#define FLD_NEXT (void*)-1
9
10typedef struct fdlfcn_handle
11{
12 void* address;
13 Elf64_Ehdr ehdr;
14 Elf64_Shdr* shdrs;
15 Elf64_Sym* symbols;
16 Elf64_Rela* relocations;
17
18 int symtab_index;
19 int text_section_index;
20 void* string_table_data;
21 void* text_section_data;
22 void* data_section_data;
23 void* rodata_section_data;
24 void* symtab_str_section_data;
25
26 Elf64_Shdr* text_section_header;
27 Elf64_Shdr* string_table_header;
28 Elf64_Shdr* data_section_header;
29 Elf64_Shdr* rodata_section_header;
30 Elf64_Shdr* symtab_str_section_header;
31
32 struct fdlfcn_handle* prev;
33 struct fdlfcn_handle* next;
35
36// immediately load sections into memory
37#define FDL_IMMEDIATE 0
38
39fdlfcn_handle* fdlopen(void* filedata, int flags);
40void* fdlsym(fdlfcn_handle* handle, const char* symbol_name);
41int fdlclose(fdlfcn_handle* handle);
42
43// defines that make my life easier
44#define dlopen fdlopen
45#define dlsym fdlsym
46#define dlclose fdlclose
47
48#endif
Header files for heap.