delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/07/24/01:51:53

From: giac AT dalim DOT de ("Philippe GIACINTI")
Subject: cross on SGI IRIX 6.2 now ok
24 Jul 1997 01:51:53 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <9707241002.ZM26535.cygnus.gnu-win32@pion.kehl.dalim.de>
Mime-Version: 1.0
X-Face: ^cJc2\tiS@#Ja AT 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: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

--
--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:  giac AT dalim DOT de      |
| 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
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019