flat assembler
Message board for the users of flat assembler.

Index > Linux > Making shared library warning!

Author
Thread Post new topic Reply to topic
Hordi



Joined: 25 Jun 2005
Posts: 3
Location: Ukraine, Kiev
Hordi 25 Jun 2005, 08:53
I'm make the shared library with asm-object files and get the warning:

gcc -shared -fPIC -o libgost.so gostcrypt.o gamma.o gammale.o gost.o imito.o mktbl.o
/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object.



With greating static library all ok. Where problem?
Post 25 Jun 2005, 08:53
View user's profile Send private message ICQ Number Reply with quote
james



Joined: 07 Sep 2005
Posts: 45
Location: Australia
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:"
Post 09 Sep 2005, 22:36
View user's profile Send private message MSN Messenger Reply with quote
Hordi



Joined: 25 Jun 2005
Posts: 3
Location: Ukraine, Kiev
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
Post 06 Oct 2005, 09:15
View user's profile Send private message ICQ Number Reply with quote
Remy Vincent



Joined: 16 Sep 2005
Posts: 155
Location: France
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
Embarassed Embarassed Embarassed

_________________
Groups lower your IQ
Post 04 Nov 2005, 03:27
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
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.
Post 04 Nov 2005, 08:52
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
BXM



Joined: 03 Nov 2005
Posts: 26
Location: mars
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...
Post 04 Nov 2005, 13:09
View user's profile Send private message Reply with quote
BXM



Joined: 03 Nov 2005
Posts: 26
Location: mars
BXM 06 Nov 2005, 09:50
Did you try without -fPIC
Post 06 Nov 2005, 09:50
View user's profile Send private message Reply with quote
rob.rice



Joined: 20 Dec 2003
Posts: 54
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
Post 06 Nov 2005, 20:52
View user's profile Send private message Reply with quote
Hordi



Joined: 25 Jun 2005
Posts: 3
Location: Ukraine, Kiev
Hordi 29 Nov 2005, 16:35
BXM wrote:
Did you try without -fPIC

Yes... Same result Sad
Post 29 Nov 2005, 16:35
View user's profile Send private message ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.