Re: I'm a stupid blond :( Please help me!!!

From: Gary Labowitz (glabowitz_at_comcast.net)
Date: 12/06/03


Date: Fri, 5 Dec 2003 21:58:21 -0500


"Peter van Merkerk" <merkerk@deadspam.com> wrote in message
news:bqr0dh$266g7e$1@ID-133164.news.uni-berlin.de...
>
> "Gary Labowitz" <glabowitz@comcast.net> wrote in message
> news:t7udnYO_Z9kXJk2i4p2dnA@comcast.com...
> > "Karl Heinz Buchegger" <kbuchegg@gascad.at> wrote in message
> > news:3FD05564.8300D296@gascad.at...
> > > Peter van Merkerk wrote:
> >
> > > Also note that with the existence of virtual functions it got much
> harder
> > > for the linker to figure out if a function is referenced or not.
> >
> > I'm not sure of this. It wouldn't make sense for a function name that
> occurs
> > in a program to be left out of the external references table. Unless
> linkers
> > have changed a lot since I worked on them each function call that is
> > unresolved results in an address for that function of zero and a flag
(in
> a
> > table of some sort) indicating that it is an unresolved external
> reference.
> > The linker's job is to search the libraries it has available and link in
> the
> > object file that contains the code for that referenced function. If the
> > object code of that referenced function also contains code for some
other
> > number of functions, all that code is linked in whether it is referenced
> or
> > not. This is what causes bloat.
>
> That doesn't happen with all linkers
<<snip>>

Other comments of yours mentions OS differences, and yes, I can believe
that. I draw on my experience with IBM mainframe work for most of this OS
design, and what little I know of the various Intel processors and their
instruction sets. I didn't mean to introduce a deep discussion of various
memory mapping methods.

> There is a way out; use a better linker. If you are interested I can mail
> you a MSVC6 project that demonstrates that an object file is only
partially
> linked in when only a few functions in that object file are referenced.

No need, I have all that stuff. But if you want to tell me a library module
that contains several functions and a short code snippet that uses only one
of them that causes only that function to be linked in, I'd like to know it
and try it. I am very interested in exploring this and that information
would speed up my exploration. Do you know of any gnu linkers that work this
optimized way? Thanks. (Or if you think a project would be the best way, I'm
open to that also. I haven't researched yet for a W2K function that would
extract function code from a .obj file or a .dll, but I'm interested to find
it if it's there.)

-- 
Gary


Relevant Pages

  • Re: Im a stupid blond :( Please help me!!!
    ... > in a program to be left out of the external references table. ... Well for one the linker that comes with Microsoft Visual Studio 6 (not ... It's the loader's job to adjust ... > get the entire object file that contains that function linked in. ...
    (comp.lang.cpp)
  • Re: static variables discarded by the VS.NET2003 linker
    ... an object file containing definitions of global variables of any type/ ... I simply added artificial references to the code, ... because both have back references and the linker would thus try to include ...
    (microsoft.public.vc.language)
  • Re: Standards compliance
    ... > to which there is no subsquent references to x anywhere within the ... > translation unit, I receive a warning stating that there are no ... The correct solution is to embed the version string in a special section ... of the object file, instead of hiding it in a data section. ...
    (comp.lang.c)
  • Re: Error booting Suse 9.2
    ... mjt wrote: ... > Re: Error booting Suse 9.2 ... > References: 1 ... >> However the object file certainly exists. ...
    (alt.os.linux.suse)
  • Re: Am I the ONLY person that didnt know this?
    ... actually remove a method entirely would affect VMT layout. ... while fixing up references, when references to a indices exist. ... possibly together with an offset. ... newer linkers have special features for reductions ...
    (comp.lang.pascal.delphi.misc)