Changeset 6adb775f in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2016-04-25T16:46:31Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
32573ff
Parents:
dc0d8b52
Message:

TLS for dynamically linked executables and initially loaded DSOs (but must not call dlopen or there will be trouble).

Location:
uspace/lib/c/include
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/elf/elf_mod.h

    rdc0d8b52 r6adb775f  
    5858} eld_flags_t;
    5959
     60/** TLS info for a module */
     61typedef struct {
     62        /** tdata section image */
     63        void *tdata;
     64        /** Size of tdata section image in bytes */
     65        size_t tdata_size;
     66        /** Size of tbss section */
     67        size_t tbss_size;
     68} elf_tls_info_t;
     69
    6070/**
    6171 * Some data extracted from the headers are stored here
     
    7080        /** Pointer to the dynamic section */
    7181        void *dynamic;
     82
     83        /** TLS info */
     84        elf_tls_info_t tls;
    7285} elf_finfo_t;
    7386
  • uspace/lib/c/include/rtld/module.h

    rdc0d8b52 r6adb775f  
    4646extern module_t *module_load(rtld_t *, const char *);
    4747extern void module_load_deps(module_t *);
     48extern module_t *module_by_id(rtld_t *, unsigned long);
    4849
    4950extern void modules_process_relocs(rtld_t *, module_t *);
     51extern void modules_process_tls(rtld_t *);
    5052extern void modules_untag(rtld_t *);
    5153
  • uspace/lib/c/include/rtld/rtld.h

    rdc0d8b52 r6adb775f  
    4141
    4242#include <rtld/dynamic.h>
     43#include <tls.h>
    4344#include <types/rtld/rtld.h>
    4445
     
    4748extern void rtld_init_static(void);
    4849extern int rtld_prog_process(elf_finfo_t *, rtld_t **);
     50extern tcb_t *rtld_tls_make(rtld_t *);
     51extern unsigned long rtld_get_next_id(rtld_t *);
     52extern void *rtld_tls_get_addr(rtld_t *, void *, unsigned long, unsigned long);
    4953
    5054#endif
  • uspace/lib/c/include/tls.h

    rdc0d8b52 r6adb775f  
    5252extern void tls_free(tcb_t *);
    5353extern void tls_free_arch(tcb_t *, size_t);
     54extern size_t tls_get_size(void);
    5455
    5556#ifdef CONFIG_TLS_VARIANT_1
  • uspace/lib/c/include/types/rtld/module.h

    rdc0d8b52 r6adb775f  
    4040
    4141typedef struct module {
     42        /** Module ID */
     43        unsigned long id;
     44        /** Dynamic info for this module */
    4245        dyn_info_t dyn;
     46        /** Load bias */
    4347        size_t bias;
     48
     49        /** tdata image start */
     50        void *tdata;
     51        /** tdata image size */
     52        size_t tdata_size;
     53        /** tbss size */
     54        size_t tbss_size;
     55
     56        size_t ioffs;
    4457
    4558        /** Containing rtld */
  • uspace/lib/c/include/types/rtld/rtld.h

    rdc0d8b52 r6adb775f  
    4848        module_t *program;
    4949
     50        /** Next module ID */
     51        unsigned long next_id;
     52
     53        /** Size of initial TLS tdata + tbss */
     54        size_t tls_size;
     55
    5056        /** List of all loaded modules including rtld and the program */
    5157        list_t modules;
Note: See TracChangeset for help on using the changeset viewer.