This is the mail archive of the binutils@sourceware.cygnus.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]

[khan@NanoTech.Wisc.EDU: pe-dll and reloc link question (+ possible patch)]



Forwarded by request.

------- Start of forwarded message -------
To: dj@delorie.com
Subject: pe-dll and reloc link question (+ possible patch)
Date: Sat, 22 Jan 2000 19:24:33 -0600
From: Mumit Khan <khan@NanoTech.Wisc.EDU>

Hi DJ,

Someone just reported a bug in my latest snapshot that causes relocatable
link to fail with the following error message: 

  Unsupported PEI architecture: pe-i386

This happens in pe_process_import_defs called by after_open, which is
probably not correct for relocatable linking. The target for the output
bfd at this point is pe-i386, not pei-i386 and linking fails in
pe_dll_id_target(). 

Is the following patch correct?

2000-01-22  Mumit Khan  <khan@xraylith.wisc.edu>

	* emultempl/pe.em (gld_${EMULATION_NAME}_after_open): Handle 
	relocatable linking.

Index: emultempl/pe.em
===================================================================
RCS file: /homes/khan/src/CVSROOT/binutils-19990818/ld/emultempl/pe.em,v
retrieving revision 1.3
diff -u -3 -p -r1.3 pe.em
- --- pe.em	2000/01/10 22:48:14	1.3
+++ pe.em	2000/01/23 00:26:17
@@ -705,10 +705,14 @@ gld_${EMULATION_NAME}_after_open ()
   pe_data (output_bfd)->dll = init[DLLOFF].value;
 
 #ifdef DLL_SUPPORT
- -  if (pe_enable_stdcall_fixup) /* -1=warn or 1=disable */
- -    pe_fixup_stdcalls ();
+  if (! link_info.relocateable)
+    {
+    if (pe_enable_stdcall_fixup) /* -1=warn or 1=disable */
+      pe_fixup_stdcalls ();
 
- -  pe_process_import_defs(output_bfd, &link_info);
+    pe_process_import_defs(output_bfd, &link_info);
+  }
+
   if (link_info.shared)
     pe_dll_build_sections (output_bfd, &link_info);
 #endif


Regards,
Mumit
------- End of forwarded message -------

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