News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Which assembler for Win32 and Linux ?

Started by James Ladd, September 05, 2005, 10:35:04 PM

Previous topic - Next topic

arafel

Assemble to an ELF and link (ld) with '-shared' switch. Then you can call functions for a dynamicaly loaded library:

handle = dlopen("/mylib.so", RTLD_LAZY);
my_function_hndl = dlsym(handle, "my_function");
my_function_hndl();
dlclose(handle);


edit: also '-soname' ('-soname,mylib.so') switch should be used

James Ladd

arafel,

Thanks for this.
I thought it may be via a link option.

Do you know if there is anything special that has to be done in the module source code?
ie: In a normal "main" you have a "start:" , but is there an entry point in the module is
its going to be a shared library ?

Rgs, striker.

IAO

Hi to all....


I don't write well English. But:

Look here.
http://webster.cs.ucr.edu/AsmTools/WhichAsm.html

I think, one good elecctions is HLA.

By(t)e ('-')
"There is no way to peace. Peace is the way."    Mahatma Gandhi

James Ladd


arafel

striker,

I am not sure how this applies for writing shared libs in assembly, but only requirement for gcc compiled shared libs is to have position independent code (-fpic switch). Neither anything specific must be done regarding entry point when making shared lib in C, so I guess it's the same for nasm/fasm. Just exporting needed functions will do the trick.

arafel

here is a little nasm example

[attachment deleted by admin]

arafel


James Ladd

arafel,

Thanks for the link and the zip. Its very helpful of you.

rgs striker.