diff options
Diffstat (limited to 'bfd/elfnn-riscv.c')
-rw-r--r-- | bfd/elfnn-riscv.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c index 7f3ca72..db4b782 100644 --- a/bfd/elfnn-riscv.c +++ b/bfd/elfnn-riscv.c @@ -123,8 +123,6 @@ struct riscv_elf_link_hash_table struct elf_link_hash_table elf; /* Short-cuts to get to dynamic linker sections. */ - asection *sdynbss; - asection *srelbss; asection *sdyntdata; /* Small local sym to section mapping cache. */ @@ -363,17 +361,15 @@ riscv_elf_create_dynamic_sections (bfd *dynobj, if (!_bfd_elf_create_dynamic_sections (dynobj, info)) return FALSE; - htab->sdynbss = bfd_get_linker_section (dynobj, ".dynbss"); if (!bfd_link_pic (info)) { - htab->srelbss = bfd_get_linker_section (dynobj, ".rela.bss"); htab->sdyntdata = bfd_make_section_anyway_with_flags (dynobj, ".tdata.dyn", SEC_ALLOC | SEC_THREAD_LOCAL); } - if (!htab->elf.splt || !htab->elf.srelplt || !htab->sdynbss - || (!bfd_link_pic (info) && (!htab->srelbss || !htab->sdyntdata))) + if (!htab->elf.splt || !htab->elf.srelplt || !htab->elf.sdynbss + || (!bfd_link_pic (info) && (!htab->elf.srelbss || !htab->sdyntdata))) abort (); return TRUE; @@ -971,14 +967,14 @@ riscv_elf_adjust_dynamic_symbol (struct bfd_link_info *info, .rel.bss section we are going to use. */ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0) { - htab->srelbss->size += sizeof (ElfNN_External_Rela); + htab->elf.srelbss->size += sizeof (ElfNN_External_Rela); h->needs_copy = 1; } if (eh->tls_type & ~GOT_NORMAL) return _bfd_elf_adjust_dynamic_copy (info, h, htab->sdyntdata); - return _bfd_elf_adjust_dynamic_copy (info, h, htab->sdynbss); + return _bfd_elf_adjust_dynamic_copy (info, h, htab->elf.sdynbss); } /* Allocate space in .plt, .got and associated reloc sections for @@ -1332,7 +1328,7 @@ riscv_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) if (s == htab->elf.splt || s == htab->elf.sgot || s == htab->elf.sgotplt - || s == htab->sdynbss) + || s == htab->elf.sdynbss) { /* Strip this section if we don't need it; see the comment below. */ @@ -2400,7 +2396,7 @@ riscv_elf_finish_dynamic_symbol (bfd *output_bfd, rela.r_offset = sec_addr (h->root.u.def.section) + h->root.u.def.value; rela.r_info = ELFNN_R_INFO (h->dynindx, R_RISCV_COPY); rela.r_addend = 0; - riscv_elf_append_rela (output_bfd, htab->srelbss, &rela); + riscv_elf_append_rela (output_bfd, htab->elf.srelbss, &rela); } /* Mark some specially defined symbols as absolute. */ |