aboutsummaryrefslogtreecommitdiff
path: root/elf/tst-tlsmod14a.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-07-24 20:07:00 +0000
committerUlrich Drepper <drepper@redhat.com>2003-07-24 20:07:00 +0000
commit99fe3b0e7a0a9d72152cc86df0571c231c83cae4 (patch)
treecea072329bb202a3a432a17d1fd3d7d77d8cea10 /elf/tst-tlsmod14a.c
parent6bc0b95489067acc56efb0d8e1d88fe18644389f (diff)
downloadglibc-99fe3b0e7a0a9d72152cc86df0571c231c83cae4.tar
glibc-99fe3b0e7a0a9d72152cc86df0571c231c83cae4.tar.gz
glibc-99fe3b0e7a0a9d72152cc86df0571c231c83cae4.tar.bz2
glibc-99fe3b0e7a0a9d72152cc86df0571c231c83cae4.zip
Update.
2003-07-24 Ulrich Drepper <drepper@redhat.com> * include/link.h (struct link_map): Add l_tls_firstbyte_offset field. * sysdeps/generic/dl-tls.c [TLS_TCB_AT_TP] (_dl_determine_tlsoffset): Fix calculation of offsets to take misalignment of first byte in file into account. * elf/dl-load.c (_dl_map_object_from_fd): Initialize l_tls_firstbyte_offset field. * elf/rtld.c (_dl_start_final, _dl_start, dl_main): Likewise. * elf/dl-reloc.c (_dl_allocate_static_tls): Change return type to int. Take l_tls_firstbyte_offset information into account. (CHECK_STATIS_TLS): _dl_allocate_static_tls can fail now. * sysdeps/generic/ldsodefs.h: Adjust _dl_allocate_static_tls prototype. * elf/Makefile: Add rules to build and run tst-tls14. * elf/tst-tls14.c: New file. * elf/tst-tlsmod14a.c: New file. * elf/tst-tlsmod14b.c: New file.
Diffstat (limited to 'elf/tst-tlsmod14a.c')
-rw-r--r--elf/tst-tlsmod14a.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/elf/tst-tlsmod14a.c b/elf/tst-tlsmod14a.c
new file mode 100644
index 0000000000..4843e5937e
--- /dev/null
+++ b/elf/tst-tlsmod14a.c
@@ -0,0 +1,36 @@
+#include <stdint.h>
+#include <stdio.h>
+
+
+#define AL 4096
+struct foo
+{
+ int i;
+} __attribute ((aligned (AL)));
+
+static __thread struct foo f;
+static struct foo g;
+
+
+#ifndef FCT
+# define FCT in_dso1
+#endif
+
+
+int
+FCT (void)
+{
+ puts (__func__);
+
+ int result = 0;
+
+ int fail = (((uintptr_t) &f) & (AL - 1)) != 0;
+ printf ("&f = %p %s\n", &f, fail ? "FAIL" : "OK");
+ result |= fail;
+
+ fail = (((uintptr_t) &g) & (AL - 1)) != 0;
+ printf ("&g = %p %s\n", &g, fail ? "FAIL" : "OK");
+ result |= fail;
+
+ return result;
+}