flat assembler
Message board for the users of flat assembler.
Index
> Linux > How to create a shared object, and how to import simbol |
Author |
|
gunblade 27 May 2008, 19:22
Shared objects are quite simple.
First, you have to use Format ELF then exports are defined using: Code: public function_name where function_name is defined somewhere in the code as a regular label importing functions is done using: Code: extrn function_name where function_name is defined in the shared object you are going to link with. then you can fasm the code, to generate a .o ELF shared object file this can then be linked in with other objects using ld, example: Code: ld -o testbinary test1.o test2.o test3.o This should work fine if all dependancies are defined. (If you were talking about shared libraries (.so files), then im not sure how to do that, I think its just done using extrn, then you have to link using libtool instead of ld (or ld -shared), im not 100% sure, and i havent tried it. But you could look up linuxassembly.org or similar for a tutorial on it, even if its for nasm, its easy to convert) |
|||
27 May 2008, 19:22 |
|
jorge 28 May 2008, 20:56
There are any poibility to use the macrointruccion "proc" in this format and is posible to create this so only with FASM.
|
|||
28 May 2008, 20:56 |
|
jorge 28 May 2008, 20:56
There are any poibility to use the macrointruccion "proc" in this format and is posible to create this so only with FASM.
|
|||
28 May 2008, 20:56 |
|
gunblade 28 May 2008, 21:25
I believe proc should work fine if you include only the proc.inc file (not the full win32a.inc), you just have to make sure theres nothing windows-specific, but proc shouldnt be, its just extending the labels/ret.
As for purely only fasm, I dont think its possible, theres been several threads about it before in the board (if you want to search), but im pretty sure theres no way to link with fasm (and it indeed shouldnt, its an assembler, not a linker). Using ld isnt hard, and pretty much all linux distro's will have it, as its part of binutils. So only _very_ trimmed down distros not aimed at development may not have it. |
|||
28 May 2008, 21:25 |
|
LocoDelAssembly 15 Jun 2008, 18:20
Take a look into this: http://board.flatassembler.net/topic.php?t=4964
|
|||
15 Jun 2008, 18:20 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.