aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorRainer Orth <ro@TechFak.Uni-Bielefeld.DE>2010-10-21 12:29:02 +0000
committerRainer Orth <ro@TechFak.Uni-Bielefeld.DE>2010-10-21 12:29:02 +0000
commit7dc98aeaf1f3fe256e284347a41f1c150955c37d (patch)
treee23ae18c7da2ab9067dc8a1fd70355977aad6344 /bfd/elf32-i386.c
parent3e057702240894f82645b6d788b88ebba50d1550 (diff)
downloadgdb-7dc98aeaf1f3fe256e284347a41f1c150955c37d.zip
gdb-7dc98aeaf1f3fe256e284347a41f1c150955c37d.tar.gz
gdb-7dc98aeaf1f3fe256e284347a41f1c150955c37d.tar.bz2
* 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.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 8d8bc85..ae749c6 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. */