aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 3448bfc..ac95c22 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -11188,15 +11188,12 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
goto error_return;
/* Check for DT_TEXTREL (late, in case the backend removes it). */
- if ((info->warn_shared_textrel && info->shared)
- || info->error_textrel)
+ if (((info->warn_shared_textrel && info->shared)
+ || info->error_textrel)
+ && (o = bfd_get_section_by_name (dynobj, ".dynamic")) != NULL)
{
bfd_byte *dyncon, *dynconend;
- /* Fix up .dynamic entries. */
- o = bfd_get_section_by_name (dynobj, ".dynamic");
- BFD_ASSERT (o != NULL);
-
dyncon = o->contents;
dynconend = o->contents + o->size;
for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)