diff options
author | rie <none@none> | 2007-05-14 21:16:25 -0700 |
---|---|---|
committer | rie <none@none> | 2007-05-14 21:16:25 -0700 |
commit | f79d60b649ee2ee876810a3565101cc662899076 (patch) | |
tree | 9ee5457237a4304d9c5cc46e98d877d17aa0c759 /usr/src | |
parent | 82ca738fbd6274492844b3b937339232ddce04e8 (diff) | |
download | illumos-gate-f79d60b649ee2ee876810a3565101cc662899076.tar.gz |
6551627 OGL: SIGSEGV when trying to use OpenGL pipeline with splash screen, Solaris/Nvidia only
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/sgs/libld/common/update.c | 37 | ||||
-rw-r--r-- | usr/src/cmd/sgs/packages/common/SUNWonld-README | 2 | ||||
-rw-r--r-- | usr/src/cmd/sgs/rtld/common/tls.c | 36 |
3 files changed, 46 insertions, 29 deletions
diff --git a/usr/src/cmd/sgs/libld/common/update.c b/usr/src/cmd/sgs/libld/common/update.c index 6bafcb9868..3c163f7040 100644 --- a/usr/src/cmd/sgs/libld/common/update.c +++ b/usr/src/cmd/sgs/libld/common/update.c @@ -3263,34 +3263,41 @@ ld_update_outfile(Ofl_desc *ofl) #endif if (phdr->p_type == PT_TLS) { Os_desc *tlsosp; - Shdr *firstshdr = 0, *lastfilshdr, *lastmemshdr; + Shdr *firstshdr = 0, *lastfileshdr = 0, *lastshdr; if (ofl->ofl_ostlsseg.head == NULL) continue; + /* + * Scan through the sections that have contributed TLS. + * Remember the first and last so as to determine the + * TLS memory size requirement. Remember the last + * non-nobits section to determine the TLS data + * contribution, which determines the TLS file size. + */ for (LIST_TRAVERSE(&ofl->ofl_ostlsseg, lnp2, tlsosp)) { Shdr *tlsshdr = tlsosp->os_shdr; - if (firstshdr == 0) { - firstshdr = lastfilshdr = lastmemshdr = - tlsosp->os_shdr; - continue; - } - - if (tlsshdr->sh_type == SHT_NOBITS) - lastmemshdr = tlsshdr; - else - lastfilshdr = tlsshdr; + if (firstshdr == 0) + firstshdr = tlsshdr; + if (tlsshdr->sh_type != SHT_NOBITS) + lastfileshdr = tlsshdr; + lastshdr = tlsshdr; } phdr->p_flags = PF_R | PF_W; phdr->p_vaddr = firstshdr->sh_addr; phdr->p_offset = firstshdr->sh_offset; phdr->p_align = firstshdr->sh_addralign; - phdr->p_filesz = lastfilshdr->sh_offset + - lastfilshdr->sh_size - phdr->p_offset; - phdr->p_memsz = lastmemshdr->sh_offset + - lastmemshdr->sh_size - phdr->p_offset; + + if (lastfileshdr) + phdr->p_filesz = lastfileshdr->sh_offset + + lastfileshdr->sh_size - phdr->p_offset; + else + phdr->p_filesz = 0; + + phdr->p_memsz = lastshdr->sh_offset + + lastshdr->sh_size - phdr->p_offset; DBG_CALL(Dbg_seg_entry(ofl, segndx, sgp)); diff --git a/usr/src/cmd/sgs/packages/common/SUNWonld-README b/usr/src/cmd/sgs/packages/common/SUNWonld-README index 21949787aa..a9907c8cf9 100644 --- a/usr/src/cmd/sgs/packages/common/SUNWonld-README +++ b/usr/src/cmd/sgs/packages/common/SUNWonld-README @@ -1236,3 +1236,5 @@ Bugid Risk Synopsis (numeric -N equivalent) (D) PSARC/2007/247 Add -I option to elfdump 6532924 AMD64: Solaris 5.11 55b: SEGV after whocatches +6551627 OGL: SIGSEGV when trying to use OpenGL pipeline with splash screen, + Solaris/Nvidia only diff --git a/usr/src/cmd/sgs/rtld/common/tls.c b/usr/src/cmd/sgs/rtld/common/tls.c index 10112adbaf..471bd47dc6 100644 --- a/usr/src/cmd/sgs/rtld/common/tls.c +++ b/usr/src/cmd/sgs/rtld/common/tls.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -263,30 +263,38 @@ tls_statmod(Lm_list *lml, Rt_map *lmp) fptr = (void (*)())lml->lm_lcs[CI_TLS_STATMOD].lc_un.lc_func; /* + * Allocate a buffer to report the TLS modules, the buffer consists of: + * + * TLS_modinfo * ptrs[tlsmodcnt + 1] + * TLS_modinfo bufs[tlsmodcnt] + * + * The ptrs are initialized to the bufs - except the last one which + * null terminates the array. + * + * Note, even if no TLS has yet been observed, we still supply a + * TLS buffer with a single null entry. This allows us to initialize + * the backup TLS reservation. + */ + if ((tlsmodlist = calloc((sizeof (TLS_modinfo *) * (tlsmodcnt + 1)) + + (sizeof (TLS_modinfo) * tlsmodcnt), 1)) == 0) + return (0); + + lml->lm_tls = 0; + + /* * If we don't have any TLS modules - report that and return. */ if (tlsmodcnt == 0) { if (fptr) - (*fptr)(0, 0); + (*fptr)(tlsmodlist, tls_static_resv); DBG_CALL(Dbg_tls_static_block(&lml_main, 0, 0, tls_static_resv)); return (1); } - lml->lm_tls = 0; /* - * Allocate a buffer to report the TLS modules, the buffer consists of: - * - * TLS_modinfo * ptrs[tlsmodcnt + 1] - * TLS_modinfo bufs[tlsmodcnt] - * - * The ptrs are initialized to the bufs - except the last - * one which null terminates the array. + * Initialize the TLS buffer. */ - if ((tlsmodlist = calloc((sizeof (TLS_modinfo *) * (tlsmodcnt + 1)) + - (sizeof (TLS_modinfo) * tlsmodcnt), 1)) == 0) - return (0); - tlsbuflist = (TLS_modinfo *)((uintptr_t)tlsmodlist + ((tlsmodcnt + 1) * sizeof (TLS_modinfo *))); |