public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Tom Kacvinsky <tkacvins@gmail.com>
To: Binutils <binutils@sourceware.org>
Subject: Re: ld --base-file option, dlltool generated exp files
Date: Sun, 14 May 2023 14:44:50 -0400	[thread overview]
Message-ID: <CAG_eJLcTOBaR1WNOhWvCEL7uPsE7mJRPBff87=tFrJfSkCMZOw@mail.gmail.com> (raw)
In-Reply-To: <831c6d67-e502-1cb2-b68c-956c354c968b@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3088 bytes --]

Hi NIck,

On Wed, May 10, 2023 at 7:38 AM Nick Clifton <nickc@redhat.com> wrote:

> Hi Tom,
>
> > What I found through lots of experimentation is that either the base file
> > generated by ld or the exp file generated by dlltool is off and is
> making
> > a DLL that causes our applications to crash
>
> > The reason I say it's either the base file or the exp file is that I can
> > take my export definition file (a .def file) and generate an import
> library
> > and exp file using Microsoft's lib tool, and that exp file makes the
> final
> > link produce a DLL that does not have an issue.
>
> > I have a way around the problem without using a base file (just pass the
> > .def file directly to ld so that an export table is generated), but I
> > wanted to report this issue.
>
> Thank you for doing this.  It always helps when problems are reported, even
> if we do not have a solution available.
>
> Please could you file a bug report here:
>
>    https://sourceware.org/bugzilla/enter_bug.cgi?product=binutils
>
>
I haven't yet done so as I am fighting getting at least the major versions
of
binutils between which things broke.  I think that would help to have in the
bug report.

But it appears it is going to be more involved than I thought.  I thought I
was
going to get away with building all of our code with one binutils (using the
version of binutils I know works) and then just swapping versions of
binutils
used for making the DLL until I find the version that broke.  But that
process
ends up producing a DLL Windows does not like.  :-(. So, I have to build the
entire GCC + binutils toolchain, with the binutils version changing and GCC
remaining fixed.  This will take a while.

It also doesn't help that my MSYS2 + MinGW-w64 installation doesn't like
building 2.34 and 2.35 (before and  after those versions, things are
fine).  It
is a hang generating the files from pep.em and associated input files and
scripts.


>
> > What would be most useful for a reproducer?  I think I am going to have a
> > difficult time paring our code down to an MRE, and I'm reluctant to
> > release IP object code
>
> Understood.  A stand alone reproducer would be ideal, but if that is not
> possible then some further details on the problem would definitely help.
> For example - are you able to identify what is wrong the the DLLs being
> produced by the linker ?  Do any of the various PE-file checker programs
> that are out there report any problems ?
>

I have reason to believe the problem is with relocations based on the .base
and .exp files, but I don't know if a PE checking program can validate
relocation
information.  I'll have to look into this.


> Also - do you know if they problem happens with older versions of the
> binutils, eg 2.35 or 2.36 ?  Possibly the problem is due to a (relatively)
> recent change to the linker.
>

See above - I am trying to figure this out.


> I cannot make any guarantees, but I will definitely look at any bug reports
> you file.


Thanks,

Tom

  reply	other threads:[~2023-05-14 18:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03  0:51 Tom Kacvinsky
2023-05-10 11:38 ` Nick Clifton
2023-05-14 18:44   ` Tom Kacvinsky [this message]
2023-05-15 11:27     ` Tom Kacvinsky

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='CAG_eJLcTOBaR1WNOhWvCEL7uPsE7mJRPBff87=tFrJfSkCMZOw@mail.gmail.com' \
    --to=tkacvins@gmail.com \
    --cc=binutils@sourceware.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).