[RFC] changing elf visibility syntax

Peter Johnson peter at tortall.net
Sat Dec 17 21:21:46 PST 2005

On Sun, 18 Dec 2005, Mike Frysinger wrote:
> the difference is in syntax though ... yasm does:
> GLOBAL foo:function hidden
> notice my version uses a ":" between the type/visibility while yasm
> uses a " " ...
> i noted this on the nasm list and someone pointed out that it'd be best
> if nasm and yasm didnt diverge syntax unnecessarily.  since my version
> makes more sense imho, and since it'd be harder to add support for the
> syntax used currently in yasm to nasm (i certainly dont know my way
> around the nasm source code base so i wouldnt be able to do it), i was
> wondering if yasm devs would consider changing ?  especially since the
> last release doesnt support visibility, it's not like syntax would be
> broken across releases ...

The problem with the proposed double-colon syntax is it doesn't match the 
syntax of other NASM syntax objfmt-specific extensions when extra 
parameters are given, e.g.:

   global  hashtable:data (hashtable.end - hashtable)


   global  sys_open:export
   global  kernel_ticks:export data

(both examples from the NASM manual).  So NASM already supports the same 
type of syntax as YASM is using for ":function hidden"

Yasm's NASM syntax parser treats ':' as the separator between the builtin 
directive parameters and the objfmt-specific parameters in keeping with 
the above and NASM's manual.  I'm disinclined to add handling for extra 
colons that is not in keeping with the NASM original "standard" syntax... 
doing this would in fact break syntax compatibility if YASM supported 
"global kernel_ticks:export:data" for example.


More information about the yasm-devel mailing list