aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-sh.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-sh.c')
-rw-r--r--bfd/elf32-sh.c47
1 files changed, 22 insertions, 25 deletions
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index a811fe3..9b57f35 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -3649,15 +3649,13 @@ create_got_section (bfd *dynobj, struct bfd_link_info *info)
if (! htab->sgot || ! htab->sgotplt)
abort ();
- htab->srelgot = bfd_make_section (dynobj, ".rela.got");
+ htab->srelgot = bfd_make_section_with_flags (dynobj, ".rela.got",
+ (SEC_ALLOC | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED
+ | SEC_READONLY));
if (htab->srelgot == NULL
- || ! bfd_set_section_flags (dynobj, htab->srelgot,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED
- | SEC_READONLY))
|| ! bfd_set_section_alignment (dynobj, htab->srelgot, 2))
return FALSE;
return TRUE;
@@ -3706,10 +3704,9 @@ sh_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
if (bed->plt_readonly)
pltflags |= SEC_READONLY;
- s = bfd_make_section (abfd, ".plt");
+ s = bfd_make_section_with_flags (abfd, ".plt", pltflags);
htab->splt = s;
if (s == NULL
- || ! bfd_set_section_flags (abfd, s, pltflags)
|| ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
return FALSE;
@@ -3735,11 +3732,11 @@ sh_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
return FALSE;
}
- s = bfd_make_section (abfd,
- bed->default_use_rela_p ? ".rela.plt" : ".rel.plt");
+ s = bfd_make_section_with_flags (abfd,
+ bed->default_use_rela_p ? ".rela.plt" : ".rel.plt",
+ flags | SEC_READONLY);
htab->srelplt = s;
if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
|| ! bfd_set_section_alignment (abfd, s, ptralign))
return FALSE;
@@ -3765,9 +3762,9 @@ sh_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
strcat (relname, secname);
if (bfd_get_section_by_name (abfd, secname))
continue;
- s = bfd_make_section (abfd, relname);
+ s = bfd_make_section_with_flags (abfd, relname,
+ flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
|| ! bfd_set_section_alignment (abfd, s, ptralign))
return FALSE;
}
@@ -3781,10 +3778,10 @@ sh_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 (abfd, ".dynbss");
+ s = bfd_make_section_with_flags (abfd, ".dynbss",
+ SEC_ALLOC | SEC_LINKER_CREATED);
htab->sdynbss = s;
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, SEC_ALLOC))
+ if (s == NULL)
return FALSE;
/* The .rel[a].bss section holds copy relocs. This section is not
@@ -3800,12 +3797,12 @@ sh_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
copy relocs. */
if (! info->shared)
{
- s = bfd_make_section (abfd,
- (bed->default_use_rela_p
- ? ".rela.bss" : ".rel.bss"));
+ s = bfd_make_section_with_flags (abfd,
+ (bed->default_use_rela_p
+ ? ".rela.bss" : ".rel.bss"),
+ flags | SEC_READONLY);
htab->srelbss = s;
if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
|| ! bfd_set_section_alignment (abfd, s, ptralign))
return FALSE;
}
@@ -6531,14 +6528,14 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
{
flagword flags;
- sreloc = bfd_make_section (htab->root.dynobj, name);
flags = (SEC_HAS_CONTENTS | SEC_READONLY
| SEC_IN_MEMORY | SEC_LINKER_CREATED);
if ((sec->flags & SEC_ALLOC) != 0)
flags |= SEC_ALLOC | SEC_LOAD;
+ sreloc = bfd_make_section_with_flags (htab->root.dynobj,
+ name,
+ flags);
if (sreloc == NULL
- || ! bfd_set_section_flags (htab->root.dynobj,
- sreloc, flags)
|| ! bfd_set_section_alignment (htab->root.dynobj,
sreloc, 2))
return FALSE;