Subject: cross on SGI IRIX 6.2 now ok
From: [email-masked] ("Philippe GIACINTI")

24 Jul 1997 01:51:53 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: multipart/mixed;
	boundary="PART-BOUNDARY=.19707241002.ZM26535.kehl.dalim.de"
X-Face: ^cJc2\tiS@#Ja@7laz+N]T)kL{-Kay)Oz"?}p[wuY#}}dO"enP!QVO{,}&4P2V[hEfJD]9&
              E1ou~|tY/|9d&7c,7yf>7n: Zj8FD(LtPXWHzy^OJIDi/~O~R]3x/5}"7P;|,*%f:3Z!>h8Ff/&)g?/
              }$RXQ
X-Mailer: Z-Mail (3.2.3 08feb96 MediaMail)
Original-To: [email-masked]
Original-Sender: [email-masked]

--
--PART-BOUNDARY=.19707241002.ZM26535.kehl.dalim.de
Content-Type: text/plain; charset=us-ascii

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:  [email-masked]      |
| Daimler Strasse 2,                            tel:    +49.7851.9196-28   |
| D-77694 Kehl-Sundheim Germany                 fax:    +49.7851.73576	   |
|                                                                          |
 ==========================================================================

--PART-BOUNDARY=.19707241002.ZM26535.kehl.dalim.de
X-Zm-Content-Name: PatchSgiIrix62
Content-Description: Text
Content-Type: text/plain ; name="PatchSgiIrix62" ; charset=us-ascii

--- 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);
 	    }
 	}

--PART-BOUNDARY=.19707241002.ZM26535.kehl.dalim.de--

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".