zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <zefram@dcs.warwick.ac.uk>
To: hzoli@VNET.IBM.COM (Zoltan T. Hidvegi)
Cc: zsh-workers@math.gatech.edu
Subject: Re: modules!??
Date: Thu, 5 Jun 1997 20:11:30 +0100 (BST)	[thread overview]
Message-ID: <13453.199706051911@stone.dcs.warwick.ac.uk> (raw)
In-Reply-To: <9706051824.AA14896@belgium.fishkill.ibm.com> from "Zoltan T. Hidvegi" at Jun 5, 97 02:24:55 pm

Zoltan T. Hidvegi wrote:
>Yes, I was thingking something like that.  I do not understand what you
>mean about several sizes of pointer.  Could you give some more detail?

The C standard permits most pointer types to have different
representations and sizes.  In particular, function pointers and data
pointers are not even required to be losslessly convertible.  So if we
were to make a symbol table store void *s, it might not be possible to
extract a working function pointer from it, and vice versa.  However, on
second thoughts, the dlsym() interface assumes that all pointers can
be converted to void * anyway, so I suppose it wouldn't be a problem to
assume that in our symbol tables too.

>The nm output format varies from system to system, so it's probably hard to
>make it portable.  And one should not have to have nm to compile zsh.  But
>if we can automatize everything on Linux I'd be happy.

There is one format for nm that is overwhelmingly common (BSD in origin,
perhaps?).  A script could detect whether the local nm conforms to this
convention, and if so will have the capability to generate these symbol
lists.  (As the GNU nm uses the popular format, I expect this will include
all of our usual development systems.)  In case there isn't an appropriate
nm around, we'd have to include the symbol lists in the distribution.

More thoughts...

We don't need to know the exact list of symbols imported by each module.
If we know which *modules* it references, all symbols in that module can
be turned into #defined symbol table references, and the module boot
code only needs to get its hands on those particular symbol tables (a
matter of looking throught the module table).  There is no overhead for
#defining a symbol that is not actually referenced.  Since the module
reference tree is small and doesn't often change, it can continue to be
maintained by hand.  We therefore only need to automatically generate
the *ex*ported symbol lists.

We already have a first approximation to the exported symbol lists in
the *.pro files.  If we extend these to include data objects (i.e.,
put data objects in their logical places and automatically generate
extern declarations -- globals.h disappears), the *.pro files would be
almost perfect symbol lists, without ever having to touch nm, or even
compile anything.  The icing on the cake would be for makepro.sh to pass
#ifdef lines through to the .pro file, to cope with symbols that only
exist conditionally.

(Oh yes, I really like the things you are making makepro.sh do in 3.1.2.
It's a much neater solution to the varying name problem than I had.)

I should have some time to play around with these ideas this week, having
just finished my exams.

-zefram


  reply	other threads:[~1997-06-05 19:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-05  1:35 modules!?? Wez Furlong
1997-06-05  5:45 ` modules!?? Zoltan Hidvegi
1997-06-05 17:33   ` modules!?? Zefram
1997-06-05 18:24     ` modules!?? Zoltan T. Hidvegi
1997-06-05 19:11       ` Zefram [this message]
1997-06-05 19:22         ` modules!?? Zoltan T. Hidvegi
1997-06-05 19:46         ` modules!?? Zoltan T. Hidvegi
1997-06-07 19:48         ` modules!?? Stefan Monnier
1997-06-08 11:49           ` modules!?? Zefram
1997-06-05 12:33 modules!?? Wez Furlong
1997-06-05 14:17 ` modules!?? Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13453.199706051911@stone.dcs.warwick.ac.uk \
    --to=zefram@dcs.warwick.ac.uk \
    --cc=hzoli@VNET.IBM.COM \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).