From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69315 invoked by alias); 23 Aug 2019 12:44:01 -0000 Mailing-List: contact gdb-testers-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-testers-owner@sourceware.org Received: (qmail 69221 invoked by uid 89); 23 Aug 2019 12:44:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1866, BFD X-HELO: kwanyin.sergiodj.net Received: from kwanyin.sergiodj.net (HELO kwanyin.sergiodj.net) (158.69.185.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Aug 2019 12:43:59 +0000 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [binutils-gdb] Stop the BFD library from failing when encountering a second set of relocs for the same section. From: gdb-buildbot@sergiodj.net To: gdb-testers@sourceware.org Message-Id: Date: Fri, 23 Aug 2019 13:01:00 -0000 X-SW-Source: 2019-q3/txt/msg03342.txt.bz2 *** TEST RESULTS FOR COMMIT a7ba389645d178c43100ec47e513389ae8bf8f93 *** commit a7ba389645d178c43100ec47e513389ae8bf8f93 Author: Nick Clifton AuthorDate: Fri Aug 23 13:22:02 2019 +0100 Commit: Nick Clifton CommitDate: Fri Aug 23 13:22:02 2019 +0100 Stop the BFD library from failing when encountering a second set of relocs for the same section. PR 24456 * elf.c (bfd_section_from_shdr): Issue an informative warning message and continue processing other sections after encountering a reloc section for a section which already has other relocs associated with it. diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b39acb19b2..00afa81398 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2019-08-23 Nick Clifton + + PR 24456 + * elf.c (bfd_section_from_shdr): Issue an informative warning + message and continue processing other sections after encountering + a reloc section for a section which already has other relocs + associated with it. + 2019-08-23 Alan Modra PR 24933 diff --git a/bfd/elf.c b/bfd/elf.c index 42ae1627ba..5a061c9110 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -2466,9 +2466,18 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) else p_hdr = &esdt->rel.hdr; - /* PR 17512: file: 0b4f81b7. */ + /* PR 17512: file: 0b4f81b7. + Also see PR 24456, for a file which deliberately has two reloc + sections. */ if (*p_hdr != NULL) - goto fail; + { + _bfd_error_handler + /* xgettext:c-format */ + (_("%pB: warning: multiple relocation sections for section %pA \ +found - ignoring all but the first"), + abfd, target_sect); + goto success; + } hdr2 = (Elf_Internal_Shdr *) bfd_alloc (abfd, sizeof (*hdr2)); if (hdr2 == NULL) goto fail;