diff options
author | Alan Modra <amodra@gmail.com> | 2003-07-10 00:37:27 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2003-07-10 00:37:27 +0000 |
commit | e717da7ead54704139ab3c160e95ed3db479d871 (patch) | |
tree | 894d27d29db547fc787ec15d3d799e13c004c2e7 /bfd/elflink.h | |
parent | 149ebfb1debe345ddcb167ba88f1bff0b92c56db (diff) | |
download | gdb-e717da7ead54704139ab3c160e95ed3db479d871.zip gdb-e717da7ead54704139ab3c160e95ed3db479d871.tar.gz gdb-e717da7ead54704139ab3c160e95ed3db479d871.tar.bz2 |
* elf64-ppc.c (bfd_elf64_mkobject): Define.
(struct ppc64_elf_obj_tdata): New.
(ppc64_elf_tdata, ppc64_tlsld_got): Define.
(ppc64_elf_mkobject): New function.
(struct got_entry): Add "owner". Move "tls_type".
(struct ppc_link_hash_table): Delete "relgot", "tlsld_got".
(ppc64_elf_init_stub_bfd): New function.
(create_got_section): Create header .got in dynobj. Create .got
and .rela.got in each bfd. Stash pointers in ppc64_elf_obj_tdata.
(ppc64_elf_create_dynamic_sections): Don't call create_got_section.
Look for dynobj .got, and test it.
(ppc64_elf_copy_indirect_symbol): Adjust for changed got.
(update_local_sym_info): Likewise.
(ppc64_elf_check_relocs): Likewise.
(ppc64_elf_gc_sweep_hook): Likewise.
(ppc64_elf_tls_optimize): Likewise.
(allocate_dynrelocs): Likewise.
(ppc64_elf_size_dynamic_sections): Likewise.
(ppc64_elf_relocate_section): Likewise.
(ppc64_elf_next_toc_section): Update comment.
(toc_adjusting_stub_needed): Remove unneeded cast.
(ppc64_elf_build_stubs): Check for stub sections in stub bfd by
testing section flags.
(ppc64_elf_build_stubs): Likewise.
(ppc64_elf_size_stubs): Likewise. Remove stub_bfd param.
(ppc64_elf_finish_dynamic_sections): Write out got sections.
(func_desc_adjust): Copy over dynamic info for undef weaks.
* elf64-ppc.h (ppc64_elf_init_stub_bfd): Declare.
(ppc64_elf_size_stubs): Update prototype.
* elflink.h (elf_link_sort_relocs): Use link_orders to find reldyn
input sections rather than scanning dynobj.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r-- | bfd/elflink.h | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index f679ab7..661b023 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -3029,8 +3029,7 @@ elf_link_sort_relocs (abfd, info, psec) struct bfd_link_info *info; asection **psec; { - bfd *dynobj = elf_hash_table (info)->dynobj; - asection *reldyn, *o; + asection *reldyn; bfd_size_type count, size; size_t i, ret, sort_elt, ext_size; bfd_byte *sort, *s_non_relative, *p; @@ -3039,6 +3038,7 @@ elf_link_sort_relocs (abfd, info, psec) int i2e = bed->s->int_rels_per_ext_rel; void (*swap_in) PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); void (*swap_out) PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); + struct bfd_link_order *lo; reldyn = bfd_get_section_by_name (abfd, ".rela.dyn"); if (reldyn == NULL || reldyn->_raw_size == 0) @@ -3059,11 +3059,12 @@ elf_link_sort_relocs (abfd, info, psec) count = reldyn->_raw_size / ext_size; size = 0; - for (o = dynobj->sections; o != NULL; o = o->next) - if ((o->flags & (SEC_HAS_CONTENTS|SEC_LINKER_CREATED)) - == (SEC_HAS_CONTENTS|SEC_LINKER_CREATED) - && o->output_section == reldyn) - size += o->_raw_size; + for (lo = reldyn->link_order_head; lo != NULL; lo = lo->next) + if (lo->type == bfd_indirect_link_order) + { + asection *o = lo->u.indirect.section; + size += o->_raw_size; + } if (size != reldyn->_raw_size) return 0; @@ -3079,12 +3080,11 @@ elf_link_sort_relocs (abfd, info, psec) return 0; } - for (o = dynobj->sections; o != NULL; o = o->next) - if ((o->flags & (SEC_HAS_CONTENTS|SEC_LINKER_CREATED)) - == (SEC_HAS_CONTENTS|SEC_LINKER_CREATED) - && o->output_section == reldyn) + for (lo = reldyn->link_order_head; lo != NULL; lo = lo->next) + if (lo->type == bfd_indirect_link_order) { bfd_byte *erel, *erelend; + asection *o = lo->u.indirect.section; erel = o->contents; erelend = o->contents + o->_raw_size; @@ -3121,12 +3121,11 @@ elf_link_sort_relocs (abfd, info, psec) qsort (s_non_relative, (size_t) count - ret, sort_elt, elf_link_sort_cmp2); - for (o = dynobj->sections; o != NULL; o = o->next) - if ((o->flags & (SEC_HAS_CONTENTS|SEC_LINKER_CREATED)) - == (SEC_HAS_CONTENTS|SEC_LINKER_CREATED) - && o->output_section == reldyn) + for (lo = reldyn->link_order_head; lo != NULL; lo = lo->next) + if (lo->type == bfd_indirect_link_order) { bfd_byte *erel, *erelend; + asection *o = lo->u.indirect.section; erel = o->contents; erelend = o->contents + o->_raw_size; |