This is the mail archive of the binutils@sources.redhat.com 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: LoadLibrary may fail if DLL is built with gcc -shared


Hi Fabrizio,

> Included are outputs of objdump -p : it seems that the only relevant
> difference is that, in the DLL created by dllwrap, exported symbols
> are in alphabetical order, while in the DLL created by gcc -shared,
> they are in numerical order. In fact, if the function "a" is renamed
> to "c", everything works.

Please could you try applying the attached (untested) patch,
rebuilding the linker and then seeing if it creates a DLL which works
for you.

Cheers
        Nick

Index: ld/pe-dll.c
===================================================================
RCS file: /cvs/src/src/ld/pe-dll.c,v
retrieving revision 1.56
diff -c -3 -p -w -r1.56 pe-dll.c
*** ld/pe-dll.c	2 Apr 2003 17:39:24 -0000	1.56
--- ld/pe-dll.c	25 Apr 2003 14:05:35 -0000
*************** pe_export_sort (va, vb)
*** 362,367 ****
--- 362,370 ----
    def_file_export *a = (def_file_export *) va;
    def_file_export *b = (def_file_export *) vb;
  
+   if ((a->ordinal != -1) && (b->ordinal != -1))
+     return a->ordinal < b->ordinal;
+ 
    return strcmp (a->name, b->name);  
  }
  


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