aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/x86_64/dl-tlsdesc.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-03-23 11:06:57 -0700
committerH.J. Lu <hjl.tools@gmail.com>2012-03-23 11:06:57 -0700
commit1532c7ac9aedd769f81aef9bf1653dab041b272b (patch)
treecc2bbd859d45b30e7fb6ae4f7b92fb68e4655b85 /sysdeps/x86_64/dl-tlsdesc.h
parent3ff4252677ff55a0dd4ded5b5cbccda25812ba12 (diff)
downloadglibc-1532c7ac9aedd769f81aef9bf1653dab041b272b.tar
glibc-1532c7ac9aedd769f81aef9bf1653dab041b272b.tar.gz
glibc-1532c7ac9aedd769f81aef9bf1653dab041b272b.tar.bz2
glibc-1532c7ac9aedd769f81aef9bf1653dab041b272b.zip
Make sure x86_64 GOT entry slot is always 8 bytes
Diffstat (limited to 'sysdeps/x86_64/dl-tlsdesc.h')
-rw-r--r--sysdeps/x86_64/dl-tlsdesc.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/sysdeps/x86_64/dl-tlsdesc.h b/sysdeps/x86_64/dl-tlsdesc.h
index 82a010922d..06ede02148 100644
--- a/sysdeps/x86_64/dl-tlsdesc.h
+++ b/sysdeps/x86_64/dl-tlsdesc.h
@@ -29,14 +29,24 @@
/* Type used to represent a TLS descriptor in the GOT. */
struct tlsdesc
{
- ptrdiff_t (*entry)(struct tlsdesc *on_rax);
- void *arg;
+ /* Anonymous union is used here to ensure that GOT entry slot is always
+ 8 bytes for both x32 and x86-64. */
+ union
+ {
+ ptrdiff_t (*entry) (struct tlsdesc *on_rax);
+ uint64_t entry_slot;
+ };
+ union
+ {
+ void *arg;
+ uint64_t arg_slot;
+ };
};
typedef struct dl_tls_index
{
- unsigned long int ti_module;
- unsigned long int ti_offset;
+ uint64_t ti_module;
+ uint64_t ti_offset;
} tls_index;
/* Type used as the argument in a TLS descriptor for a symbol that