From 044ad7e3d72dacb50a59aa55998122e3cadbb33a Mon Sep 17 00:00:00 2001 From: Kaz Kojima Date: Thu, 28 Oct 2004 12:00:17 +0000 Subject: [PATCH] * elf32-sh.c (tpoff): Take alignment into account. --- bfd/ChangeLog | 4 ++++ bfd/elf32-sh.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index bc8ab224d3..b228690fa7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2004-10-28 Kaz Kojima + + * elf32-sh.c (tpoff): Take alignment into account. + 2004-10-28 Nick Clifton * elf32-iq2000.c (iq2000_elf_relocate_section): Do nothing when diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index de827f39f0..80c0f811b1 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -6002,7 +6002,9 @@ tpoff (struct bfd_link_info *info, bfd_vma address) return 0; /* SH TLS ABI is variant I and static TLS block start just after tcbhead structure which has 2 pointer fields. */ - return address - elf_hash_table (info)->tls_sec->vma + 8; + return (address - elf_hash_table (info)->tls_sec->vma + + align_power ((bfd_vma) 8, + elf_hash_table (info)->tls_sec->alignment_power)); } static asection *