diff options
Diffstat (limited to 'bfd/elf32-m32r.c')
-rw-r--r-- | bfd/elf32-m32r.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index 275daeb..e3e3bb0 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -1625,9 +1625,9 @@ create_got_section (bfd *dynobj, struct bfd_link_info *info) if (htab == NULL) return FALSE; - htab->sgot = bfd_get_section_by_name (dynobj, ".got"); - htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); - htab->srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); + htab->sgot = bfd_get_linker_section (dynobj, ".got"); + htab->sgotplt = bfd_get_linker_section (dynobj, ".got.plt"); + htab->srelgot = bfd_get_linker_section (dynobj, ".rela.got"); if (! htab->sgot || ! htab->sgotplt || ! htab->srelgot) abort (); @@ -1661,7 +1661,7 @@ m32r_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) if (bed->plt_readonly) pltflags |= SEC_READONLY; - s = bfd_make_section_with_flags (abfd, ".plt", pltflags); + s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags); htab->splt = s; if (s == NULL || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment)) @@ -1689,9 +1689,10 @@ m32r_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) return FALSE; } - s = bfd_make_section_with_flags (abfd, - bed->default_use_rela_p ? ".rela.plt" : ".rel.plt", - flags | SEC_READONLY); + s = bfd_make_section_anyway_with_flags (abfd, + bed->default_use_rela_p + ? ".rela.plt" : ".rel.plt", + flags | SEC_READONLY); htab->srelplt = s; if (s == NULL || ! bfd_set_section_alignment (abfd, s, ptralign)) @@ -1709,8 +1710,8 @@ m32r_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) image and use a R_*_COPY reloc to tell the dynamic linker to initialize them at run time. The linker script puts the .dynbss section into the .bss section of the final image. */ - s = bfd_make_section_with_flags (abfd, ".dynbss", - SEC_ALLOC | SEC_LINKER_CREATED); + s = bfd_make_section_anyway_with_flags (abfd, ".dynbss", + SEC_ALLOC | SEC_LINKER_CREATED); htab->sdynbss = s; if (s == NULL) return FALSE; @@ -1727,10 +1728,10 @@ m32r_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) copy relocs. */ if (! info->shared) { - s = bfd_make_section_with_flags (abfd, - (bed->default_use_rela_p - ? ".rela.bss" : ".rel.bss"), - flags | SEC_READONLY); + s = bfd_make_section_anyway_with_flags (abfd, + (bed->default_use_rela_p + ? ".rela.bss" : ".rel.bss"), + flags | SEC_READONLY); htab->srelbss = s; if (s == NULL || ! bfd_set_section_alignment (abfd, s, ptralign)) @@ -2176,7 +2177,7 @@ m32r_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* 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; @@ -2788,7 +2789,8 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, /* We need to generate a R_M32R_RELATIVE reloc for the dynamic linker. */ - srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); + srelgot = bfd_get_linker_section (dynobj, + ".rela.got"); BFD_ASSERT (srelgot != NULL); outrel.r_offset = (sgot->output_section->vma @@ -3278,8 +3280,7 @@ m32r_elf_finish_dynamic_symbol (bfd *output_bfd, && (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 (htab->root.dynobj, ".rela.bss"); BFD_ASSERT (s != NULL); rela.r_offset = (h->root.u.def.value @@ -3324,7 +3325,7 @@ m32r_elf_finish_dynamic_sections (bfd *output_bfd, dynobj = htab->root.dynobj; sgot = htab->sgotplt; - sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + sdyn = bfd_get_linker_section (dynobj, ".dynamic"); if (htab->root.dynamic_sections_created) { |