From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757403AbYDJQP4 (ORCPT ); Thu, 10 Apr 2008 12:15:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756802AbYDJQPr (ORCPT ); Thu, 10 Apr 2008 12:15:47 -0400 Received: from terminus.zytor.com ([198.137.202.10]:45635 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756791AbYDJQPq (ORCPT ); Thu, 10 Apr 2008 12:15:46 -0400 Message-ID: <47FE3C0C.4090101@zytor.com> Date: Thu, 10 Apr 2008 09:10:52 -0700 From: "H. Peter Anvin" User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: Linus Torvalds CC: Andi Kleen , Steven Rostedt , Andy Whitcroft , LKML , Ingo Molnar , Peter Zijlstra , akpm@linux-foundation.org, Rusty Russell , Glauber de Oliveira Costa , Jan Beulich , Thomas Gleixner , pinskia@gcc.gnu.org Subject: Re: [PATCH] pop previous section in alternative.c References: <47FD5D42.5000603@zytor.com> <87wsn6m6zt.fsf@basil.nowhere.org> <20080410094637.GW17915@shadowen.org> <20080410144114.GH10019@one.firstfloor.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds wrote: > > The thing is, we'd be much better off with some sanity checking in the > assembler. > > Which is likely not going to happen - oh well. > > In particular, the assembler should see patterns like > > .size function, .-function > > and it should be _trivially_ able to check that "." and "function" are in > the same section, and warn if they aren't. Because I don't see how it > could ever be valid to have sizes that cross section boundaries (it's a > totally nonsensical concept). > > But it doesn't. Oh, well. > Wow. That is utterly braindamaged on the part of gas. > But maybe we can see it in the resulting object file somehow, and do the > check there (the same way we do the init-section analysis). I assume the > .size directive writes some debug info or similar, and we can create a big > warning when a size is unexpectedly huge and crosses section size > boundaries? I just tried it, and it output the difference across the sections, without any consideration that the base was different. Didn't know one could write an assembler that dumb. -hpa