diff options
author | dfr <dfr@FreeBSD.org> | 2004-08-03 08:51:00 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2004-08-03 08:51:00 +0000 |
commit | 4e9853427fa3cd90808fd8369e917f588b1ee5c0 (patch) | |
tree | 5493edb6b3a69f88f4154145f1edf0879595204f /libexec/rtld-elf/sparc64/reloc.c | |
parent | 5a48e6bc9fa5e4eb90bf8dc018ec35469df1d4ea (diff) | |
download | FreeBSD-src-4e9853427fa3cd90808fd8369e917f588b1ee5c0.zip FreeBSD-src-4e9853427fa3cd90808fd8369e917f588b1ee5c0.tar.gz |
Add support for Thread Local Storage.
Diffstat (limited to 'libexec/rtld-elf/sparc64/reloc.c')
-rw-r--r-- | libexec/rtld-elf/sparc64/reloc.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libexec/rtld-elf/sparc64/reloc.c b/libexec/rtld-elf/sparc64/reloc.c index c083c9c..0b44bec 100644 --- a/libexec/rtld-elf/sparc64/reloc.c +++ b/libexec/rtld-elf/sparc64/reloc.c @@ -717,3 +717,24 @@ install_plt(Elf_Half *pltgot, Elf_Addr proc) pltgot[7] = MOV_g1_o0; flush(pltgot, 28); } + +void +allocate_initial_tls(Obj_Entry *objs) +{ + register Elf_Addr** tp __asm__("%g7"); + + /* + * Fix the size of the static TLS block by using the maximum + * offset allocated so far and adding a bit for dynamic modules to + * use. + */ + tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA; + tp = allocate_tls(objs, NULL, 2*sizeof(Elf_Addr), sizeof(Elf_Addr)); +} + +void *__tls_get_addr(tls_index *ti) +{ + register Elf_Addr** tp __asm__("%g7"); + + return tls_get_addr_common(tp, ti->ti_module, ti->ti_offset); +} |