1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +00:00

Loader: Add dynamic loader program

The dynamic loader exists as /usr/lib/Loader.so and is loaded by the
kernel when ET_DYN programs are executed.

The dynamic loader is responsible for loading the dependencies of the
main program, allocating TLS storage, preparing all loaded objects for
execution and finally jumping to the entry of the main program.
This commit is contained in:
Itamar 2020-10-10 18:17:49 +03:00 committed by Andreas Kling
parent 781aa424a9
commit 07b4957361
18 changed files with 962 additions and 104 deletions

View file

@ -778,15 +778,15 @@ struct elf_args {
/* Relocation types */
#define R_386_NONE 0
#define R_386_32 1 /* Symbol + Addend */
#define R_386_PC32 2 /* Symbol + Addend - Section offset */
#define R_386_GOT32 3 /* Used by build-time linker to create GOT entry */
#define R_386_PLT32 4 /* Used by build-time linker to create PLT entry */
#define R_386_COPY 5 /* https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter4-10454.html#chapter4-84604 */
#define R_386_GLOB_DAT 6 /* Relation b/w GOT entry and symbol */
#define R_386_JMP_SLOT 7 /* Fixed up by dynamic loader */
#define R_386_RELATIVE 8 /* Base address + Addned */
#define R_386_32 1 /* Symbol + Addend */
#define R_386_PC32 2 /* Symbol + Addend - Section offset */
#define R_386_GOT32 3 /* Used by build-time linker to create GOT entry */
#define R_386_PLT32 4 /* Used by build-time linker to create PLT entry */
#define R_386_COPY 5 /* https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter4-10454.html#chapter4-84604 */
#define R_386_GLOB_DAT 6 /* Relation b/w GOT entry and symbol */
#define R_386_JMP_SLOT 7 /* Fixed up by dynamic loader */
#define R_386_RELATIVE 8 /* Base address + Addned */
#define R_386_TLS_TPOFF 14 /* Negative offset into the static TLS storage */
#define R_386_TLS_TPOFF32 37
#endif /* _SYS_EXEC_ELF_H_ */