diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-07-30 05:21:00 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-07-30 05:21:00 +0000 |
commit | fa79cd0e363fcead20553ab3e7377128f9536e08 (patch) | |
tree | 045d27129e29374470be17c3e19da0f2d4799324 | |
parent | 0d2f48bb4a25495bbb44ab4ef3a9a545cdc19359 (diff) | |
download | glibc-fa79cd0e363fcead20553ab3e7377128f9536e08.tar.gz glibc-fa79cd0e363fcead20553ab3e7377128f9536e08.tar.xz glibc-fa79cd0e363fcead20553ab3e7377128f9536e08.zip |
(_dl_determine_tlsoffset): Restore alignment of TCB used before the last change so that it matches ld's output for IE code.
-rw-r--r-- | sysdeps/generic/dl-tls.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sysdeps/generic/dl-tls.c b/sysdeps/generic/dl-tls.c index ccad53c59f..48d90ab8bb 100644 --- a/sysdeps/generic/dl-tls.c +++ b/sysdeps/generic/dl-tls.c @@ -150,13 +150,6 @@ _dl_determine_tlsoffset (void) assuming the first byte of the TLS block is aligned according to p_align. - We can handle this wrong behavior because of another bug in GNU - ld. The p_vaddr field of the TLS segment must be zero (according - to the spec) since the linker does not know the address or offset - where it will end up at. Once a linker is available which - handles the alignment correctly it should set p_addr to zero and - all will automatically fall into place. - The extra space which might be allocated before the first byte of the TLS block need not go unused. The code below tries to use that memory for the next TLS block. This can work if the total @@ -165,11 +158,11 @@ _dl_determine_tlsoffset (void) # if TLS_TCB_AT_TP /* We simply start with zero. */ - max_align = __alignof (void *); + slotinfo = GL(dl_tls_dtv_slotinfo_list)->slotinfo; + max_align = slotinfo[1].map != NULL ? slotinfo[1].map->l_tls_align : 1; offset = 0; freebytes = 0; - slotinfo = GL(dl_tls_dtv_slotinfo_list)->slotinfo; for (cnt = 1; slotinfo[cnt].map != NULL; ++cnt) { assert (cnt < GL(dl_tls_dtv_slotinfo_list)->len); |