dll create problem with gcc configured with arm-pe

Nick Clifton nickc@redhat.com
Mon Mar 31 17:03:00 GMT 2003


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@redhat.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",




More information about the Binutils mailing list