source: mainline/uspace/lib/c/include/rtld/dynamic.h@ 9bfa8c8

Last change on this file since 9bfa8c8 was d7f7a4a, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago

Replace some license headers with SPDX identifier

Headers are replaced using tools/transorm-copyright.sh only
when it can be matched verbatim with the license header used
throughout most of the codebase.

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[1ea99cc]1/*
[d7f7a4a]2 * SPDX-FileCopyrightText: 2008 Jiri Svoboda
[1ea99cc]3 *
[d7f7a4a]4 * SPDX-License-Identifier: BSD-3-Clause
[1ea99cc]5 */
6
[8a1fb09]7/** @addtogroup libc
[1ea99cc]8 * @{
9 */
10/** @file
11 */
12
[4805495]13#ifndef _LIBC_RTLD_DYNAMIC_H_
14#define _LIBC_RTLD_DYNAMIC_H_
[1ea99cc]15
[3e6a98c5]16#include <stdbool.h>
[8a1fb09]17#include <rtld/elf_dyn.h>
[2ca5f632]18#include <libarch/rtld/dynamic.h>
[1ea99cc]19
20/**
21 * Holds the data extracted from an ELF Dynamic section.
22 *
23 * The data is already pre-processed: Pointers are adjusted
24 * to their final run-time values by adding the load bias
25 * and indices into the symbol table are converted to pointers.
26 */
27typedef struct dyn_info {
28 /** Relocation table without explicit addends */
29 void *rel;
30 size_t rel_sz;
31 size_t rel_ent;
32
33 /** Relocation table with explicit addends */
34 void *rela;
35 size_t rela_sz;
36 size_t rela_ent;
37
38 /** PLT relocation table */
39 void *jmp_rel;
40 size_t plt_rel_sz;
[634e020]41 /** Type of relocations used for the PLT, either DT_REL or DT_RELA */
42 int plt_rel;
[1ea99cc]43
44 /** Pointer to PLT/GOT (processor-specific) */
45 void *plt_got;
46
47 /** Hash table */
48 elf_word *hash;
49
50 /** String table */
51 char *str_tab;
52 size_t str_sz;
53
54 /** Symbol table */
55 void *sym_tab;
56 size_t sym_ent;
57
[04803bf]58 void *init; /**< Module initialization code */
59 void *fini; /**< Module cleanup code */
[1ea99cc]60
[04803bf]61 const char *soname; /**< Library identifier */
62 char *rpath; /**< Library search path list */
[1ea99cc]63
64 bool symbolic;
65 bool text_rel;
66 bool bind_now;
67
68 /* Assume for now that there's at most one needed library */
69 char *needed;
70
71 /** Pointer to the module's dynamic section */
72 elf_dyn_t *dynamic;
73
74 /** Architecture-specific info. */
75 dyn_info_arch_t arch;
76} dyn_info_t;
77
78void dynamic_parse(elf_dyn_t *dyn_ptr, size_t bias, dyn_info_t *info);
79void dyn_parse_arch(elf_dyn_t *dp, size_t bias, dyn_info_t *info);
80
81#endif
82
83/** @}
84 */
Note: See TracBrowser for help on using the repository browser.