make dlerror state and message thread-local and dynamically-allocated

this fixes truncation of error messages containing long pathnames or
symbol names.

the dlerror state was previously required by POSIX to be global. the
resolution of bug 97 relaxed the requirements to allow thread-safe
implementations of dlerror with thread-local state and message buffer.
This commit is contained in:
Rich Felker
2015-04-18 18:00:22 -04:00
parent fa80787698
commit 01d4274711
3 changed files with 65 additions and 32 deletions

View File

@@ -44,6 +44,8 @@ struct pthread {
volatile int exitlock[2];
volatile int startlock[2];
unsigned long sigmask[_NSIG/8/sizeof(long)];
char *dlerror_buf;
int dlerror_flag;
void *stdio_locks;
void **dtv_copy;
};