From a4fd3de5d3170b2c22c9fe4cf236cc31305ef103 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 26 Jun 2012 01:40:59 +0000 Subject: [PATCH] * 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. --- bfd/ChangeLog | 6 ++++++ bfd/elf64-ppc.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 538864d3b9f..f00c337c2b5 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2012-06-26 Alan Modra + + * 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. + 2012-06-22 Roland McGrath * elf.c (assign_file_positions_for_non_load_sections): Define diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 46e82471e95..68ae03cdcd8 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; -- 2.30.2