flat assembler
Message board for the users of flat assembler.

Index > Linux > How to link libdl without using gcc (or ld)

Author
Thread Post new topic Reply to topic
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware
Hi all -

In my application, I want to be able to dynamically link in .so libraries. But I do not want the overhead (and dependancies) of using gcc/ld. My app is purely FASM.

So my question is, is there some way to insert the required information in the ELF file so that the OS loader maps libdl into my process space without me being required to us ld etc.?

There does not appear to be a Linux syscall for dlopen()... otherwise I would simply do that.

Thanks for your help!
Ron
(the project is Reva: http://ronware.org/reva.html )
Post 20 Feb 2005, 19:42
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
fasm9



Joined: 19 Jun 2003
Posts: 439
fasm9
in total 49 projects,
http://freshmeat.net/search/?q=elf&section=projects&Go.x=0&Go.y=0

tinlink, libelf, ELFIO, libmiASMaELF, The ELF shell, Assembly Language Debugger, elfcmp, The Linux Virus Writing HOWTO.
Post 21 Feb 2005, 01:54
View user's profile Send private message Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware
Well, it's possible if you manually create the ELF header and link in the correct stuff. See the http://www.muppetlabs.com/~breadbox/software/elfkickers.html ELF-kickers, particularly the 'factor' program which shows how to do what I want.

Privalov, is it possible to get support in FASM/Linux for this, just like in Windows?

For example, allowing an 'import' macro which imports specific functions. This would be much cleaner (from the enduser standpoint) than manually coding an ELF header!

Thanks!
Post 23 Feb 2005, 17:09
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
fasm9



Joined: 19 Jun 2003
Posts: 439
fasm9
http://planet.classpath.org/
Tom Tromey — Libc oops, thanks to him, gcj hacker.

Quote:
The dlmopen() function is identical to the dlopen() routine,
except that an identifying link-map id (lmid) is passed into
it. This link-map id informs the dynamic linking facilities
upon which link-map list to load the object. See Linker and
Libraries Guide


dlmopen()

--
maybe this? hope this help.

PS: man prelink
ftp://people.redhat.com/jakub/prelink/prelink-20041123.tar.bz2
Post 24 Feb 2005, 06:33
View user's profile Send private message 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.