home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / misc / discuss / 4655 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  1.7 KB

  1. Path: sparky!uunet!stanford.edu!agate!forney.berkeley.edu!jbuck
  2. From: jbuck@forney.berkeley.edu (Joe Buck)
  3. Newsgroups: gnu.misc.discuss
  4. Subject: Re: Cygnus gcc and loadable modules Solaris 2.1
  5. Date: 26 Jan 1993 19:15:43 GMT
  6. Organization: U. C. Berkeley
  7. Lines: 30
  8. Message-ID: <1k42kv$nug@agate.berkeley.edu>
  9. References: <1843@pacvax.UUCP>
  10. NNTP-Posting-Host: forney.berkeley.edu
  11. Keywords: Cygnus gcc and loadable modules Solaris 2.1
  12.  
  13. In article <1843@pacvax.UUCP> fields@pacvax.UUCP (Daniel A. Fields) writes:
  14. >When I compile a pushable module with the SPARCcompiler I am able to
  15. >load the module with no problem.  Compile the thing with the Cygnus gcc
  16. >The kernel panics when it is trying to relocate the object.  Objects
  17. >produced from both compiler are "ELF 32-bit MSB relocatable SPARC
  18. >Version 1".  What the deal ?
  19.  
  20. Kind of an odd group to post this question to, but I'll take a shot
  21. at an answer anyway (gnu.gcc.help would have been better).
  22.  
  23. It's possible that the problem has to do with a disagreement between
  24. your code and the kernel as to how structs are passed; by default,
  25. gcc uses an incompatible method.  If this is the problem, you could
  26. try using -fpcc-struct-return.  From the GCC manual:
  27.  
  28. `-fpcc-struct-return'
  29.      Use the same convention for returning `struct' and `union' values
  30.      that is used by the usual C compiler on your system.  This
  31.      convention is less efficient for small structures, and on many
  32.      machines it fails to be reentrant; but it has the advantage of
  33.      allowing intercallability between GNU CC-compiled code and
  34.      PCC-compiled code
  35.  
  36. (Sun's compiler is not pcc-based, but the flag still has this name).
  37.  
  38.  
  39.  
  40.  
  41. --
  42. Joe Buck    jbuck@ohm.berkeley.edu
  43.