Bug 698 - error linking dll on pe
Summary: error linking dll on pe
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.15
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-30 03:22 UTC by Peter Hanely
Modified: 2019-11-22 00:50 UTC (History)
2 users (show)

See Also:
Host: i386-linux-elf
Target: arm-*-pe
Build:
Last reconfirmed:


Attachments
sfresize.c (409 bytes, application/mac-compactpro)
2005-02-07 17:16 UTC, Peter Hanely
Details
Proposed patch (727 bytes, patch)
2005-02-08 09:37 UTC, Nick Clifton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Hanely 2005-01-30 03:22:07 UTC
arm-pe-gcc -o cqppc tq.o cmdfuncs.o sdlpixel.o SDLmain.lib SDL.lib SDL.dll
/usr/cross/arm-wince/lib/gcc/arm-pe/3.4.2/../../../../arm-pe/bin/ld: internal
error: aborting at /usr/cross/binutils-2.15.91-20040904-1/ld/pe-dll.c line 1765
in make_one
/usr/cross/arm-wince/lib/gcc/arm-pe/3.4.2/../../../../arm-pe/bin/ld: please
report this bug
collect2: ld returned 1 exit status

Does not crash, but experiences link errors, if SDL.dll is ommited
Comment 1 Nick Clifton 2005-02-02 10:43:50 UTC
Subject: Re:  New: error linking dll on pe

Hi cal,

> arm-pe-gcc -o cqppc tq.o cmdfuncs.o sdlpixel.o SDLmain.lib SDL.lib SDL.dll
> /usr/cross/arm-wince/lib/gcc/arm-pe/3.4.2/../../../../arm-pe/bin/ld: internal
> error: aborting at /usr/cross/binutils-2.15.91-20040904-1/ld/pe-dll.c line 1765
> in make_one
> /usr/cross/arm-wince/lib/gcc/arm-pe/3.4.2/../../../../arm-pe/bin/ld: please
> report this bug
> collect2: ld returned 1 exit status


Please could you provide a way for us to reproduce this bug.  Preferably 
as small and as simple as possible.

Cheers
   Nick


Comment 2 Peter Hanely 2005-02-02 16:08:52 UTC
Subject: Re:  error linking dll on pe

--Original Message--
From:  sourceware-bugzilla@sources.redhat.com
Sent:  2 Feb 2005 10:43:52 -0000
To:  cal@splitreflection.com
Subject:  [Bug ld/698] error linking dll on pe


> 
> ------- Additional Comments From nickc at redhat dot com  2005-02-02 10:43 -------
> Subject: Re:  New: error linking dll on pe
> 
> Hi cal,
> 
> > arm-pe-gcc -o cqppc tq.o cmdfuncs.o sdlpixel.o SDLmain.lib SDL.lib SDL.dll
> > /usr/cross/arm-wince/lib/gcc/arm-pe/3.4.2/../../../../arm-pe/bin/ld: internal
> > error: aborting at /usr/cross/binutils-2.15.91-20040904-1/ld/pe-dll.c line 1765
> > in make_one
> > /usr/cross/arm-wince/lib/gcc/arm-pe/3.4.2/../../../../arm-pe/bin/ld: please
> > report this bug
> > collect2: ld returned 1 exit status
> 
> 
> Please could you provide a way for us to reproduce this bug.  Preferably 
> as small and as simple as possible.
> 
> Cheers
>    Nick
> 
I've looked at the source code where the error message indicates, pe-dll.c function make_one, and it's clear that the code to support the arm processor with that function just isn't there.  So anything built for that processor linking against a dll should reproduce that error.  I'd code a fix myself except that it requires some very processor specific data.
> 
> 
> 
> -- 
> 
> 
> http://sources.redhat.com/bugzilla/show_bug.cgi?id=698
> 
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
> 
Comment 3 Peter Hanely 2005-02-07 17:16:43 UTC
Subject: Re:  error linking dll on pe

The SDL library build I'm using can be gotten through http://article.gmane.org/gmane.comp.lib.sdl/19943

Attatched is a throwaway program using SDL, to be linked against SDLmain.lib SDL.lib and SDL.dll


--Original Message--
From:  Nick Clifton <nickc@redhat.com>
Sent:  Mon, 07 Feb 2005 16:55:31 +0000
To:  sourceware-bugzilla@sources.redhat.com, cal@splitreflection.com
Subject:  Re: [Bug ld/698] error linking dll on pe


> Hi Cal,
> 
>    [Sourceware appears to be down at the moment, so I am sending this 
> directly to you].
> 
> 
> > I've looked at the source code where the error message indicates, pe-dll.c function make_one, and it's clear that the code to support the arm processor with that function just isn't there.  So anything built for that processor linking against a dll should reproduce that error.
> 
> Indeed - but with a small test case I can test a fix that will at least 
> remove the abort and replace it with a sensible error message.  (My 
> point being that I am not overly familiar with the ARM PE environment, 
> so it is going to be much easier for you to create a small testcase than 
> it is for me to guess how to built a DLL and then an suitable object 
> file and then try to link them together).
> 
> Cheers
>    Nick
> 
Comment 4 Peter Hanely 2005-02-07 17:16:44 UTC
Created attachment 398 [details]
sfresize.c
Comment 5 Nick Clifton 2005-02-07 17:26:46 UTC
Subject: Re:  error linking dll on pe

Hi Cal,

   [Sourceware appears to be down at the moment, so I am sending this 
directly to you].


> I've looked at the source code where the error message indicates, pe-dll.c function make_one, and it's clear that the code to support the arm processor with that function just isn't there.  So anything built for that processor linking against a dll should reproduce that error.

Indeed - but with a small test case I can test a fix that will at least 
remove the abort and replace it with a sensible error message.  (My 
point being that I am not overly familiar with the ARM PE environment, 
so it is going to be much easier for you to create a small testcase than 
it is for me to guess how to built a DLL and then an suitable object 
file and then try to link them together).

Cheers
   Nick
Comment 6 Nick Clifton 2005-02-08 09:36:13 UTC
Hi Peter,

  Thanks for supplying a test case.  Unfortunatley it does not compile as it
needs a header file SDL.h which was not supplied and it uses a function
SDL_LoadBMP which does not appear to be in the supplied libraries.  Instead I
used this source as my test example:

  extern void * SDL_LoadBMP_RW (const char *);
  void * src;
  int main (void) {src = SDL_LoadBMP_RW ("font1.bmp");}

With this I was able to reproduce the problem and I now have a patch which
changes the abort() into a more suitable error message.  Please try the attached
patch and let me know what you think.

Cheers
  Nick
Comment 7 Nick Clifton 2005-02-08 09:37:00 UTC
Created attachment 399 [details]
Proposed patch
Comment 8 Alan Modra 2019-11-22 00:50:48 UTC
By inspection of pe-dll.c it looks like this has been fixed.