From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7635 Path: news.gmane.org!not-for-mail From: Alex Dowad Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH v2] First prototype of script which adds CFI directives to x86 asm Date: Wed, 13 May 2015 19:36:46 +0200 Message-ID: <20150513173646.GA2951@alex-ThinkPad-L530> 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 1431538630 30182 80.91.229.3 (13 May 2015 17:37:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 May 2015 17:37:10 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7647-gllmg-musl=m.gmane.org@lists.openwall.com Wed May 13 19:37:09 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 1Ysaaj-0007Hl-J4 for gllmg-musl@m.gmane.org; Wed, 13 May 2015 19:37:09 +0200 Original-Received: (qmail 26610 invoked by uid 550); 13 May 2015 17:37:07 -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 26558 invoked from network); 13 May 2015 17:37:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=z5c90ly1pcI8WW4Zn3n3NGNCGuuzgvJejH+0tE/bD7M=; b=U4kFPVSdHwJTwR5D0cRoIwnUbF4RwEI1EsE/gsOwBs/F1vtCG8SJGEl3pg2uNjdtrP OMNk1RJvBpGHg9KtcC0biEU8wE/GQlQUXUvdrl5IpF2E4X4OH8Q7BLfIFwc+pRk4I++E 2h0z8/X33Wxj2EMwWpJmUCMwKrAIkE9w9gqMPkfJEcH82OvHy5ZE2Cj+zRYu06FiFbQh ogG+AU7r9HTL0R7MlGGwMOC4m65n74WalamaKtm++4E+hv6J9kxupfWyk5v33TtlWNZf c+FjkDNteiV3KfiJU3unBL5vnthLnIeju533tHTmaRHPcnw6zUfUEiYa0QBhR3K2MuZ9 PLcA== X-Received: by 10.180.91.137 with SMTP id ce9mr16100987wib.76.1431538611732; Wed, 13 May 2015 10:36:51 -0700 (PDT) Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:7635 Archived-At: Thanks to Szabolcs Nagy for your reply! > it might make sense to have a make rule that produces the cfi asm for inspection Any opinions from others on this? > i wonder if a configure check for .cfi support should be added: in theory > an assembler may not support it (tcc?) Sure, I can do this. If debugging is not enabled, it doesn't make much sense to use the CFI script either. Would adding another variable to config.mak, something like GENERATE_CFI=yes (or something like that) be acceptable? > move this loop to BEGIN so it only runs at startup I tried benchmarking and there is no measurable impact on performance either way. I would prefer to leave the loop where it is, to make the script easier to read (keeping related code together). I added 'i' to the argument list to make it local -- thanks for the tip. > i think hex conversion for $123 is wrong in i386 asm Fixed in the v2. > allow whitespace between ',' and the regs Fixed, thanks. > (missing .cfi_startproc/endproc might be problematic i think > because .cfi directives can be rejected outside of startproc/endproc) Yes, that's why the script doesn't emit them unless it is inside a startproc/endproc pair. Regarding the concern with .type @function, I am trying a different strategy now for identifying the beginning and end of functions. Please see the v3 (soon to be posted). Thanks, Alex