[Bug binutils/785] Bug in direct linkink to DLLs with ordinals
https://sourceware.org/bugzilla/show_bug.cgi?id=785 Alan Modra changed: What|Removed |Added Status|ASSIGNED|NEW Assignee|davek at gcc dot gnu.org |unassigned at sourceware dot org --- Comment #3 from Alan Modra --- Resetting assignee due to lack of action -- You are receiving this mail because: You are on the CC list for the bug.
[Bug binutils/785] Bug in direct linkink to DLLs with ordinals
https://sourceware.org/bugzilla/show_bug.cgi?id=785 Alan Modra changed: What|Removed |Added Severity|critical|normal -- You are receiving this mail because: You are on the CC list for the bug.
[Bug binutils/785] Bug in direct linkink to DLLs with ordinals
-- What|Removed |Added CC||dave dot korn dot cygwin at ||gmail dot com http://sourceware.org/bugzilla/show_bug.cgi?id=785 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/785] Bug in direct linkink to DLLs with ordinals
--- Additional Comments From t_ono at hkfreak dot net 2006-01-29 03:00 --- The following patch remedies the problem --- ld/pe-dll.c.origSat Aug 27 17:31:02 2005 +++ ld/pe-dll.c Tue Jan 17 00:20:32 2006 @@ -2460,6 +2460,14 @@ } static unsigned int +pe_as16 (void *ptr) +{ + unsigned char *b = ptr; + + return b[0] + (b[1] 8); +} + +static unsigned int pe_as32 (void *ptr) { unsigned char *b = ptr; @@ -2616,8 +2624,9 @@ /* Pointer to the names vector. */ unsigned long name_rva = pe_as32 (erva + name_rvas + i * 4); def_file_import *imp; + unsigned long ordinal = pe_as16 (erva + ordinals + i * 2); /* Pointer to the function address vector. */ - unsigned long func_rva = pe_as32 (erva + exp_funcbase + i * 4); + unsigned long func_rva = pe_as32 (erva + exp_funcbase + ordinal * 4); int is_data = 0; /* Skip unwanted symbols, which are -- http://sourceware.org/bugzilla/show_bug.cgi?id=785 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/785] Bug in direct linkink to DLLs with ordinals
--- Additional Comments From t_ono at hkfreak dot net 2006-01-29 02:52 --- Hmm, no comments so far. I will add a testcase. --testdll.c-- void func1() { printf(func1 called\n); } int data1; void func2() { printf(func2 called\n); } --testdll.def-- EXPORTS func1 func2 data1 @ 2 --test.c-- int main() { printf(calling func1\n); func1(); printf(calling func2\n); func2(); return 0; } -- After creating a dll with testdll.c and testdll.def and directly linking testdll.dll to test.c, the executable crashes. I will add a patch to remedy the problem. -- What|Removed |Added Severity|normal |critical http://sourceware.org/bugzilla/show_bug.cgi?id=785 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils