flat assembler
Message board for the users of flat assembler.
Index
> Linux > Making shared library warning! |
Author |
|
james 09 Sep 2005, 22:36
This is a stab in the dark but do you assemble to an ELF and link (ld) with '-shared' switch ?
btw - do you have an example of a simple module that compiles to an SO ? Im wondering is the module has an entry point like "start:" |
|||
09 Sep 2005, 22:36 |
|
Hordi 06 Oct 2005, 09:15
format ELF
public gost public gost32 section '.text' executable gost: _gost: iloop: mov ebp,eax add eax,[esi] add esi,4 repeat 3 xlatb ror eax,8 add ebx,100h end repeat xlatb sub ebx,300h rol eax,3 xor eax,edx mov edx,ebp loop iloop ret gost32: _gost32: push esi push ebx push ebp mov ebx,[esp+16] push ebx mov eax,[ebx] mov edx,[ebx+4] mov esi,[esp+24] mov ebx,[esp+28] mov ecx,[esp+32] push ecx call gost pop ecx cmp ecx,32 je .exit xchg eax,edx .exit: pop ebx mov [ebx],edx mov [ebx+4],eax pop ebp pop ebx pop esi ret |
|||
06 Oct 2005, 09:15 |
|
Remy Vincent 04 Nov 2005, 03:27
I heard that gcc could compile assembler code, can somone say if a gcc command could compile the fasm code above???
gcc ???-ASM??? myprog.asm _________________ Groups lower your IQ |
|||
04 Nov 2005, 03:27 |
|
vid 04 Nov 2005, 08:52
for sure gcc cannot compile FASM code. maybe it can compile some ugly AT&T-syntax code, but i doubt it, there is gas for that.
|
|||
04 Nov 2005, 08:52 |
|
BXM 04 Nov 2005, 13:09
Yes the intel syntax is not exactly like the At&T syntax.
You'd have to invert all operands since AT&T uses: mnemonic source, dest and FASM uses: mnemonic dest, source You'd have to prefix all register names with a % For example eax would become %eax Same for constant/immadiate values: prefixed with $ etc... |
|||
04 Nov 2005, 13:09 |
|
BXM 06 Nov 2005, 09:50
Did you try without -fPIC
|
|||
06 Nov 2005, 09:50 |
|
rob.rice 06 Nov 2005, 20:52
the nasm documention has something about getgot
and the need for the shared objects to get the address of where thay are loaded and this has to be set I think into the local discrpter table so the addresses in the code can be found |
|||
06 Nov 2005, 20:52 |
|
Hordi 29 Nov 2005, 16:35
BXM wrote: Did you try without -fPIC Yes... Same result |
|||
29 Nov 2005, 16:35 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.