From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7547 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] force LTO to be disabled when compiling dlstart.lo Date: Tue, 28 Apr 2015 14:58:52 -0400 Message-ID: <20150428185852.GP17573@brightrain.aerifal.cx> References: <1430201554-11359-1-git-send-email-armccurdy@gmail.com> <20150428134317.GL17573@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1430247552 28396 80.91.229.3 (28 Apr 2015 18:59:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Apr 2015 18:59:12 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7560-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 28 20:59:07 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YnAip-00085m-1D for gllmg-musl@m.gmane.org; Tue, 28 Apr 2015 20:59:07 +0200 Original-Received: (qmail 14108 invoked by uid 550); 28 Apr 2015 18:59:05 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 14090 invoked from network); 28 Apr 2015 18:59:04 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7547 Archived-At: On Tue, Apr 28, 2015 at 09:50:59PM +0300, Alexander Monakov wrote: > > If the person on #gcc with ld -r was using gcc asm statements as well, that > > would explain their problem too. > > Let me add that there's another class of problems with toplevel asms and LTO: > as a result of LTO partitioning, toplevel asm may be moved into a different > partition from the symbol it's referencing, breaking the build (when toplevel > asm is referencing a static function). GCC bug report for that issue is here: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57703 I have an interesting solution to this problem: get rid of the top-level asm and instead put it inside the function with 2 additional lines: - At the top, "jmp 9f" or equivalent. - At the bottom, "9:". Now the asm can't be separated from the function because it's part of it. Would that work? Rich