This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to get GCC to compile to binary, but in raw format NOT ob ject


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]