This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: [Patch] Add --identify option to dlltool


Kai Tietz wrote:

> This issue is a bit constructed but possible. See attached library. It is 
> a combination of libkernel32.a and libntdll.a.

Hmm. So, in that example there are actually 2 members in the archive
which possess a .idata$7 section for which SECTION_HAS_CONTENTS is true.

That is kind of an odd case. As far as libtool is concerned, it's a
non-issue; a "link library" that directly references two different
runtime libraries is not a portable construct -- on *nix, the link
library is usually an unversioned name of a symbolic link to the
versioned runtime library:

   /usr/lib/libz.so -> libz.so.1.2.3

How could you implement *two* runtime libraries both directly referenced
by the same link library? You can't:

   /usr/lib/libfoo.so -> libfoo.so.0.1.2
                      -> libbar.so.1.2.3

except by forwarding, but that's a whole 'nother kettle of fish (and
looks more like indirect dependency than direct).

I guess there are two choices:

1) ignore it. Only return "the first" .idata$7 entry.

2) return all entries (one per line?). In this case, a client (such as
libtool) could detect a multi-line result and flag an error, or
otherwise handle that exceptional case.

The downside of 2) is that in the VAST majority of cases, there is only
one archive member that has the non-empty .idata$7 section -- and it is
first. So, --identify usually quits after parsing only the very first
archive member; it hunts only until it finds the (one, e.g. first, e.g
only) answer. Option (2) would require parsing *every* archive member
from beginning to end. That's a pretty severe pessimism to handle a case
that is rather pathological in nature.

--
Chuck


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