This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


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

cross on SGI IRIX 6.2 now ok


Hi,

I have found the problem with generation of dll on SGI IRIX 6.2.
The problem was located in generation of base file in ld, and not in dlltool
...
In bfd/cofflink.c we have this kind of code:

	bfd_vma addr = ...
	...
	fwrite (&addr, 1,4, (FILE *) info->base_file);

the problem is that on SGI a bfd_vma is a "long long" (size 64 bits), so only
the 4 first bytes (which are always 0) are written.

For fixing this bug we only have to cast addr in a 32 bits value. My problem is
that the type "uint32" doesn't exist anymore, so I used a cast to "long",
hoping that the size of "long" is always 32 bits (???????).
May be can somebody find a cleaner solution, in this case send me a mail.

You can find, attached to this mail, the corresponding diff file.

Best regards.


-- 

 ==========================================================================
|                         Philippe GIACINTI                                |
|                                                                          |
| DALiM GmbH R&D                                email:  giac@dalim.de      |
| Daimler Strasse 2,                            tel:    +49.7851.9196-28   |
| D-77694 Kehl-Sundheim Germany                 fax:    +49.7851.73576	   |
|                                                                          |
 ==========================================================================
--- bfd/cofflink.c~	Tue Apr 15 10:21:58 1997
+++ bfd/cofflink.c	Thu Jul 24 09:32:47 1997
@@ -2499,6 +2499,7 @@
 	      /* relocation to a symbol in a section which
 		 isn't absolute - we output the address here 
 		 to a file */
+	      long addr32;
 	      bfd_vma addr = rel->r_vaddr 
 		- input_section->vma 
 		+ input_section->output_offset 
@@ -2506,7 +2507,9 @@
 	      if (coff_data(output_bfd)->pe)
 		addr -= pe_data(output_bfd)->pe_opthdr.ImageBase;
 	      /* FIXME: Shouldn't 4 be sizeof (addr)?  */
-	      fwrite (&addr, 1,4, (FILE *) info->base_file);
+	      /* FIXME: always cast addr to long (hope long size is 32 bits) */
+	      addr32 = (long)addr;
+	      fwrite (&addr32, 1,4, (FILE *) info->base_file);
 	    }
 	}
   

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