Fix segfault when .plt section does not exist
[deliverable/binutils-gdb.git] / bfd / elfnn-riscv.c
index 320d318ce5b4f446d18f1ab845da0b1c987f1242..b8dd1f23aa6d7fb84fa653fd5433e8f572b819f2 100644 (file)
@@ -2502,10 +2502,10 @@ riscv_elf_finish_dynamic_sections (bfd *output_bfd,
 
          for (i = 0; i < PLT_HEADER_INSNS; i++)
            bfd_put_32 (output_bfd, plt_header[i], splt->contents + 4*i);
-       }
 
-      elf_section_data (splt->output_section)->this_hdr.sh_entsize
-       = PLT_ENTRY_SIZE;
+         elf_section_data (splt->output_section)->this_hdr.sh_entsize
+           = PLT_ENTRY_SIZE;
+       }
     }
 
   if (htab->elf.sgotplt)
This page took 0.024244 seconds and 4 git commands to generate.