Changeset 2c4e1cc in mainline for uspace/lib/c/generic/rtld/module.c


Ignore:
Timestamp:
2018-04-04T17:01:18Z (7 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5754c31e
Parents:
1433ecda
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-04-03 16:54:34)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-04-04 17:01:18)
Message:

Define TLS consistently in linker scripts, and remove nonstandard symbols.

Read the program header to find TLS instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/rtld/module.c

    r1433ecda r2c4e1cc  
    7070        module->local = true;
    7171
    72         module->tdata = &_tdata_start;
    73         module->tdata_size = &_tdata_end - &_tdata_start;
    74         module->tbss_size = &_tbss_end - &_tbss_start;
    75         module->tls_align = (uintptr_t)&_tls_alignment;
     72        const elf_segment_header_t *tls =
     73            elf_get_phdr(__executable_start, PT_TLS);
     74        uintptr_t bias = elf_get_bias(__executable_start);
     75
     76        module->tdata = (void *) (tls->p_vaddr + bias);
     77        module->tdata_size = tls->p_filesz;
     78        module->tbss_size = tls->p_memsz - tls->p_filesz;
     79        module->tls_align = tls->p_align;
    7680
    7781        list_append(&module->modules_link, &rtld->modules);
Note: See TracChangeset for help on using the changeset viewer.