This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: ld and microsoft libraries
- To: ian at cygnus dot com
- Subject: Re: ld and microsoft libraries
- From: Larry Meadows <lfm at pgroup dot com>
- Date: Fri, 1 May 1998 10:06:41 -0700 (PDT)
- Cc: gnu-win32 at cygnus dot com
> I was not aware of that feature of comdat sections. I thought comdat
> sections mainly worked to eliminate duplicate sections, which the GNU
> linker does support. Does the MS linker really pull specific sections
> out of an object file based on symbol references? I don't see any
> reference to that in the PE documentation, although that doesn't mean
> it doesn't happen. That would imply that the MS linker can treat an
> object file like an archive.
That is exactly what happens. If you're familiar with VMS, a similar thing
went (goes?) on there. There's a magic switch to the compilers that puts
each function into its own text section (and, I suppose, data section
if that function has static data).
Any ideas on implementation?
Also, unfortunately, I can't send you the MS libraries. But I could send
you a .obj that shows the issues.
> The associative comdat seems fairly straightforward to implement.
> Make a second pass over the sections immediately after the pass using
> sec_already_linked, and for each associative section check whether the
> appropriate other section is being included. I don't see why you have
> to worry about symbols in this case.
You're right, symbols aren't important in this case. Only tricky part
would be determining if the other section had been included -- this
is done by section number in the .o file, which would have to be somehow
represented in the internal section.
I'll admit that I'm not terribly familiar nor comfortable with the BFD.
lfm
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".