summaryrefslogtreecommitdiff
path: root/bfd/elf32-bfin.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2006-06-01 03:45:58 +0000
committerAlan Modra <amodra@bigpond.net.au>2006-06-01 03:45:58 +0000
commit861f275c6fc3922882e5c83786b425fe1ba55b8f (patch)
tree3cf1b799d4971ac7c5fded783e678dfde75b460c /bfd/elf32-bfin.c
parentaf823f27e067bcdd7e352702122f2e8f0999b56b (diff)
downloadgdb-861f275c6fc3922882e5c83786b425fe1ba55b8f.tar.gz
* stabs.c (_bfd_link_section_stabs): Use bfd_make_section*_with_flags
instead of bfd_make_section*. * aix386-core.c: Likewise. * aix5ppc-core.c: Likewise. * aout-adobe.c: Likewise. * aoutf1.h: Likewise. * binary.c: Likewise. * cisco-core.c: Likewise. * coff-arm.c: Likewise. * coff-h8300.c: Likewise. * elf.c: Likewise. * elf32-bfin.c: Likewise. * elf32-m32c.c: Likewise. * hppabsd-core.c: Likewise. * hpux-core.c: Likewise. * i386linux.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * irix-core.c: Likewise. * lynx-core.c: Likewise. * m68klinux.c: Likewise. * mach-o.c: Likewise. * netbsd-core.c: Likewise. * nlmcode.h: Likewise. * opncls.c: Likewise. * osf-core.c: Likewise. * peXXigen.c: Likewise. * ppcboot.c: Likewise. * ptrace-core.c: Likewise. * rs6000-core.c: Likewise. * sco5-core.c: Likewise. * sparclinux.c: Likewise. * srec.c: Likewise. * sunos.c: Likewise. * trad-core.c: Likewise. * xcofflink.c: Likewise. * xsym.c: Likewise.
Diffstat (limited to 'bfd/elf32-bfin.c')
-rw-r--r--bfd/elf32-bfin.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index ba6bc625289..661d4bdd24e 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -1984,15 +1984,12 @@ bfin_check_relocs (bfd * abfd,
srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
if (srelgot == NULL)
{
- srelgot = bfd_make_section (dynobj, ".rela.got");
+ flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY | SEC_LINKER_CREATED
+ | SEC_READONLY);
+ srelgot = bfd_make_section_with_flags (dynobj, ".rela.got",
+ flags);
if (srelgot == NULL
- || !bfd_set_section_flags (dynobj, srelgot,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED
- | SEC_READONLY))
|| !bfd_set_section_alignment (dynobj, srelgot, 2))
return FALSE;
}
@@ -3380,9 +3377,8 @@ elf32_bfinfdpic_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);
if (s == NULL
- || ! bfd_set_section_flags (abfd, s, pltflags)
|| ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
return FALSE;
/* Blackfin-specific: remember it. */
@@ -3409,9 +3405,8 @@ elf32_bfinfdpic_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
}
/* Blackfin-specific: we want rel relocations for the plt. */
- s = bfd_make_section (abfd, ".rel.plt");
+ s = bfd_make_section_with_flags (abfd, ".rel.plt", flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
|| ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
return FALSE;
/* Blackfin-specific: remember it. */
@@ -3435,9 +3430,9 @@ elf32_bfinfdpic_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");
- if (s == NULL
- || ! bfd_set_section_flags (abfd, s, SEC_ALLOC | SEC_LINKER_CREATED))
+ s = bfd_make_section_with_flags (abfd, ".dynbss",
+ SEC_ALLOC | SEC_LINKER_CREATED);
+ if (s == NULL)
return FALSE;
/* The .rel[a].bss section holds copy relocs. This section is not
@@ -3453,11 +3448,11 @@ elf32_bfinfdpic_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);
if (s == NULL
- || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
|| ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
return FALSE;
}