RE: [Dev-C++] @ symbol at the end of function names?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2003-09-09 09:16:27
|
For Windows, that supports both ordinal and named exports, the advantage of ordinal export is faster linkage and harder reverse-engineering. With named exports, it is quite easy to look at a DLL and find out what services it exports - you still need to find out parameter types etc. When exporting a c++ symbol by name, the fully decorated name must be specified. The advantage is that you then get type-safe linkage even when using DLL files. Obviously, by defining the symbol as extern "C", it won't use any name mangling, so it is a lot easier to create the def file. With "C" linkage, it is also easier to interact between different compilers, since it doesn't matter if they use different name-mangling rules. However, they still have to use the same calling conventions. /Per W On Tue, 9 Sep 2003, P.D. van Zelst wrote: > Well, it's a number you can define yourself... you can give it any > arbitrary value. If it was something critical as the stack size for > example, I don't think they'd let you specify it yourself. The numbers > in the .def files (after the @ symbol) get put there by the developers > who create the DLL, not by the compiler. > And now I know the reason why you can use these numbers as well.... > here's an excerpt from a webpage I found: > > "Module definition file > In conventional systems, DLLs may export by name or by ordinal. Symbian > OS only supports exporting by ordinal. Exporting by ordinal reduces the > time taken to find the item in the DLL export table and also reduces the > size of the DLL as names need not be stored. Ordinals are used for > accessing the address of a function in the DLL export table. > > A module definition file (.def) is a text file which lists the exported > functions of a DLL; it is used in an ordinal build to insert ordinal > information into the DLL export table." > > Don't know if this holds exactly true for all .def files, since this is > from the Symbian website, but it's a start :) > > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf Of OROSZI > Bal=E1zs > Sent: Monday, September 08, 2003 9:47 PM > To: dev...@li... > Subject: Re: [Dev-C++] @ symbol at the end of function names? > > > P.D. van Zelst wrote: > > The @ symbol in .def files has nothing to do with name mangling, stack > > > sizes, or whatever. They're ordinal numbers you can optionally give to > > > the functions you export from the DLL. Don't know the exact use of > > those though.... never had to look it up, I just always put them in > > there out of habit :) > > Are you sure? I thought it was stack size. Somehow, I think it is stack > size, as if a funcion takes 1 int, then the number is 4, if takes 2 > ints, then the number is 8, if 3 ints, it is 12. That looks like a > pattern for sure. > > -- > Greetings, > Bal=E1zs > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |