This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to get GCC to compile to binary, but in raw format NOT ob ject
- From: Ian Lance Taylor <ian at airs dot com>
- To: "DAWE,STEVE \(HP-UnitedKingdom,ex2\)" <steve dot dawe at hp dot com>
- Cc: 'John Love-Jensen' <eljay at adobe dot com>, "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: 15 Sep 2003 09:56:14 -0700
- Subject: Re: How to get GCC to compile to binary, but in raw format NOT ob ject
- References: <0B9A57FF1D57D411B47500D0B73E5CC10B47363D@dickens.bri.hp.com>
"DAWE,STEVE \(HP-UnitedKingdom,ex2\)" <steve.dawe@hp.com> writes:
> Thanks for your help, but what I need goes beyond even a DSO, I want to be
> able to compile, link execute a C program, later on compile a C function to
> binary, load this into memory using a malloc/fread combination into the
> original program and then execute it from there. With a DSO, you need to
> know the function name, parameters etc in advance, so you link a stub which
> then call the DSO code itself.
Look at dlopen/dlsym.
If you don't even know the name of the function you want to call, then
you need something quite a bit more clever, at least if you want the
function you load to be able to call library functions which have
already been loaded.
Ian