diff options
author | Alan Modra <amodra@gmail.com> | 2012-07-02 03:02:45 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2012-07-02 03:02:45 +0000 |
commit | 87e0a731c84e58c8a6f63b38baacbc066a70ab28 (patch) | |
tree | 601dc896674bc249c25876951867e089cfdae094 /bfd/elf32-m32c.c | |
parent | 5b0a443ab9312a117539570b3e55b2c8c468e5a7 (diff) | |
download | gdb-87e0a731c84e58c8a6f63b38baacbc066a70ab28.zip gdb-87e0a731c84e58c8a6f63b38baacbc066a70ab28.tar.gz gdb-87e0a731c84e58c8a6f63b38baacbc066a70ab28.tar.bz2 |
* elf32-m32c.c (m32c_elf_check_relocs): Use bfd_make_section
"anyway" variant when creating .plt.
(m32c_elf_relax_plt_section): Remove redundant test and unused param.
(m32c_elf_relax_section): Test SEC_LINKER_CREATED before calling
m32c_elf_relax_plt_section.
* elfxx-mips.c (mips_elf_create_got_section): Use make anyway variant
when creating .got and .got.plt.
(_bfd_mips_elf_final_link): Likewise for .rtproc, and use
bfd_get_linker_section.
* sunos.c: Similarly throughout.
Diffstat (limited to 'bfd/elf32-m32c.c')
-rw-r--r-- | bfd/elf32-m32c.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c index 6c4352d..667a482 100644 --- a/bfd/elf32-m32c.c +++ b/bfd/elf32-m32c.c @@ -639,7 +639,8 @@ m32c_elf_check_relocs flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED | SEC_READONLY | SEC_CODE); - splt = bfd_make_section_with_flags (dynobj, ".plt", flags); + splt = bfd_make_section_anyway_with_flags (dynobj, ".plt", + flags); if (splt == NULL || ! bfd_set_section_alignment (dynobj, splt, 1)) return FALSE; @@ -1031,8 +1032,7 @@ m32c_relax_plt_realloc (struct elf_link_hash_entry *h, } static bfd_boolean -m32c_elf_relax_plt_section (bfd *dynobj, - asection *splt, +m32c_elf_relax_plt_section (asection *splt, struct bfd_link_info *info, bfd_boolean *again) { @@ -1045,11 +1045,6 @@ m32c_elf_relax_plt_section (bfd *dynobj, if (info->relocatable) return TRUE; - /* We only relax the .plt section at the moment. */ - if (dynobj != elf_hash_table (info)->dynobj - || strcmp (splt->name, ".plt") != 0) - return TRUE; - /* Quick check for an empty plt. */ if (splt->size == 0) return TRUE; @@ -1337,8 +1332,9 @@ m32c_elf_relax_section int machine; if (abfd == elf_hash_table (link_info)->dynobj + && (sec->flags & SEC_LINKER_CREATED) != 0 && strcmp (sec->name, ".plt") == 0) - return m32c_elf_relax_plt_section (abfd, sec, link_info, again); + return m32c_elf_relax_plt_section (sec, link_info, again); /* Assume nothing changes. */ *again = FALSE; |