This fixes PR 17110 which shows that the SH section relocation code can be called
[deliverable/binutils-gdb.git] / bfd / elf32-sh.c
index 34dfea2197e58fcdec2558e4b085b55b98d65ba6..5085830d8affac975915f20a17d1fa320cfe400d 100644 (file)
@@ -3676,7 +3676,9 @@ sh_elf_osec_to_segment (bfd *output_bfd, asection *osec)
 {
   Elf_Internal_Phdr *p = NULL;
 
-  if (output_bfd->xvec->flavour == bfd_target_elf_flavour)
+  if (output_bfd->xvec->flavour == bfd_target_elf_flavour
+      /* PR ld/17110: Do not look for output segments in an input bfd.  */
+      && output_bfd->direction != read_direction)
     p = _bfd_elf_find_segment_containing_section (output_bfd, osec);
 
   /* FIXME: Nothing ever says what this index is relative to.  The kernel
This page took 0.02458 seconds and 4 git commands to generate.