From: Danny S. <dan...@cl...> - 2003-03-12 19:48:18
|
Thanks Luke The patch was approved and committed, so I guess we do need a testcase for the IMPORTS section and a different patch. ----- Original Message ----- From: "Luke Dunstan" <cod...@ho...> To: <min...@li...> Sent: Wednesday, 12 March 2003 11:47 Subject: [MinGW-dvlpr] Re: [ mingw-Bugs-698615 ] ld crash with '-shared' > > I agree that this change would remove the need for opt_name, so I think that > the redundant rules should be removed because otherwise the parser becomes > confusing. However, I believe that the patch breaks the handling of the > "IMPORTS" section, but I wasn't even aware of such a section until now so > I'm not sure of its purpose. I also haven't found any useful MSDN > documentation on this section except a little about 16-bit apps. Here are > the rules: > > impline: > ID '=' ID '.' ID '.' ID { def_import ($1, $3, $5, $7, > -1); } > | ID '=' ID '.' ID '.' NUMBER { def_import ($1, $3, $5, 0, > $7); } > | ID '=' ID '.' ID { def_import ($1, $3, 0, $5, > -1); } > | ID '=' ID '.' NUMBER { def_import ($1, $3, 0, 0, > $5); } > | ID '.' ID '.' ID { def_import ( 0, $1, $3, $5, > -1); } > | ID '.' ID { def_import ( 0, $1, 0, $3, > -1); } > ; > > The def_import() function does just concatenate the module name and the > DLL's file extension in the first two cases, but the patch will prevent the > parser from distinguishing the function name (the last ID) from the DLL > name. Some possible solutions (instead of the patch): > > 1. Define a "dotted_name" rule that parses an ID followed by any number of > dots and IDs, then concatenates them. The dotted_name would replace ID in > only "expline" and "opt_equal_name". I'll try this one I think. I tried something similar and it worked but I didn't trust my knowledge of yacc/bison so I submitted the less intrusive patch. === 8< === > If the IMPORTS section doesn't need to be supported in binutils anyway then > that would be easy, but if it does then I guess there should be a test case, > if we can find an example of its use. Other sections like "SECTIONS" are > probably obsolete too. > > BTW, MSVC 6 generates something like this for an unnamed namespace, and > processes it like any other export: > > ?foo@?%C:\devl\test\dlltest\dlltest.cpp42368689@@YAXXZ > > Luke > > > > _________________________________________________________________ > MSN Instant Messenger now available on Australian mobile phones. Go to > http://ninemsn.com.au/mobilecentral/hotmail_messenger.asp > > > > ------------------------------------------------------- > This SF.net email is sponsored by:Crypto Challenge is now open! > Get cracking and register here for some mind boggling fun and > the chance of winning an Apple iPod: > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en > _______________________________________________ > MinGW-dvlpr mailing list > Min...@li... > https://lists.sourceforge.net/lists/listinfo/mingw-dvlpr |