aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-11-15 11:36:52 +0000
committerAlan Modra <amodra@gmail.com>2011-11-15 11:36:52 +0000
commitfcb8c5a0deaa082bd10193c10bc9ceff48a02f95 (patch)
treefd1f62ef6fdfd3da6a47f13e6a35410a72185673
parent949dee0a7e15acfbed6c4da8a551e717fda0cf2e (diff)
downloadgdb-fcb8c5a0deaa082bd10193c10bc9ceff48a02f95.zip
gdb-fcb8c5a0deaa082bd10193c10bc9ceff48a02f95.tar.gz
gdb-fcb8c5a0deaa082bd10193c10bc9ceff48a02f95.tar.bz2
* elflink.c (_bfd_elf_create_got_section): Replace
bfd_make_section_with_flags with bfd_make_section_anyway_with_flags. (_bfd_elf_link_create_dynamic_sections): Likewise. * elf32-ppc.c (ppc_elf_create_glink): Likewise. (ppc_elf_create_dynamic_sections): Likewise.
-rw-r--r--bfd/ChangeLog9
-rw-r--r--bfd/elf32-ppc.c8
-rw-r--r--bfd/elflink.c70
3 files changed, 48 insertions, 39 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c3899c1..ec05301 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,12 @@
+2011-11-15 Alan Modra <amodra@gmail.com>
+ Andreas Tobler <andreast@fgznet.ch>
+
+ * elflink.c (_bfd_elf_create_got_section): Replace
+ bfd_make_section_with_flags with bfd_make_section_anyway_with_flags.
+ (_bfd_elf_link_create_dynamic_sections): Likewise.
+ * elf32-ppc.c (ppc_elf_create_glink): Likewise.
+ (ppc_elf_create_dynamic_sections): Likewise.
+
2011-11-09 Alan Modra <amodra@gmail.com>
* elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Mark syms in
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index cfb4734..0c25c3e 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -2891,7 +2891,7 @@ ppc_elf_create_glink (bfd *abfd, struct bfd_link_info *info)
flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS
| SEC_IN_MEMORY | SEC_LINKER_CREATED);
- s = bfd_make_section_with_flags (abfd, ".rela.iplt", flags);
+ s = bfd_make_section_anyway_with_flags (abfd, ".rela.iplt", flags);
htab->reliplt = s;
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, 2))
@@ -2924,8 +2924,8 @@ ppc_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
return FALSE;
htab->dynbss = bfd_get_section_by_name (abfd, ".dynbss");
- s = bfd_make_section_with_flags (abfd, ".dynsbss",
- SEC_ALLOC | SEC_LINKER_CREATED);
+ s = bfd_make_section_anyway_with_flags (abfd, ".dynsbss",
+ SEC_ALLOC | SEC_LINKER_CREATED);
htab->dynsbss = s;
if (s == NULL)
return FALSE;
@@ -2935,7 +2935,7 @@ ppc_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
htab->relbss = bfd_get_section_by_name (abfd, ".rela.bss");
flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS
| SEC_IN_MEMORY | SEC_LINKER_CREATED);
- s = bfd_make_section_with_flags (abfd, ".rela.sbss", flags);
+ s = bfd_make_section_anyway_with_flags (abfd, ".rela.sbss", flags);
htab->relsbss = s;
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, 2))
diff --git a/bfd/elflink.c b/bfd/elflink.c
index bb82f5b..fc4266b 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -110,17 +110,17 @@ _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
flags = bed->dynamic_sec_flags;
- s = bfd_make_section_with_flags (abfd,
- (bed->rela_plts_and_copies_p
- ? ".rela.got" : ".rel.got"),
- (bed->dynamic_sec_flags
- | SEC_READONLY));
+ s = bfd_make_section_anyway_with_flags (abfd,
+ (bed->rela_plts_and_copies_p
+ ? ".rela.got" : ".rel.got"),
+ (bed->dynamic_sec_flags
+ | SEC_READONLY));
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
return FALSE;
htab->srelgot = s;
- s = bfd_make_section_with_flags (abfd, ".got", flags);
+ s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
if (s == NULL
|| !bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
return FALSE;
@@ -128,7 +128,7 @@ _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
if (bed->want_got_plt)
{
- s = bfd_make_section_with_flags (abfd, ".got.plt", flags);
+ s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags);
if (s == NULL
|| !bfd_set_section_alignment (abfd, s,
bed->s->log_file_align))
@@ -206,44 +206,44 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
shared library does not. */
if (info->executable)
{
- s = bfd_make_section_with_flags (abfd, ".interp",
- flags | SEC_READONLY);
+ s = bfd_make_section_anyway_with_flags (abfd, ".interp",
+ flags | SEC_READONLY);
if (s == NULL)
return FALSE;
}
/* Create sections to hold version informations. These are removed
if they are not needed. */
- s = bfd_make_section_with_flags (abfd, ".gnu.version_d",
- flags | SEC_READONLY);
+ s = bfd_make_section_anyway_with_flags (abfd, ".gnu.version_d",
+ flags | SEC_READONLY);
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
return FALSE;
- s = bfd_make_section_with_flags (abfd, ".gnu.version",
- flags | SEC_READONLY);
+ s = bfd_make_section_anyway_with_flags (abfd, ".gnu.version",
+ flags | SEC_READONLY);
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, 1))
return FALSE;
- s = bfd_make_section_with_flags (abfd, ".gnu.version_r",
- flags | SEC_READONLY);
+ s = bfd_make_section_anyway_with_flags (abfd, ".gnu.version_r",
+ flags | SEC_READONLY);
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
return FALSE;
- s = bfd_make_section_with_flags (abfd, ".dynsym",
- flags | SEC_READONLY);
+ s = bfd_make_section_anyway_with_flags (abfd, ".dynsym",
+ flags | SEC_READONLY);
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
return FALSE;
- s = bfd_make_section_with_flags (abfd, ".dynstr",
- flags | SEC_READONLY);
+ s = bfd_make_section_anyway_with_flags (abfd, ".dynstr",
+ flags | SEC_READONLY);
if (s == NULL)
return FALSE;
- s = bfd_make_section_with_flags (abfd, ".dynamic", flags);
+ s = bfd_make_section_anyway_with_flags (abfd, ".dynamic", flags);
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
return FALSE;
@@ -259,7 +259,8 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
if (info->emit_hash)
{
- s = bfd_make_section_with_flags (abfd, ".hash", flags | SEC_READONLY);
+ s = bfd_make_section_anyway_with_flags (abfd, ".hash",
+ flags | SEC_READONLY);
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
return FALSE;
@@ -268,8 +269,8 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
if (info->emit_gnu_hash)
{
- s = bfd_make_section_with_flags (abfd, ".gnu.hash",
- flags | SEC_READONLY);
+ s = bfd_make_section_anyway_with_flags (abfd, ".gnu.hash",
+ flags | SEC_READONLY);
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
return FALSE;
@@ -320,7 +321,7 @@ _bfd_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);
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
return FALSE;
@@ -337,10 +338,10 @@ _bfd_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
return FALSE;
}
- s = bfd_make_section_with_flags (abfd,
- (bed->rela_plts_and_copies_p
- ? ".rela.plt" : ".rel.plt"),
- flags | SEC_READONLY);
+ s = bfd_make_section_anyway_with_flags (abfd,
+ (bed->rela_plts_and_copies_p
+ ? ".rela.plt" : ".rel.plt"),
+ flags | SEC_READONLY);
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
return FALSE;
@@ -357,9 +358,8 @@ _bfd_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));
if (s == NULL)
return FALSE;
@@ -376,10 +376,10 @@ _bfd_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
copy relocs. */
if (! info->shared)
{
- s = bfd_make_section_with_flags (abfd,
- (bed->rela_plts_and_copies_p
- ? ".rela.bss" : ".rel.bss"),
- flags | SEC_READONLY);
+ s = bfd_make_section_anyway_with_flags (abfd,
+ (bed->rela_plts_and_copies_p
+ ? ".rela.bss" : ".rel.bss"),
+ flags | SEC_READONLY);
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
return FALSE;