aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-nios2.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-nios2.c')
-rw-r--r--bfd/elf32-nios2.c47
1 files changed, 1 insertions, 46 deletions
diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
index cdc11f9..01c2fe5 100644
--- a/bfd/elf32-nios2.c
+++ b/bfd/elf32-nios2.c
@@ -5877,52 +5877,7 @@ nios2_elf32_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
if (htab->res_n_size)
elf_link_hash_traverse (& htab->root, adjust_dynrelocs, info);
- if (htab->root.dynamic_sections_created)
- {
- /* Add some entries to the .dynamic section. We fill in the
- values later, in elf_nios2_finish_dynamic_sections, but we
- must add the entries now so that we get the correct size for
- the .dynamic section. The DT_DEBUG entry is filled in by the
- dynamic linker and used by the debugger. */
-#define add_dynamic_entry(TAG, VAL) \
- _bfd_elf_add_dynamic_entry (info, TAG, VAL)
-
- if (!bfd_link_pic (info) && !add_dynamic_entry (DT_DEBUG, 0))
- return FALSE;
-
- if (htab->root.sgotplt->size != 0
- && !add_dynamic_entry (DT_PLTGOT, 0))
- return FALSE;
-
- if (htab->root.splt->size != 0
- && (!add_dynamic_entry (DT_PLTRELSZ, 0)
- || !add_dynamic_entry (DT_PLTREL, DT_RELA)
- || !add_dynamic_entry (DT_JMPREL, 0)))
- return FALSE;
-
- if (relocs)
- {
- if (!add_dynamic_entry (DT_RELA, 0)
- || !add_dynamic_entry (DT_RELASZ, 0)
- || !add_dynamic_entry (DT_RELAENT,
- sizeof (Elf32_External_Rela)))
- return FALSE;
-
- if ((info->flags & DF_TEXTREL) == 0)
- elf_link_hash_traverse (&htab->root,
- _bfd_elf_maybe_set_textrel, info);
-
- if ((info->flags & DF_TEXTREL) != 0
- && !add_dynamic_entry (DT_TEXTREL, 0))
- return FALSE;
- }
-
- if (!bfd_link_pic (info) && !add_dynamic_entry (DT_NIOS2_GP, 0))
- return FALSE;
- }
-#undef add_dynamic_entry
-
- return TRUE;
+ return _bfd_elf_add_dynamic_tags (output_bfd, info, relocs);
}
/* Free the derived linker hash table. */