diff options
Diffstat (limited to 'bfd/elf32-m68k.c')
-rw-r--r-- | bfd/elf32-m68k.c | 65 |
1 files changed, 31 insertions, 34 deletions
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index 1cb03ae..9df60ac 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -2468,7 +2468,7 @@ elf_m68k_partition_multi_got (struct bfd_link_info *info) { asection *s; - s = bfd_get_section_by_name (elf_hash_table (info)->dynobj, ".got"); + s = bfd_get_linker_section (elf_hash_table (info)->dynobj, ".got"); if (s != NULL) s->size = arg_.offset; else @@ -2477,7 +2477,7 @@ elf_m68k_partition_multi_got (struct bfd_link_info *info) BFD_ASSERT (arg_.slots_relas_diff <= arg_.n_slots); arg_.n_slots -= arg_.slots_relas_diff; - s = bfd_get_section_by_name (elf_hash_table (info)->dynobj, ".rela.got"); + s = bfd_get_linker_section (elf_hash_table (info)->dynobj, ".rela.got"); if (s != NULL) s->size = arg_.n_slots * sizeof (Elf32_External_Rela); else @@ -2675,24 +2675,22 @@ elf_m68k_check_relocs (abfd, info, sec, relocs) if (sgot == NULL) { - sgot = bfd_get_section_by_name (dynobj, ".got"); + sgot = bfd_get_linker_section (dynobj, ".got"); BFD_ASSERT (sgot != NULL); } if (srelgot == NULL && (h != NULL || info->shared)) { - srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); + srelgot = bfd_get_linker_section (dynobj, ".rela.got"); if (srelgot == NULL) { - srelgot = bfd_make_section_with_flags (dynobj, - ".rela.got", - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)); + flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED + | SEC_READONLY); + srelgot = bfd_make_section_anyway_with_flags (dynobj, + ".rela.got", + flags); if (srelgot == NULL || !bfd_set_section_alignment (dynobj, srelgot, 2)) return FALSE; @@ -3182,7 +3180,7 @@ elf_m68k_adjust_dynamic_symbol (info, h) return FALSE; } - s = bfd_get_section_by_name (dynobj, ".plt"); + s = bfd_get_linker_section (dynobj, ".plt"); BFD_ASSERT (s != NULL); /* If this is the first .plt entry, make room for the special @@ -3209,12 +3207,12 @@ elf_m68k_adjust_dynamic_symbol (info, h) /* We also need to make an entry in the .got.plt section, which will be placed in the .got section by the linker script. */ - s = bfd_get_section_by_name (dynobj, ".got.plt"); + s = bfd_get_linker_section (dynobj, ".got.plt"); BFD_ASSERT (s != NULL); s->size += 4; /* We also need to make an entry in the .rela.plt section. */ - s = bfd_get_section_by_name (dynobj, ".rela.plt"); + s = bfd_get_linker_section (dynobj, ".rela.plt"); BFD_ASSERT (s != NULL); s->size += sizeof (Elf32_External_Rela); @@ -3262,7 +3260,7 @@ elf_m68k_adjust_dynamic_symbol (info, h) both the dynamic object and the regular object will refer to the same memory location for the variable. */ - s = bfd_get_section_by_name (dynobj, ".dynbss"); + s = bfd_get_linker_section (dynobj, ".dynbss"); BFD_ASSERT (s != NULL); /* We must generate a R_68K_COPY reloc to tell the dynamic linker to @@ -3273,7 +3271,7 @@ elf_m68k_adjust_dynamic_symbol (info, h) { asection *srel; - srel = bfd_get_section_by_name (dynobj, ".rela.bss"); + srel = bfd_get_linker_section (dynobj, ".rela.bss"); BFD_ASSERT (srel != NULL); srel->size += sizeof (Elf32_External_Rela); h->needs_copy = 1; @@ -3302,7 +3300,7 @@ elf_m68k_size_dynamic_sections (output_bfd, info) /* Set the contents of the .interp section to the interpreter. */ if (info->executable) { - s = bfd_get_section_by_name (dynobj, ".interp"); + s = bfd_get_linker_section (dynobj, ".interp"); BFD_ASSERT (s != NULL); s->size = sizeof ELF_DYNAMIC_INTERPRETER; s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; @@ -3315,7 +3313,7 @@ elf_m68k_size_dynamic_sections (output_bfd, info) not actually use these entries. Reset the size of .rela.got, which will cause it to get stripped from the output file below. */ - s = bfd_get_section_by_name (dynobj, ".rela.got"); + s = bfd_get_linker_section (dynobj, ".rela.got"); if (s != NULL) s->size = 0; } @@ -3746,7 +3744,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, if (sgot == NULL) { - sgot = bfd_get_section_by_name (dynobj, ".got"); + sgot = bfd_get_linker_section (dynobj, ".got"); if (sgot != NULL) sgot_output_offset = sgot->output_offset; @@ -3821,7 +3819,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, if (sgot == NULL) { - sgot = bfd_get_section_by_name (dynobj, ".got"); + sgot = bfd_get_linker_section (dynobj, ".got"); BFD_ASSERT (sgot != NULL); } @@ -3892,7 +3890,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, { if (srela == NULL) { - srela = bfd_get_section_by_name (dynobj, ".rela.got"); + srela = bfd_get_linker_section (dynobj, ".rela.got"); BFD_ASSERT (srela != NULL); } @@ -3996,7 +3994,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, if (splt == NULL) { - splt = bfd_get_section_by_name (dynobj, ".plt"); + splt = bfd_get_linker_section (dynobj, ".plt"); BFD_ASSERT (splt != NULL); } @@ -4015,7 +4013,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, if (splt == NULL) { - splt = bfd_get_section_by_name (dynobj, ".plt"); + splt = bfd_get_linker_section (dynobj, ".plt"); BFD_ASSERT (splt != NULL); } @@ -4296,9 +4294,9 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym) BFD_ASSERT (h->dynindx != -1); plt_info = elf_m68k_hash_table (info)->plt_info; - splt = bfd_get_section_by_name (dynobj, ".plt"); - sgot = bfd_get_section_by_name (dynobj, ".got.plt"); - srela = bfd_get_section_by_name (dynobj, ".rela.plt"); + splt = bfd_get_linker_section (dynobj, ".plt"); + sgot = bfd_get_linker_section (dynobj, ".got.plt"); + srela = bfd_get_linker_section (dynobj, ".rela.plt"); BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL); /* Get the index in the procedure linkage table which @@ -4363,8 +4361,8 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym) /* This symbol has an entry in the global offset table. Set it up. */ - sgot = bfd_get_section_by_name (dynobj, ".got"); - srela = bfd_get_section_by_name (dynobj, ".rela.got"); + sgot = bfd_get_linker_section (dynobj, ".got"); + srela = bfd_get_linker_section (dynobj, ".rela.got"); BFD_ASSERT (sgot != NULL && srela != NULL); got_entry = elf_m68k_hash_entry (h)->glist; @@ -4487,8 +4485,7 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym) && (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak)); - s = bfd_get_section_by_name (h->root.u.def.section->owner, - ".rela.bss"); + s = bfd_get_linker_section (dynobj, ".rela.bss"); BFD_ASSERT (s != NULL); rela.r_offset = (h->root.u.def.value @@ -4516,16 +4513,16 @@ elf_m68k_finish_dynamic_sections (output_bfd, info) dynobj = elf_hash_table (info)->dynobj; - sgot = bfd_get_section_by_name (dynobj, ".got.plt"); + sgot = bfd_get_linker_section (dynobj, ".got.plt"); BFD_ASSERT (sgot != NULL); - sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + sdyn = bfd_get_linker_section (dynobj, ".dynamic"); if (elf_hash_table (info)->dynamic_sections_created) { asection *splt; Elf32_External_Dyn *dyncon, *dynconend; - splt = bfd_get_section_by_name (dynobj, ".plt"); + splt = bfd_get_linker_section (dynobj, ".plt"); BFD_ASSERT (splt != NULL && sdyn != NULL); dyncon = (Elf32_External_Dyn *) sdyn->contents; |