summaryrefslogtreecommitdiff
path: root/bfd/elf32-sh.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2003-11-04 06:16:37 +0000
committerAlan Modra <amodra@bigpond.net.au>2003-11-04 06:16:37 +0000
commit91363aa70d7d7109a839a394256b748af3205cff (patch)
tree4891c7c0446d54b2eb0e460bd40e8e4c903c6829 /bfd/elf32-sh.c
parentbd4e6caffe94502bb769133e72d78fa6f544b9e0 (diff)
downloadgdb-91363aa70d7d7109a839a394256b748af3205cff.tar.gz
* bfd-in.h (_bfd_elf_tls_setup): Declare.
* bfd-in2.h: Regenerate. * elf-bfd.h (struct elf_link_tls_segment): Delete. (struct elf_link_hash_table): Add tls_sec and tls_size. * elf.c (_bfd_elf_link_hash_table_init): Init tls_sec and tls_size. * elflink.c (_bfd_elf_tls_setup): New function. * elflink.h (struct elf_final_link_info): Remove first_tls_sec. (elf_bfd_final_link): Don't set first_tls_sec here. Update code saving tls segment info, round segment size up. (elf_link_output_extsym): Adjust code using tls segment info. (elf_link_input_bfd): Likewise. * elf32-i386.c (dtpoff_base, tpoff): Likewise. * elf32-s390.c (dtpoff_base, tpoff): Likewise. * elf32-sh.c (dtpoff_base, tpoff): Likewise. * elf32-sparc.c (dtpoff_base, tpoff): Likewise. * elf64-s390.c (dtpoff_base, tpoff): Likewise. * elf64-x86-64.c (dtpoff_base, tpoff): Likewise. * elfxx-ia64.c (elfNN_ia64_tprel_base): Likewise. (elfNN_ia64_dtprel_base): Likewise. * elf64-alpha.c (alpha_get_dtprel_base): Likewise. (alpha_get_tprel_base): Likewise. (struct alpha_relax_info): Remove tls_segment. (elf64_alpha_relax_got_load): Adjust invocation of alpha_get_dtprel_base and alpha_get_tprel_base. (elf64_alpha_relax_tls_get_addr): Likewise. (elf64_alpha_relax_section): Likewise. (elf64_alpha_relocate_section): Likewise. (elf64_alpha_relax_find_tls_segment): Delete. * elf32-ppc.c (struct ppc_elf_link_hash_table): Remove tls_sec. (ppc_elf_tls_setup): Call _bfd_elf_tls_setup. Return section. (ppc_elf_relocate_section): Adjust to use elf.tls_sec. * elf32-ppc.h (ppc_elf_tls_setup): Update. * elf64-ppc.c (struct ppc_link_hash_table): Remove tls_sec. (ppc64_elf_tls_setup): Call _bfd_elf_tls_setup. Return section. (ppc64_elf_tls_optimize): Adjust to use elf.tls_sec. (ppc64_elf_relocate_section): Likewise. * elf64-ppc.h (ppc64_elf_tls_setup): Update. * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Call _bfd_elf_tls_setup.
Diffstat (limited to 'bfd/elf32-sh.c')
-rw-r--r--bfd/elf32-sh.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 4fa6620bcc1..34036e52845 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -6021,10 +6021,10 @@ sh_elf_get_relocated_section_contents (bfd *output_bfd,
static bfd_vma
dtpoff_base (struct bfd_link_info *info)
{
- /* If tls_segment is NULL, we should have signalled an error already. */
- if (elf_hash_table (info)->tls_segment == NULL)
+ /* If tls_sec is NULL, we should have signalled an error already. */
+ if (elf_hash_table (info)->tls_sec == NULL)
return 0;
- return elf_hash_table (info)->tls_segment->start;
+ return elf_hash_table (info)->tls_sec->vma;
}
/* Return the relocation value for R_SH_TLS_TPOFF32.. */
@@ -6032,12 +6032,12 @@ dtpoff_base (struct bfd_link_info *info)
static bfd_vma
tpoff (struct bfd_link_info *info, bfd_vma address)
{
- /* If tls_segment is NULL, we should have signalled an error already. */
- if (elf_hash_table (info)->tls_segment == NULL)
+ /* If tls_sec is NULL, we should have signalled an error already. */
+ if (elf_hash_table (info)->tls_sec == NULL)
return 0;
/* SH TLS ABI is variant I and static TLS block start just after tcbhead
structure which has 2 pointer fields. */
- return (address - dtpoff_base (info) + 8);
+ return address - elf_hash_table (info)->tls_sec->vma + 8;
}
static asection *