public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* How to get GCC to compile to binary, but in raw format NOT object
@ 2003-09-15 15:46 DAWE,STEVE (HP-UnitedKingdom,ex2)
  2003-09-15 15:54 ` John Love-Jensen
  0 siblings, 1 reply; 2+ messages in thread
From: DAWE,STEVE (HP-UnitedKingdom,ex2) @ 2003-09-15 15:46 UTC (permalink / raw)
  To: 'gcc-help@gcc.gnu.org'

Hi,

I want to be able to compile a C function to binary using GCC, but not in
object format (.o) with it's associated bagagge.  I'd rather a 'raw' binary
which contains just the code (and maybe some constants) that is compile.  I
do not want to use this file to link this code into an executable in order
to run it, I want to be able to store it in a file, load it into memory
dynamically and then execute it when it is needed, perhaps discarding it
when it is no longer needed.

Is there an option to do this?

Regards,

Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to get GCC to compile to binary, but in raw format NOT object
  2003-09-15 15:46 How to get GCC to compile to binary, but in raw format NOT object DAWE,STEVE (HP-UnitedKingdom,ex2)
@ 2003-09-15 15:54 ` John Love-Jensen
  0 siblings, 0 replies; 2+ messages in thread
From: John Love-Jensen @ 2003-09-15 15:54 UTC (permalink / raw)
  To: DAWE,STEVE (HP-UnitedKingdom,ex2), 'gcc-help@gcc.gnu.org'

Hi Steve,

You want a DSO (dynamic shared object).

Generate your code into a shared object (a .so in Unix-land, a .dll in
Windows-land, a .library in Amiga-land), and -- in Unix-land -- use dlopen
and the other dlxxxx functions when you want to access your routine
dynamically.  Windows and Amiga have equivalent mechanisms.

--Eljay

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-09-15 15:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-15 15:46 How to get GCC to compile to binary, but in raw format NOT object DAWE,STEVE (HP-UnitedKingdom,ex2)
2003-09-15 15:54 ` John Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).