From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14110 invoked by alias); 16 Jul 2013 19:12:46 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 11856 invoked by uid 48); 16 Jul 2013 19:10:43 -0000 From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/48094] ld: warning: section has unexpectedly large size errors in objc/obj-c++ lto Date: Tue, 16 Jul 2013 19:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 4.6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: iains at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg00805.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48094 --- Comment #17 from Iain Sandoe --- Created attachment 30514 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30514&action=edit proposed fix. So the problem here is that when we bind multiple objects together (each of which has an anonymous image_info section) LTO (unlike the system linker) doens't know that these should be coalesced - and, TBH, I doubt we're going to teach it about a darwin-specific section ... Luckily, the content of the image_info section only depends on command line flags. So this is a proposed solution. 1. allow the requisite ObjC flags to be recognized by lto1. 2. don't generate the image_info section in the FE instead .. 3. take note of the flag values, and (IFF there is some ObjC metadata present in the object) emit the image_info section from the back end. ==== I've checked that this flies on Darwin12 with XCode 4.6.3 [with lto enabled] - but I don't have the XCode 4.2 configuration on Darwin10. (it has also been tested on older versions of the tool-chain). ==== Mike - opinions on the solution? others: wider testing please