From: suresh b. <k_s...@ya...> - 2014-10-02 04:57:46
|
Hi Lars, If an extern is used in any program, it mean that the defined variable / label / name is globally defined. Then why again making it a gloabl? You said in your old mails that you are making a single library for all exe formats. Can you give your objective of modifying the nasm and its purpose before we understand the code you are referring here. DEVELOPING AN OPTIONs WINDOW FOR NASM ======================================= I am interested to develop a simple window with options set through a menu to run nasm. In the command line we give options but instead we can give them through a menu and save the options file similar to a project file in build systems. Looking for suggestions and comments for my initiative. regards, sureshbk. On Monday, September 29, 2014 5:25 AM, Lars Maier <lar...@te...> wrote: Hello at all, I'm working a lot with nasm and after a while I created a little library I use in all nasm-Projects. Therefor some header files are very useful (e.g. defining constants and externs). I don't want to mess around with some macros for simple imports. I thought of a c-prototype-like symbol definition for externs. What if a defined extern could be redefined as global. I had a look at the source code and found two possible solutions: 1.) see http://repo.or.cz/w/nasm.git/blob/HEAD:/labels.c#l278 one could allow in line 294, that externs could be redefined as global. By a quick look, I think, that this wouldn't be a problem for the labelmanager. find_lable simply returns the label and define_lable would refill it with the global singal data. The bigger problem is the ofmt, because the ofmt->symdef is explicitly called _once_ for each symbol. Looking at, for example, the objobj.c you can see, that symbols are stored in linked lists and there is no check for double names or something like that. -> Bad solution (update all objformats, looping through list for each symbol) 2.) if somehow possible, and symbols do not need to passed to the ofmt directly after they were found (somehow context dependend), then you could buffer the extern symbols until the whole analysis is ready. every extern symbol that was not replaced by a global would then be passed the the ofmt. exclude extern symbols at http://repo.or.cz/w/nasm.git/blob/HEAD:/labels.c#l327 and introduce a new function, that loops through all symbols and passes the missing externs to the ofmt. call the function in the main function at the right place (maybe here: http://repo.or.cz/w/nasm.git/blob/HEAD:/nasm.c#l466). I would love to from you! Lars ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ Nasm-devel mailing list Nas...@li... https://lists.sourceforge.net/lists/listinfo/nasm-devel |