Movatterモバイル変換
[0]ホーム
This is the mail archive of thebinutils@sources.redhat.commailing list for thebinutils project.
Re: LoadLibrary may fail if DLL is built with gcc -shared
- From: Nick Clifton <nickc at redhat dot com>
- To: fabrizio dot ge at tiscalinet dot it
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 02 Jun 2003 09:31:42 +0100
- Subject: Re: LoadLibrary may fail if DLL is built with gcc -shared
- References: <004901c32783$7dbad0a0$c1770b3e@io>
Hi Fabrizio,>> Please could you try applying the attached (untested) patch,> I tried it, but unfortunately the result is the same. However, I> wrote another patch. According to the few tests I've made, it seems> to work. It can be summarized as:>> pe-dll.c (fill_edata): scan table pe_dll->exports, which is sorted> alphabetically, instead of exported_symbols, which is sorted by ordinalThanks very much. I have applied your patch, together with anextended comment, to pe-dll.cCheers Nick2003-06-02 Fabrizio Gennari <fabrizio.ge@tiscalinet.it>* pe-dll.c (fill_edata): Scan table pe_dll->exports, which issorted alphabetically, instead of exported_symbols, which issorted by ordinal.Index: ld/pe-dll.c===================================================================RCS file: /cvs/src/src/ld/pe-dll.c,vretrieving revision 1.56diff -c -3 -p -r1.56 pe-dll.c*** ld/pe-dll.c2 Apr 2003 17:39:24 -00001.56--- ld/pe-dll.c2 Jun 2003 08:37:59 -0000*************** fill_edata (abfd, info)*** 959,965 **** bfd *abfd; struct bfd_link_info *info ATTRIBUTE_UNUSED; {! int i, hint; unsigned char *edirectory; unsigned long *eaddresses; unsigned long *enameptrs;--- 959,965 ---- bfd *abfd; struct bfd_link_info *info ATTRIBUTE_UNUSED; {! int s, hint; unsigned char *edirectory; unsigned long *eaddresses; unsigned long *enameptrs;*************** fill_edata (abfd, info)*** 1000,1012 **** fill_exported_offsets (abfd, info); ! /* Ok, now for the filling in part. */ hint = 0;! for (i = 0; i < export_table_size; i++) {! int s = exported_symbols[i];! ! if (s != -1) { struct sec *ssec = exported_symbol_sections[s]; unsigned long srva = (exported_symbol_offsets[s]--- 1000,1015 ---- fill_exported_offsets (abfd, info); ! /* Ok, now for the filling in part.! Scan alphabetically - ie the ordering in the exports[] table,! rather than by ordinal - the ordering in the exported_symbol[]! table. See dlltool.c and:!http://sources.redhat.com/ml/binutils/2003-04/msg00379.html! for more information. */ hint = 0;! for (s = 0; s < NE; s++) {! if (pe_def_file->exports[s].ordinal != -1) { struct sec *ssec = exported_symbol_sections[s]; unsigned long srva = (exported_symbol_offsets[s]
[8]ページ先頭