aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-sh.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-07-08 16:20:48 +0100
committerNick Clifton <nickc@redhat.com>2014-07-08 16:20:48 +0100
commit5bc8cb6f842e588e7ae9f3b9f52f9f41fb97bf34 (patch)
tree3f5f24405a328d43cb7e461927ebbf2465fc2fb4 /bfd/elf32-sh.c
parent792f7758e3cdbe72b82a5014d74e87e9c1ee0c3b (diff)
downloadgdb-5bc8cb6f842e588e7ae9f3b9f52f9f41fb97bf34.zip
gdb-5bc8cb6f842e588e7ae9f3b9f52f9f41fb97bf34.tar.gz
gdb-5bc8cb6f842e588e7ae9f3b9f52f9f41fb97bf34.tar.bz2
This fixes PR 17110 which shows that the SH section relocation code can be called
for input BFDs as well as output BFDs. PR ld/17110 * elf32-sh.c (sh_elf_osec_to_segment): Do not look for output segments in input bfds.
Diffstat (limited to 'bfd/elf32-sh.c')
-rw-r--r--bfd/elf32-sh.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 34dfea2..5085830 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -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