diff options
author | Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> | 2010-10-21 12:29:00 +0000 |
---|---|---|
committer | Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> | 2010-10-21 12:29:00 +0000 |
commit | 88a17e950ce4b3bf274a9f2c0d6eef1278880d74 (patch) | |
tree | 26f180cd3e3fd4fdd3898613b2a142c3e5d6f4d8 /bfd/elf32-i386.c | |
parent | 058255daa8193ae088e961a85c9069329e359f43 (diff) | |
download | binutils-redhat-88a17e950ce4b3bf274a9f2c0d6eef1278880d74.tar.gz |
* elf-bfd.h (struct elf_backend_data): New member
static_tls_alignment.
* elfxx-target.h (elf_backend_static_tls_alignment): Provide
default.
(elfNN_bed): Initialize static_tls_alignment.
* elflink.c (bfd_elf_final_link): Don't round end of TLS section
if static TLS has special alignment requirements.
* elf32-i386.c (elf_i386_tpoff): Define bed, static_tls_size.
Consider static_tls_alignment.
(elf_backend_static_tls_alignment): Redefine for Solaris 2.
Undef again for VxWorks.
* elf64-x86-64.c (elf64_x86_64_tpoff): Define bed,
static_tls_size.
Consider static_tls_alignment.
(elf_backend_static_tls_alignment): Redefine for Solaris 2.
Undef again for Intel L1OM.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r-- | bfd/elf32-i386.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 8d8bc855c1..ae749c6b4e 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -2828,11 +2828,16 @@ static bfd_vma elf_i386_tpoff (struct bfd_link_info *info, bfd_vma address) { struct elf_link_hash_table *htab = elf_hash_table (info); + const struct elf_backend_data *bed = get_elf_backend_data (info->output_bfd); + bfd_vma static_tls_size; /* If tls_sec is NULL, we should have signalled an error already. */ if (htab->tls_sec == NULL) return 0; - return htab->tls_size + htab->tls_sec->vma - address; + + /* Consider special static TLS alignment requirements. */ + static_tls_size = BFD_ALIGN (htab->tls_size, bed->static_tls_alignment); + return static_tls_size + htab->tls_sec->vma - address; } /* Relocate an i386 ELF section. */ @@ -4795,6 +4800,11 @@ elf_i386_fbsd_post_process_headers (bfd *abfd, struct bfd_link_info *info) #undef elf32_bed #define elf32_bed elf32_i386_sol2_bed +/* The 32-bit static TLS arena size is rounded to the nearest 8-byte + boundary. */ +#undef elf_backend_static_tls_alignment +#define elf_backend_static_tls_alignment 8 + /* The Solaris 2 ABI requires a plt symbol on all platforms. Cf. Linker and Libraries Guide, Ch. 2, Link-Editor, Generating the Output @@ -4848,6 +4858,7 @@ elf_i386_vxworks_link_hash_table_create (bfd *abfd) #undef elf_backend_final_write_processing #define elf_backend_final_write_processing \ elf_vxworks_final_write_processing +#undef elf_backend_static_tls_alignment /* On VxWorks, we emit relocations against _PROCEDURE_LINKAGE_TABLE_, so define it. */ |