From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7550 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 23:22:42 -0400 Message-ID: <20150429032242.GS17573@brightrain.aerifal.cx> References: <1430201554-11359-1-git-send-email-armccurdy@gmail.com> <20150428134317.GL17573@brightrain.aerifal.cx> <20150428185852.GP17573@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 1430277780 23204 80.91.229.3 (29 Apr 2015 03:23:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Apr 2015 03:23:00 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7563-gllmg-musl=m.gmane.org@lists.openwall.com Wed Apr 29 05:22:59 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 1YnIaP-0005tr-Bt for gllmg-musl@m.gmane.org; Wed, 29 Apr 2015 05:22:57 +0200 Original-Received: (qmail 14028 invoked by uid 550); 29 Apr 2015 03:22:55 -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 14007 invoked from network); 29 Apr 2015 03:22:55 -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:7550 Archived-At: On Tue, Apr 28, 2015 at 10:23:37PM +0300, Alexander Monakov wrote: > > > 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? > > I think it would avoid the LTO partitioning issue, but it would also be a step > back in terms of solving their original problem, which was to avoid duplicates > of syscall entry sequence being potentially emitted. Syscall entry sequences? I don't follow. Even if you meant "ELF entry points" which sounds more plausible I'm still not sure how duplicates would be emitted. I guess the concern is that if it's in a function the asm block, even if it's volatile, could be emitted in more than one place (e.g. a ptr-is-aligned branch and a ptr-is-misaligned branch); it just has to execute the right number of times. So yes, if this is what you mean, then I agree my solution is problematic and probably best avoided. > As another GCC > discussion mentions, they started using toplevel asm there after they found > they couldn't instruct Clang not do duplicate that function, unlike they could, > with function attributes, tame GCC. Interesting. Rich