summaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2012-06-26 01:40:59 +0000
committerAlan Modra <amodra@bigpond.net.au>2012-06-26 01:40:59 +0000
commitb8d75a47baac6d62820c07bd396c62db07ad737b (patch)
treec7d76021ede4aa64a4ef3ea2bb0cc3e0e143b5c0 /bfd/elf64-ppc.c
parent0d640e87b328a41a61a187a31a68a9c830207a22 (diff)
downloadbinutils-redhat-b8d75a47baac6d62820c07bd396c62db07ad737b.tar.gz
* elf64-ppc.c (ppc64_elf_next_toc_section): Don't error if input
file has multiple .got/.toc sections and all don't fit in current toc group.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 46e82471e9..68ae03cdcd 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -10554,7 +10554,9 @@ ppc64_elf_next_toc_section (struct bfd_link_info *info, asection *isec)
if (!htab->second_toc_pass)
{
/* Keep track of the first .toc or .got section for this input bfd. */
- if (htab->toc_bfd != isec->owner)
+ bfd_boolean new_bfd = htab->toc_bfd != isec->owner;
+
+ if (new_bfd)
{
htab->toc_bfd = isec->owner;
htab->toc_first_sec = isec;
@@ -10582,7 +10584,8 @@ ppc64_elf_next_toc_section (struct bfd_link_info *info, asection *isec)
/* Die if someone uses a linker script that doesn't keep input
file .toc and .got together. */
- if (elf_gp (isec->owner) != 0
+ if (new_bfd
+ && elf_gp (isec->owner) != 0
&& elf_gp (isec->owner) != off)
return FALSE;