From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125111 invoked by alias); 19 May 2017 10:18:58 -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 125100 invoked by uid 89); 19 May 2017 10:18:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= 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, 19 May 2017 10:18:56 +0000 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [binutils-gdb] garbage collect debug sections when no alloc sections are kept From: sergiodj+buildbot@sergiodj.net To: gdb-testers@sourceware.org Message-Id: Date: Fri, 19 May 2017 10:18:00 -0000 X-SW-Source: 2017-q2/txt/msg02793.txt.bz2 *** TEST RESULTS FOR COMMIT eb026f09eb6fcb96a5de1e655cdde041ba44affb *** Author: Alan Modra Branch: master Commit: eb026f09eb6fcb96a5de1e655cdde041ba44affb garbage collect debug sections when no alloc sections are kept The pr20882 testcase fails on a number of targets that add attribute or note sections to object files, and the default linker script says those sections should be kept. This patch changes --gc-sections to drop debug and special sections like .comment when no SEC_ALLOC section in an object file is kept. The assumption is that debug sections are describing code and data that will become part of the final image in memory. * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep debug and special sections when no non-note alloc sections in an object are kept.