bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/785] Bug in direct linkink to DLLs with ordinals


From: t_ono at hkfreak dot net
Subject: [Bug binutils/785] Bug in direct linkink to DLLs with ordinals
Date: 29 Jan 2006 03:00:01 -0000

------- Additional Comments From t_ono at hkfreak dot net  2006-01-29 03:00 
-------
The following patch remedies the problem 

--- ld/pe-dll.c.orig    Sat 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]