GNU Binutils with patches for OS216
Revision | 33e44f2eb27d78f57ed83d11f04652691d896a6f (tree) |
---|---|
Time | 2013-11-05 10:56:28 |
Author | Alan Modra <amodra@gmai...> |
Commiter | Alan Modra |
Update elf64-ppc.c to use elf_link_hash_table shortcuts.
These shortcuts to dynamic sections in ppc_link_hash_table predated
their geneneric elf hash table equivalents.
* elf64-ppc.c (struct ppc_link_hash_table): Remove got, plt, relplt,
iplt, reliplt. Update all references to use elf.sgot, elf.splt,
elf.srelplt, elf.iplt and elf.irelplt.
@@ -1,6 +1,11 @@ | ||
1 | +2013-11-05 Alan Modra <amodra@gmail.com> | |
2 | + | |
3 | + * elf64-ppc.c (struct ppc_link_hash_table): Remove got, plt, relplt, | |
4 | + iplt, reliplt. Update all references to use elf.sgot, elf.splt, | |
5 | + elf.srelplt, elf.iplt and elf.irelplt. | |
6 | + | |
1 | 7 | 2013-11-03 Sandra Loosemore <sandra@codesourcery.com> |
2 | 8 | |
3 | - bfd/ | |
4 | 9 | * elf32-niso2.c (nios2_elf32_do_hi16_relocate): Remove incorrect |
5 | 10 | ATTRIBUTE_UNUSED from parameter. |
6 | 11 | (nios2_elf_do_lo16_relocate): Likewise. |
@@ -1433,7 +1438,7 @@ | ||
1433 | 1438 | 2013-04-09 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> |
1434 | 1439 | |
1435 | 1440 | PR ld/12494 |
1436 | - * bfd/elf32-avr.c: Consider all sections to determine if linker | |
1441 | + * elf32-avr.c: Consider all sections to determine if linker | |
1437 | 1442 | relaxation can safely delete a ret after a call/jmp |
1438 | 1443 | |
1439 | 1444 | 2013-04-09 Mingjie Xing <mingjie.xing@gmail.com> |
@@ -3909,12 +3909,7 @@ struct ppc_link_hash_table | ||
3909 | 3909 | /* List of input sections for each output section. */ |
3910 | 3910 | asection **input_list; |
3911 | 3911 | |
3912 | - /* Short-cuts to get to dynamic linker sections. */ | |
3913 | - asection *got; | |
3914 | - asection *plt; | |
3915 | - asection *relplt; | |
3916 | - asection *iplt; | |
3917 | - asection *reliplt; | |
3912 | + /* Shortcuts to get to dynamic linker sections. */ | |
3918 | 3913 | asection *dynbss; |
3919 | 3914 | asection *relbss; |
3920 | 3915 | asection *glink; |
@@ -4257,18 +4252,17 @@ create_linkage_sections (bfd *dynobj, struct bfd_link_info *info) | ||
4257 | 4252 | } |
4258 | 4253 | |
4259 | 4254 | flags = SEC_ALLOC | SEC_LINKER_CREATED; |
4260 | - htab->iplt = bfd_make_section_anyway_with_flags (dynobj, ".iplt", flags); | |
4261 | - if (htab->iplt == NULL | |
4262 | - || ! bfd_set_section_alignment (dynobj, htab->iplt, 3)) | |
4255 | + htab->elf.iplt = bfd_make_section_anyway_with_flags (dynobj, ".iplt", flags); | |
4256 | + if (htab->elf.iplt == NULL | |
4257 | + || ! bfd_set_section_alignment (dynobj, htab->elf.iplt, 3)) | |
4263 | 4258 | return FALSE; |
4264 | 4259 | |
4265 | 4260 | flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY |
4266 | 4261 | | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); |
4267 | - htab->reliplt = bfd_make_section_anyway_with_flags (dynobj, | |
4268 | - ".rela.iplt", | |
4269 | - flags); | |
4270 | - if (htab->reliplt == NULL | |
4271 | - || ! bfd_set_section_alignment (dynobj, htab->reliplt, 3)) | |
4262 | + htab->elf.irelplt | |
4263 | + = bfd_make_section_anyway_with_flags (dynobj, ".rela.iplt", flags); | |
4264 | + if (htab->elf.irelplt == NULL | |
4265 | + || ! bfd_set_section_alignment (dynobj, htab->elf.irelplt, 3)) | |
4272 | 4266 | return FALSE; |
4273 | 4267 | |
4274 | 4268 | /* Create branch lookup table for plt_branch stubs. */ |
@@ -4481,15 +4475,9 @@ create_got_section (bfd *abfd, struct bfd_link_info *info) | ||
4481 | 4475 | if (htab == NULL) |
4482 | 4476 | return FALSE; |
4483 | 4477 | |
4484 | - if (!htab->got) | |
4485 | - { | |
4486 | - if (! _bfd_elf_create_got_section (htab->elf.dynobj, info)) | |
4487 | - return FALSE; | |
4488 | - | |
4489 | - htab->got = bfd_get_linker_section (htab->elf.dynobj, ".got"); | |
4490 | - if (!htab->got) | |
4491 | - abort (); | |
4492 | - } | |
4478 | + if (!htab->elf.sgot | |
4479 | + && !_bfd_elf_create_got_section (htab->elf.dynobj, info)) | |
4480 | + return FALSE; | |
4493 | 4481 | |
4494 | 4482 | flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY |
4495 | 4483 | | SEC_LINKER_CREATED); |
@@ -4524,15 +4512,11 @@ ppc64_elf_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) | ||
4524 | 4512 | if (htab == NULL) |
4525 | 4513 | return FALSE; |
4526 | 4514 | |
4527 | - if (!htab->got) | |
4528 | - htab->got = bfd_get_linker_section (dynobj, ".got"); | |
4529 | - htab->plt = bfd_get_linker_section (dynobj, ".plt"); | |
4530 | - htab->relplt = bfd_get_linker_section (dynobj, ".rela.plt"); | |
4531 | 4515 | htab->dynbss = bfd_get_linker_section (dynobj, ".dynbss"); |
4532 | 4516 | if (!info->shared) |
4533 | 4517 | htab->relbss = bfd_get_linker_section (dynobj, ".rela.bss"); |
4534 | 4518 | |
4535 | - if (!htab->got || !htab->plt || !htab->relplt || !htab->dynbss | |
4519 | + if (!htab->elf.sgot || !htab->elf.splt || !htab->elf.srelplt || !htab->dynbss | |
4536 | 4520 | || (!info->shared && !htab->relbss)) |
4537 | 4521 | abort (); |
4538 | 4522 |
@@ -9232,7 +9216,7 @@ allocate_got (struct elf_link_hash_entry *h, | ||
9232 | 9216 | dyn = htab->elf.dynamic_sections_created; |
9233 | 9217 | if (h->type == STT_GNU_IFUNC) |
9234 | 9218 | { |
9235 | - htab->reliplt->size += rentsize; | |
9219 | + htab->elf.irelplt->size += rentsize; | |
9236 | 9220 | htab->got_reli_size += rentsize; |
9237 | 9221 | } |
9238 | 9222 | else if ((info->shared |
@@ -9299,16 +9283,16 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) | ||
9299 | 9283 | if (!htab->elf.dynamic_sections_created |
9300 | 9284 | || h->dynindx == -1) |
9301 | 9285 | { |
9302 | - s = htab->iplt; | |
9286 | + s = htab->elf.iplt; | |
9303 | 9287 | pent->plt.offset = s->size; |
9304 | 9288 | s->size += PLT_ENTRY_SIZE (htab); |
9305 | - s = htab->reliplt; | |
9289 | + s = htab->elf.irelplt; | |
9306 | 9290 | } |
9307 | 9291 | else |
9308 | 9292 | { |
9309 | 9293 | /* If this is the first .plt entry, make room for the special |
9310 | 9294 | first entry. */ |
9311 | - s = htab->plt; | |
9295 | + s = htab->elf.splt; | |
9312 | 9296 | if (s->size == 0) |
9313 | 9297 | s->size += PLT_INITIAL_ENTRY_SIZE (htab); |
9314 | 9298 |
@@ -9332,7 +9316,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) | ||
9332 | 9316 | s->size += 4; |
9333 | 9317 | |
9334 | 9318 | /* We also need to make an entry in the .rela.plt section. */ |
9335 | - s = htab->relplt; | |
9319 | + s = htab->elf.srelplt; | |
9336 | 9320 | } |
9337 | 9321 | s->size += sizeof (Elf64_External_Rela); |
9338 | 9322 | doneone = TRUE; |
@@ -9512,7 +9496,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) | ||
9512 | 9496 | { |
9513 | 9497 | asection *sreloc = elf_section_data (p->sec)->sreloc; |
9514 | 9498 | if (eh->elf.type == STT_GNU_IFUNC) |
9515 | - sreloc = htab->reliplt; | |
9499 | + sreloc = htab->elf.irelplt; | |
9516 | 9500 | sreloc->size += p->count * sizeof (Elf64_External_Rela); |
9517 | 9501 | } |
9518 | 9502 |
@@ -9643,7 +9627,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd, | ||
9643 | 9627 | { |
9644 | 9628 | asection *srel = elf_section_data (p->sec)->sreloc; |
9645 | 9629 | if (p->ifunc) |
9646 | - srel = htab->reliplt; | |
9630 | + srel = htab->elf.irelplt; | |
9647 | 9631 | srel->size += p->count * sizeof (Elf64_External_Rela); |
9648 | 9632 | if ((p->sec->output_section->flags & SEC_READONLY) != 0) |
9649 | 9633 | info->flags |= DF_TEXTREL; |
@@ -9689,7 +9673,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd, | ||
9689 | 9673 | s->size += ent_size; |
9690 | 9674 | if ((*lgot_masks & PLT_IFUNC) != 0) |
9691 | 9675 | { |
9692 | - htab->reliplt->size += rel_size; | |
9676 | + htab->elf.irelplt->size += rel_size; | |
9693 | 9677 | htab->got_reli_size += rel_size; |
9694 | 9678 | } |
9695 | 9679 | else if (info->shared) |
@@ -9712,11 +9696,11 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd, | ||
9712 | 9696 | for (ent = *local_plt; ent != NULL; ent = ent->next) |
9713 | 9697 | if (ent->plt.refcount > 0) |
9714 | 9698 | { |
9715 | - s = htab->iplt; | |
9699 | + s = htab->elf.iplt; | |
9716 | 9700 | ent->plt.offset = s->size; |
9717 | 9701 | s->size += PLT_ENTRY_SIZE (htab); |
9718 | 9702 | |
9719 | - htab->reliplt->size += sizeof (Elf64_External_Rela); | |
9703 | + htab->elf.irelplt->size += sizeof (Elf64_External_Rela); | |
9720 | 9704 | } |
9721 | 9705 | else |
9722 | 9706 | ent->plt.offset = (bfd_vma) -1; |
@@ -9779,9 +9763,9 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd, | ||
9779 | 9763 | if (s == htab->brlt || s == htab->relbrlt) |
9780 | 9764 | /* These haven't been allocated yet; don't strip. */ |
9781 | 9765 | continue; |
9782 | - else if (s == htab->got | |
9783 | - || s == htab->plt | |
9784 | - || s == htab->iplt | |
9766 | + else if (s == htab->elf.sgot | |
9767 | + || s == htab->elf.splt | |
9768 | + || s == htab->elf.iplt | |
9785 | 9769 | || s == htab->glink |
9786 | 9770 | || s == htab->dynbss) |
9787 | 9771 | { |
@@ -9798,7 +9782,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd, | ||
9798 | 9782 | { |
9799 | 9783 | if (s->size != 0) |
9800 | 9784 | { |
9801 | - if (s != htab->relplt) | |
9785 | + if (s != htab->elf.srelplt) | |
9802 | 9786 | relocs = TRUE; |
9803 | 9787 | |
9804 | 9788 | /* We use the reloc_count field as a counter if we need |
@@ -9848,7 +9832,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd, | ||
9848 | 9832 | continue; |
9849 | 9833 | |
9850 | 9834 | s = ppc64_elf_tdata (ibfd)->got; |
9851 | - if (s != NULL && s != htab->got) | |
9835 | + if (s != NULL && s != htab->elf.sgot) | |
9852 | 9836 | { |
9853 | 9837 | if (s->size == 0) |
9854 | 9838 | s->flags |= SEC_EXCLUDE; |
@@ -9893,7 +9877,7 @@ ppc64_elf_size_dynamic_sections (bfd *output_bfd, | ||
9893 | 9877 | return FALSE; |
9894 | 9878 | } |
9895 | 9879 | |
9896 | - if (htab->plt != NULL && htab->plt->size != 0) | |
9880 | + if (htab->elf.splt != NULL && htab->elf.splt->size != 0) | |
9897 | 9881 | { |
9898 | 9882 | if (!add_dynamic_entry (DT_PLTGOT, 0) |
9899 | 9883 | || !add_dynamic_entry (DT_PLTRELSZ, 0) |
@@ -10695,11 +10679,11 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
10695 | 10679 | if (dest >= (bfd_vma) -2) |
10696 | 10680 | abort (); |
10697 | 10681 | |
10698 | - plt = htab->plt; | |
10682 | + plt = htab->elf.splt; | |
10699 | 10683 | if (!htab->elf.dynamic_sections_created |
10700 | 10684 | || stub_entry->h == NULL |
10701 | 10685 | || stub_entry->h->elf.dynindx == -1) |
10702 | - plt = htab->iplt; | |
10686 | + plt = htab->elf.iplt; | |
10703 | 10687 | |
10704 | 10688 | dest += plt->output_offset + plt->output_section->vma; |
10705 | 10689 |
@@ -10718,8 +10702,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
10718 | 10702 | + stub_entry->target_section->output_offset |
10719 | 10703 | + stub_entry->target_section->output_section->vma); |
10720 | 10704 | |
10721 | - rl = (htab->reliplt->contents | |
10722 | - + (htab->reliplt->reloc_count++ | |
10705 | + rl = (htab->elf.irelplt->contents | |
10706 | + + (htab->elf.irelplt->reloc_count++ | |
10723 | 10707 | * sizeof (Elf64_External_Rela))); |
10724 | 10708 | bfd_elf64_swap_reloca_out (info->output_bfd, &rela, rl); |
10725 | 10709 | stub_entry->plt_ent->plt.offset |= 1; |
@@ -10849,11 +10833,11 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) | ||
10849 | 10833 | off = stub_entry->plt_ent->plt.offset & ~(bfd_vma) 1; |
10850 | 10834 | if (off >= (bfd_vma) -2) |
10851 | 10835 | abort (); |
10852 | - plt = htab->plt; | |
10836 | + plt = htab->elf.splt; | |
10853 | 10837 | if (!htab->elf.dynamic_sections_created |
10854 | 10838 | || stub_entry->h == NULL |
10855 | 10839 | || stub_entry->h->elf.dynindx == -1) |
10856 | - plt = htab->iplt; | |
10840 | + plt = htab->elf.iplt; | |
10857 | 10841 | off += (plt->output_offset |
10858 | 10842 | + plt->output_section->vma |
10859 | 10843 | - elf_gp (plt->output_section->owner) |
@@ -11220,8 +11204,8 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info) | ||
11220 | 11204 | } |
11221 | 11205 | |
11222 | 11206 | /* Zap sizes of got sections. */ |
11223 | - htab->reliplt->rawsize = htab->reliplt->size; | |
11224 | - htab->reliplt->size -= htab->got_reli_size; | |
11207 | + htab->elf.irelplt->rawsize = htab->elf.irelplt->size; | |
11208 | + htab->elf.irelplt->size -= htab->got_reli_size; | |
11225 | 11209 | htab->got_reli_size = 0; |
11226 | 11210 | |
11227 | 11211 | for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) |
@@ -11287,7 +11271,7 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info) | ||
11287 | 11271 | s->size += ent_size; |
11288 | 11272 | if ((*lgot_masks & PLT_IFUNC) != 0) |
11289 | 11273 | { |
11290 | - htab->reliplt->size += rel_size; | |
11274 | + htab->elf.irelplt->size += rel_size; | |
11291 | 11275 | htab->got_reli_size += rel_size; |
11292 | 11276 | } |
11293 | 11277 | else if (info->shared) |
@@ -11323,7 +11307,7 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info) | ||
11323 | 11307 | } |
11324 | 11308 | } |
11325 | 11309 | |
11326 | - done_something = htab->reliplt->rawsize != htab->reliplt->size; | |
11310 | + done_something = htab->elf.irelplt->rawsize != htab->elf.irelplt->size; | |
11327 | 11311 | if (!done_something) |
11328 | 11312 | for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) |
11329 | 11313 | { |
@@ -12396,10 +12380,10 @@ build_global_entry_stubs (struct elf_link_hash_entry *h, void *inf) | ||
12396 | 12380 | h->root.u.def.value = s->size; |
12397 | 12381 | s->size += 16; |
12398 | 12382 | p = s->contents + h->root.u.def.value; |
12399 | - plt = htab->plt; | |
12383 | + plt = htab->elf.splt; | |
12400 | 12384 | if (!htab->elf.dynamic_sections_created |
12401 | 12385 | || h->dynindx == -1) |
12402 | - plt = htab->iplt; | |
12386 | + plt = htab->elf.iplt; | |
12403 | 12387 | off = pent->plt.offset + plt->output_offset + plt->output_section->vma; |
12404 | 12388 | off -= h->root.u.def.value + s->output_offset + s->output_section->vma; |
12405 | 12389 |
@@ -12487,7 +12471,9 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, | ||
12487 | 12471 | h->non_elf = 0; |
12488 | 12472 | } |
12489 | 12473 | } |
12490 | - plt0 = htab->plt->output_section->vma + htab->plt->output_offset - 16; | |
12474 | + plt0 = (htab->elf.splt->output_section->vma | |
12475 | + + htab->elf.splt->output_offset | |
12476 | + - 16); | |
12491 | 12477 | if (info->emitrelocations) |
12492 | 12478 | { |
12493 | 12479 | Elf_Internal_Rela *r = get_relocs (htab->glink, 1); |
@@ -13916,7 +13902,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, | ||
13916 | 13902 | ? h->elf.type == STT_GNU_IFUNC |
13917 | 13903 | : ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC); |
13918 | 13904 | if (ifunc) |
13919 | - relgot = htab->reliplt; | |
13905 | + relgot = htab->elf.irelplt; | |
13920 | 13906 | else if ((info->shared || indx != 0) |
13921 | 13907 | && (h == NULL |
13922 | 13908 | || (tls_type == (TLS_TLS | TLS_LD) |
@@ -14030,15 +14016,15 @@ ppc64_elf_relocate_section (bfd *output_bfd, | ||
14030 | 14016 | symbol. This happens when statically linking PIC code, |
14031 | 14017 | or when using -Bsymbolic. Go find a match if there is a |
14032 | 14018 | PLT entry. */ |
14033 | - if (htab->plt != NULL) | |
14019 | + if (htab->elf.splt != NULL) | |
14034 | 14020 | { |
14035 | 14021 | struct plt_entry *ent; |
14036 | 14022 | for (ent = h->elf.plt.plist; ent != NULL; ent = ent->next) |
14037 | 14023 | if (ent->plt.offset != (bfd_vma) -1 |
14038 | 14024 | && ent->addend == orig_rel.r_addend) |
14039 | 14025 | { |
14040 | - relocation = (htab->plt->output_section->vma | |
14041 | - + htab->plt->output_offset | |
14026 | + relocation = (htab->elf.splt->output_section->vma | |
14027 | + + htab->elf.splt->output_offset | |
14042 | 14028 | + ent->plt.offset); |
14043 | 14029 | unresolved_reloc = FALSE; |
14044 | 14030 | break; |
@@ -14347,7 +14333,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, | ||
14347 | 14333 | if (h != NULL |
14348 | 14334 | ? h->elf.type == STT_GNU_IFUNC |
14349 | 14335 | : ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC) |
14350 | - sreloc = htab->reliplt; | |
14336 | + sreloc = htab->elf.irelplt; | |
14351 | 14337 | if (sreloc == NULL) |
14352 | 14338 | abort (); |
14353 | 14339 |
@@ -14724,8 +14710,8 @@ ppc64_elf_finish_dynamic_symbol (bfd *output_bfd, | ||
14724 | 14710 | && h->def_regular |
14725 | 14711 | && (h->root.type == bfd_link_hash_defined |
14726 | 14712 | || h->root.type == bfd_link_hash_defweak)); |
14727 | - rela.r_offset = (htab->iplt->output_section->vma | |
14728 | - + htab->iplt->output_offset | |
14713 | + rela.r_offset = (htab->elf.iplt->output_section->vma | |
14714 | + + htab->elf.iplt->output_offset | |
14729 | 14715 | + ent->plt.offset); |
14730 | 14716 | if (htab->opd_abi) |
14731 | 14717 | rela.r_info = ELF64_R_INFO (0, R_PPC64_JMP_IREL); |
@@ -14735,18 +14721,18 @@ ppc64_elf_finish_dynamic_symbol (bfd *output_bfd, | ||
14735 | 14721 | + h->root.u.def.section->output_offset |
14736 | 14722 | + h->root.u.def.section->output_section->vma |
14737 | 14723 | + ent->addend); |
14738 | - loc = (htab->reliplt->contents | |
14739 | - + (htab->reliplt->reloc_count++ | |
14724 | + loc = (htab->elf.irelplt->contents | |
14725 | + + (htab->elf.irelplt->reloc_count++ | |
14740 | 14726 | * sizeof (Elf64_External_Rela))); |
14741 | 14727 | } |
14742 | 14728 | else |
14743 | 14729 | { |
14744 | - rela.r_offset = (htab->plt->output_section->vma | |
14745 | - + htab->plt->output_offset | |
14730 | + rela.r_offset = (htab->elf.splt->output_section->vma | |
14731 | + + htab->elf.splt->output_offset | |
14746 | 14732 | + ent->plt.offset); |
14747 | 14733 | rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_JMP_SLOT); |
14748 | 14734 | rela.r_addend = ent->addend; |
14749 | - loc = (htab->relplt->contents | |
14735 | + loc = (htab->elf.srelplt->contents | |
14750 | 14736 | + ((ent->plt.offset - PLT_INITIAL_ENTRY_SIZE (htab)) |
14751 | 14737 | / PLT_ENTRY_SIZE (htab) * sizeof (Elf64_External_Rela))); |
14752 | 14738 | } |
@@ -14811,7 +14797,7 @@ ppc64_elf_reloc_type_class (const struct bfd_link_info *info, | ||
14811 | 14797 | enum elf_ppc64_reloc_type r_type; |
14812 | 14798 | struct ppc_link_hash_table *htab = ppc_hash_table (info); |
14813 | 14799 | |
14814 | - if (rel_sec == htab->reliplt) | |
14800 | + if (rel_sec == htab->elf.irelplt) | |
14815 | 14801 | return reloc_class_ifunc; |
14816 | 14802 | |
14817 | 14803 | r_type = ELF64_R_TYPE (rela->r_info); |
@@ -14849,7 +14835,7 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd, | ||
14849 | 14835 | { |
14850 | 14836 | Elf64_External_Dyn *dyncon, *dynconend; |
14851 | 14837 | |
14852 | - if (sdyn == NULL || htab->got == NULL) | |
14838 | + if (sdyn == NULL || htab->elf.sgot == NULL) | |
14853 | 14839 | abort (); |
14854 | 14840 | |
14855 | 14841 | dyncon = (Elf64_External_Dyn *) sdyn->contents; |
@@ -14896,23 +14882,23 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd, | ||
14896 | 14882 | break; |
14897 | 14883 | |
14898 | 14884 | case DT_PLTGOT: |
14899 | - s = htab->plt; | |
14885 | + s = htab->elf.splt; | |
14900 | 14886 | dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; |
14901 | 14887 | break; |
14902 | 14888 | |
14903 | 14889 | case DT_JMPREL: |
14904 | - s = htab->relplt; | |
14890 | + s = htab->elf.srelplt; | |
14905 | 14891 | dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; |
14906 | 14892 | break; |
14907 | 14893 | |
14908 | 14894 | case DT_PLTRELSZ: |
14909 | - dyn.d_un.d_val = htab->relplt->size; | |
14895 | + dyn.d_un.d_val = htab->elf.srelplt->size; | |
14910 | 14896 | break; |
14911 | 14897 | |
14912 | 14898 | case DT_RELASZ: |
14913 | 14899 | /* Don't count procedure linkage table relocs in the |
14914 | 14900 | overall reloc count. */ |
14915 | - s = htab->relplt; | |
14901 | + s = htab->elf.srelplt; | |
14916 | 14902 | if (s == NULL) |
14917 | 14903 | continue; |
14918 | 14904 | dyn.d_un.d_val -= s->size; |
@@ -14922,7 +14908,7 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd, | ||
14922 | 14908 | /* We may not be using the standard ELF linker script. |
14923 | 14909 | If .rela.plt is the first .rela section, we adjust |
14924 | 14910 | DT_RELA to not include it. */ |
14925 | - s = htab->relplt; | |
14911 | + s = htab->elf.srelplt; | |
14926 | 14912 | if (s == NULL) |
14927 | 14913 | continue; |
14928 | 14914 | if (dyn.d_un.d_ptr != s->output_section->vma + s->output_offset) |
@@ -14935,22 +14921,22 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd, | ||
14935 | 14921 | } |
14936 | 14922 | } |
14937 | 14923 | |
14938 | - if (htab->got != NULL && htab->got->size != 0) | |
14924 | + if (htab->elf.sgot != NULL && htab->elf.sgot->size != 0) | |
14939 | 14925 | { |
14940 | 14926 | /* Fill in the first entry in the global offset table. |
14941 | 14927 | We use it to hold the link-time TOCbase. */ |
14942 | 14928 | bfd_put_64 (output_bfd, |
14943 | 14929 | elf_gp (output_bfd) + TOC_BASE_OFF, |
14944 | - htab->got->contents); | |
14930 | + htab->elf.sgot->contents); | |
14945 | 14931 | |
14946 | 14932 | /* Set .got entry size. */ |
14947 | - elf_section_data (htab->got->output_section)->this_hdr.sh_entsize = 8; | |
14933 | + elf_section_data (htab->elf.sgot->output_section)->this_hdr.sh_entsize = 8; | |
14948 | 14934 | } |
14949 | 14935 | |
14950 | - if (htab->plt != NULL && htab->plt->size != 0) | |
14936 | + if (htab->elf.splt != NULL && htab->elf.splt->size != 0) | |
14951 | 14937 | { |
14952 | 14938 | /* Set .plt entry size. */ |
14953 | - elf_section_data (htab->plt->output_section)->this_hdr.sh_entsize | |
14939 | + elf_section_data (htab->elf.splt->output_section)->this_hdr.sh_entsize | |
14954 | 14940 | = PLT_ENTRY_SIZE (htab); |
14955 | 14941 | } |
14956 | 14942 |