This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RE: dll create problem with gcc configured with arm-pe
- From: "longchuan" <longchuan at koretide dot com dot cn>
- To: "'Nick Clifton'" <nickc at redhat dot com>
- Cc: <binutils at sources dot redhat dot com>, "Craig A. Vanderborgh" <craigv at voxware dot com>
- Date: Tue, 1 Apr 2003 11:19:20 +0800
- Subject: RE: dll create problem with gcc configured with arm-pe
Hello Nick:
Many thanks.
I think that is what it should be, create dll with -shared, with
relocation information and
loaded at a suitable address at run-time.
I haven't test the new dll( the whole environment is not running yet),
but with objdump,
I compared this dll with the one mingw32 gcc generated, should be the
same.
If i have any problems about the patch, i will contact you ASAP.
regards,
wreckor
> -----Original Message-----
> From: binutils-owner at sources dot redhat dot com
> [mailto:binutils-owner at sources dot redhat dot com] On Behalf Of Nick Clifton
> Sent: Tuesday, April 01, 2003 00:05
> To: longchuan
> Cc: binutils at sources dot redhat dot com
> Subject: Re: dll create problem with gcc configured with arm-pe
>
>
> Hi Wreckor,
>
> > ld failed with message:
> > Cannot export TestFunc: symbol not defined
> > test.exp(.edata+0x40): undefined reference to `TestFunc'
>
> As you have already noted, the first thing you need to change
> is the exports in your test.def file, prefixing an underscore
> to TestFunc,
> ie:
>
> LIBRARY test.dll
> EXPORTS
> _TestFunc
>
> This takes care of the second error message.
>
> > I add a leading underscore to def file i.e from TestFunc to
> _TestFunc
> > in test.def and in ld option, i omit -shared option, this
> time i could
> > get the dll file but i don't think this one is what i
> expected. This
> > dll don't have relocation table.
>
> Well without the -shared option the relocations are
> discarded, so the linker is operating correctly. (This is
> because in a non-shared executable, all of the relocations
> should have been resolved, so there is no need for the
> relocation table).
>
> The real problem however is a bug in the linker. Try
> applying the patch below and then rerunning LD, but this
> time, include the -shared command line option.
>
> If this fixes your problem, please let me know so that the
> patch can be applied to the sources.
>
> Cheers
> Nick
>
> ld/ChangeLog
> 2003-03-31 Nick Clifton <nickc at redhat dot com>
>
> * pe-dll.c (pe_detail_list): The pe-arm target does use
> underscores.
>
> Index: ld/pe-dll.c
> ===================================================================
> RCS file: /cvs/src/src/ld/pe-dll.c,v
> retrieving revision 1.55
> diff -c -3 -p -w -r1.55 pe-dll.c
> *** ld/pe-dll.c 21 Feb 2003 10:51:24 -0000 1.55
> --- ld/pe-dll.c 31 Mar 2003 15:59:31 -0000
> *************** static pe_details_type pe_detail_list[]
> *** 199,205 ****
> 11 /* ARM_RVA32 */,
> PE_ARCH_arm,
> bfd_arch_arm,
> ! 0
> },
> {
> "epoc-pei-arm-little",
> --- 199,205 ----
> 11 /* ARM_RVA32 */,
> PE_ARCH_arm,
> bfd_arch_arm,
> ! 1
> },
> {
> "epoc-pei-arm-little",
>
>