summaryrefslogtreecommitdiff
path: root/bfd/elf32-m32c.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2012-07-02 03:02:44 +0000
committerAlan Modra <amodra@bigpond.net.au>2012-07-02 03:02:44 +0000
commit246a220dd6b64b33c3933b2d8240499877e11c62 (patch)
tree26bb394ceacf9ac66491f9aaf6f4907dcf142bff /bfd/elf32-m32c.c
parent7519039b2cffaef83d5ac8ba06457cca2f9377ae (diff)
downloadbinutils-redhat-246a220dd6b64b33c3933b2d8240499877e11c62.tar.gz
* 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.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c
index 6c4352d7e1..667a4828d2 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;