Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | jt@toerring.de (Jens Thoms Toerring) |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Relocatable functions in C? |
| Date | 2015-08-15 22:09 +0000 |
| Organization | Freie Universitaet Berlin |
| Message-ID | <d39rl7Frd15U1@mid.uni-berlin.de> (permalink) |
| References | <2764e28b-d6e9-44d5-8ff4-b612a3d7e9a4@googlegroups.com> <88f5c11c-bbf6-4b38-8277-53b5a982a0cc@googlegroups.com> |
Rick C. Hodgin <rick.c.hodgin@gmail.com> wrote:
> For my needs on this, I have realized that I probably could use DLLs.
> I'm reticent though because there may be an issue as I'll likely have
> thousands of separate DLLs loaded at one time on large projects, and
> that may be a significant burden on the operating system. Perhaps
> not.
I don;t think there's anything that will tell you if your sus-
picions are for real but testing. Shouldn't be too much hassle
to create say 10000 small shared libraries (all the same, just
copies of one file but with different names) and trying to load
them all at once (one array for the DLL handles and one for the
function pointers). One thing that may put a wrench in the works
is if open libraries count into the number of files a program
may have open at the same time, though... But why would there
be "thousands" of DLLs - and even if there are, would they all
be loaded by your program at the same time?
> For now I think I'll stick with GCC and -fPIC creating one function
> at a time with all parameters passed in to access global variables,
> and callback functions, etc. This will allow me to load-from-then-close
> the library file which has the program content, and then I'm just
> dealing with malloc() and free() for live changes.
How do you actually "copy" the functions? First question is
how do you determine their sizes? And the second snag I'd be
worried about is that typically you can't execute stuff in
"normal" (data) memory - on many modern systems you neither
can modify code in memory nor "run" code in normal heap me-
mory as obtained by malloc() (for obvious security reasons,
see e.g. https://en.wikipedia.org/wiki/NX_bit).
> -----
> I'm having a dry spell today. I feel like an artist sitting in front
> of a canvas wanting to paint, but no inspiration is coming. :-)
> Happens to me sometimes. Other times I can't shut it off, and it
> causes me stress in my life due to lack of sleep and what have you.
[SNIPPED]
> Does anybody else experience this in creativity in design?
And your C question was?;-) (And, yes, I guess everyone has
these times where nothing seems to work and others where all
seems to be easy and it's hard to keep up with typing at the
speed new ideas pop up, and where one wakes up too early in
the morning, knowing exactly the line were one made a mistake
and how to fix it and all that kind of stuff. Wouldn't be fun
otherwise;-)
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-14 09:57 -0700
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-14 10:13 -0700
Re: Relocatable functions in C? Ken Brody <kenbrody@spamcop.net> - 2015-08-14 13:33 -0400
Re: Relocatable functions in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-14 19:51 +0200
Re: Relocatable functions in C? Robert Wessel <robertwessel2@yahoo.com> - 2015-08-14 16:12 -0500
Re: Relocatable functions in C? David Brown <david.brown@hesbynett.no> - 2015-08-15 16:17 +0200
Re: Relocatable functions in C? Bartc <bc@freeuk.com> - 2015-08-14 18:29 +0100
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-14 11:37 -0700
Re: Relocatable functions in C? Bartc <bc@freeuk.com> - 2015-08-14 19:43 +0100
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-14 11:46 -0700
Re: Relocatable functions in C? Bartc <bc@freeuk.com> - 2015-08-14 19:57 +0100
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-14 11:59 -0700
Re: Relocatable functions in C? jt@toerring.de (Jens Thoms Toerring) - 2015-08-14 20:27 +0000
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-14 12:01 -0700
Re: Relocatable functions in C? Waldek Hebisch <hebisch@antispam.uni.wroc.pl> - 2015-08-25 22:36 +0000
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-26 05:55 -0700
Re: Relocatable functions in C? fir <profesor.fir@gmail.com> - 2015-08-14 12:57 -0700
Re: Relocatable functions in C? fir <profesor.fir@gmail.com> - 2015-08-14 13:26 -0700
Re: Relocatable functions in C? fir <profesor.fir@gmail.com> - 2015-08-14 13:39 -0700
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-14 13:46 -0700
Re: Relocatable functions in C? fir <profesor.fir@gmail.com> - 2015-08-14 14:00 -0700
Re: Relocatable functions in C? fir <profesor.fir@gmail.com> - 2015-08-14 15:07 -0700
Re: Relocatable functions in C? fir <profesor.fir@gmail.com> - 2015-08-14 16:02 -0700
Re: Relocatable functions in C? Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-08-14 23:11 -0700
Re: Relocatable functions in C? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-15 10:31 +0100
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-15 11:56 -0700
Re: Relocatable functions in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-15 23:48 +0200
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-15 15:05 -0700
Re: Relocatable functions in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-16 00:12 +0200
Re: Relocatable functions in C? David Brown <david.brown@hesbynett.no> - 2015-08-16 16:09 +0200
Re: Relocatable functions in C? Ian Collins <ian-news@hotmail.com> - 2015-08-16 10:47 +1200
Re: Relocatable functions in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-16 01:09 +0200
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-15 15:07 -0700
Re: Relocatable functions in C? jt@toerring.de (Jens Thoms Toerring) - 2015-08-15 22:09 +0000
Re: Relocatable functions in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-16 00:21 +0200
Re: Relocatable functions in C? jt@toerring.de (Jens Thoms Toerring) - 2015-08-15 23:44 +0000
Re: Relocatable functions in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-16 02:25 +0200
Re: Relocatable functions in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-16 02:34 +0200
Re: Relocatable functions in C? jt@toerring.de (Jens Thoms Toerring) - 2015-08-16 01:11 +0000
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-15 15:26 -0700
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-15 15:36 -0700
Re: Relocatable functions in C? jt@toerring.de (Jens Thoms Toerring) - 2015-08-15 23:29 +0000
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-15 16:34 -0700
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-15 17:03 -0700
Re: Relocatable functions in C? jacobnavia <jacob@jacob.remcomp.fr> - 2015-08-16 02:32 +0200
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-15 18:25 -0700
Re: Relocatable functions in C? jt@toerring.de (Jens Thoms Toerring) - 2015-08-16 01:26 +0000
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-15 18:38 -0700
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-15 18:49 -0700
Re: Relocatable functions in C? Ian Collins <ian-news@hotmail.com> - 2015-08-16 14:04 +1200
Re: Relocatable functions in C? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-15 20:19 -0700
csiph-web