aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i370.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-06-29 14:46:03 +0000
committerAlan Modra <amodra@gmail.com>2012-06-29 14:46:03 +0000
commit3d4d4302b99ee621e11ac8ef60ac9185da94654b (patch)
tree95c1467db42073fd90064c7ab2d32ff28c133138 /bfd/elf32-i370.c
parentb6ba681cdacf16ce4369eb5e824c6bac2540f332 (diff)
downloadgdb-3d4d4302b99ee621e11ac8ef60ac9185da94654b.zip
gdb-3d4d4302b99ee621e11ac8ef60ac9185da94654b.tar.gz
gdb-3d4d4302b99ee621e11ac8ef60ac9185da94654b.tar.bz2
* section.c (bfd_get_linker_section): New function.
* elf32-arm.c: When retrieving SEC_LINKER_CREATED sections, use the above throughout rather than bfd_get_section_by_name. Use bfd_make_section_anyway rather than bfd_make_section when creating them. * elf32-bfin.c: Likewise. * elf32-cr16.c: Likewise. * elf32-cris.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf32-i386.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68k.c: Likewise. * elf32-microblaze.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-sh.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-vax.c: Likewise. * elf32-xstormy16.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * elflink.c: Likewise. * elf-vxworks.c: Likewise. * elf-m10300.c: Likewise. Also make use of htab plt, got and gotplt shortcuts. * bfd-in2.h: Regenerate. * elf32-lm32.c (lm32_elf_check_relocs): Use the correct bfd when calling create_rofixup_section. * elflink.c (bfd_elf_final_link): Simplify test for .dynstr.
Diffstat (limited to 'bfd/elf32-i370.c')
-rw-r--r--bfd/elf32-i370.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c
index 4d1d037..5998db7 100644
--- a/bfd/elf32-i370.c
+++ b/bfd/elf32-i370.c
@@ -420,23 +420,23 @@ i370_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
| SEC_LINKER_CREATED);
- 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);
if (s == NULL)
return FALSE;
if (! info->shared)
{
- s = bfd_make_section_with_flags (abfd, ".rela.sbss",
- flags | SEC_READONLY);
+ s = bfd_make_section_anyway_with_flags (abfd, ".rela.sbss",
+ flags | SEC_READONLY);
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, 2))
return FALSE;
}
/* XXX beats me, seem to need a rela.text ... */
- s = bfd_make_section_with_flags (abfd, ".rela.text",
- flags | SEC_READONLY);
+ s = bfd_make_section_anyway_with_flags (abfd, ".rela.text",
+ flags | SEC_READONLY);
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, 2))
return FALSE;
@@ -472,7 +472,7 @@ i370_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
&& h->ref_regular
&& !h->def_regular)));
- s = bfd_get_section_by_name (dynobj, ".rela.text");
+ s = bfd_get_linker_section (dynobj, ".rela.text");
BFD_ASSERT (s != NULL);
s->size += sizeof (Elf32_External_Rela);
@@ -513,9 +513,9 @@ i370_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
only if there were actually SDAREL relocs for that symbol. */
if (h->size <= elf_gp_size (dynobj))
- s = bfd_get_section_by_name (dynobj, ".dynsbss");
+ s = bfd_get_linker_section (dynobj, ".dynsbss");
else
- s = bfd_get_section_by_name (dynobj, ".dynbss");
+ s = bfd_get_linker_section (dynobj, ".dynbss");
BFD_ASSERT (s != NULL);
/* We must generate a R_I370_COPY reloc to tell the dynamic linker to
@@ -527,9 +527,9 @@ i370_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
asection *srel;
if (h->size <= elf_gp_size (dynobj))
- srel = bfd_get_section_by_name (dynobj, ".rela.sbss");
+ srel = bfd_get_linker_section (dynobj, ".rela.sbss");
else
- srel = bfd_get_section_by_name (dynobj, ".rela.bss");
+ srel = bfd_get_linker_section (dynobj, ".rela.bss");
BFD_ASSERT (srel != NULL);
srel->size += sizeof (Elf32_External_Rela);
h->needs_copy = 1;
@@ -588,7 +588,7 @@ i370_elf_size_dynamic_sections (bfd *output_bfd,
/* Set the contents of the .interp section to the interpreter. */
if (info->executable)
{
- s = bfd_get_section_by_name (dynobj, ".interp");
+ s = bfd_get_linker_section (dynobj, ".interp");
BFD_ASSERT (s != NULL);
s->size = sizeof ELF_DYNAMIC_INTERPRETER;
s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
@@ -608,7 +608,7 @@ i370_elf_size_dynamic_sections (bfd *output_bfd,
for (p = rela_sections; *p != NULL; p++)
{
- s = bfd_get_section_by_name (dynobj, *p);
+ s = bfd_get_linker_section (dynobj, *p);
if (s != NULL)
s->size = 0;
}
@@ -869,20 +869,20 @@ i370_elf_finish_dynamic_sections (bfd *output_bfd,
{
asection *sdyn;
bfd *dynobj = elf_hash_table (info)->dynobj;
- asection *sgot = bfd_get_section_by_name (dynobj, ".got");
+ asection *sgot = bfd_get_linker_section (dynobj, ".got");
#ifdef DEBUG
fprintf (stderr, "i370_elf_finish_dynamic_sections called\n");
#endif
- sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+ sdyn = bfd_get_linker_section (dynobj, ".dynamic");
if (elf_hash_table (info)->dynamic_sections_created)
{
asection *splt;
Elf32_External_Dyn *dyncon, *dynconend;
- splt = bfd_get_section_by_name (dynobj, ".plt");
+ splt = bfd_get_linker_section (dynobj, ".plt");
BFD_ASSERT (splt != NULL && sdyn != NULL);
dyncon = (Elf32_External_Dyn *) sdyn->contents;
@@ -945,7 +945,7 @@ i370_elf_finish_dynamic_sections (bfd *output_bfd,
/* Set up the section symbols for the output sections. */
- sdynsym = bfd_get_section_by_name (dynobj, ".dynsym");
+ sdynsym = bfd_get_linker_section (dynobj, ".dynsym");
BFD_ASSERT (sdynsym != NULL);
sym.st_size = 0;