home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / linux / 8504 < prev    next >
Encoding:
Text File  |  1992-08-17  |  2.5 KB  |  60 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!ames!agate!boulder!kinglear!drew
  3. From: drew@kinglear.cs.colorado.edu (Drew Eckhardt)
  4. Subject: Re: shared libs - can everyone be happy with this?
  5. Message-ID: <1992Aug18.023010.6841@colorado.edu>
  6. Sender: news@colorado.edu (The Daily Planet)
  7. Nntp-Posting-Host: kinglear.cs.colorado.edu
  8. Organization: University of Colorado at Boulder
  9. References: <1992Aug17.065450.28834@colorado.edu> <d-dyhz_@rpi.edu> <1992Aug17.152210.23427@riacs.edu>
  10. Date: Tue, 18 Aug 1992 02:30:10 GMT
  11. Lines: 47
  12.  
  13. In article <1992Aug17.152210.23427@riacs.edu> laredo@cc.gatech.edu (Nathan I. Laredo) writes:
  14. >>|> Also, if we ever unbreak Linux, writing to code space should trigger
  15. >>|> a segmentation fault - it's like it is now because the estdio library 
  16. >>|> was broken, and wrote to the code. 
  17. >>    Does linux permit self modifying code (by design or bug)?
  18.  
  19. It doesn't trigger a segmentation fault if you write 
  20. to code - this is by design because allegedly the 
  21. estdio library (what we had before we got the BSD 
  22. stdio, then glibc) wrote to itS
  23.  
  24. >>    This seems like a pretty bad ``feature''.
  25.  
  26. Agreed. 
  27.  
  28. >
  29. >Hopefully we won't start another nasty chain here.. but someone correct
  30. >me if I'm wrong, but I've always been from the school that said that
  31. >all static variables went into the code space, otherwise how would
  32.  
  33. Wrong.  
  34.  
  35. "Static" variables are merely local to a object file, and not 
  36. accessable to the other object files at link time.  They're 
  37. put into either DATA (which should follow on the next page 
  38. boundary after Text with an OMAGIC file, is contiguous on 
  39. an NMAGIC file and you can't protect code on that), if initialized,
  40. or BSS if not, which follows data and is effectively the 
  41. same "segment"  (I shouldn't say segment because of the intel
  42. meaning  - what I mean is DATA & BSS are treated the 
  43. same, only DATA is initialized and BSS is zero filled).
  44.  
  45. Constants are generally allocated in the CODE segment (or text,
  46. although it's not an Intel segment, but rather a portion
  47. of the process's address space that starts at 0 and runs until DATA
  48. starts) - if you're 'C' compiler that assumes strings are 
  49. not writeable, and treats them as constant, you'll 
  50. run into problems with code that writes to constant strings.
  51. That could have been the problem with estdio, I don't know 
  52. for certain.
  53.  
  54.  
  55.  
  56. -- 
  57. Microsoft is responsible for propogating the evils it calls DOS and Windows, 
  58. IBM for AIX (appropriately called Aches by those having to administer it), but neither is as bad as AT&T.  Boycott AT&T, and let them know how you feel. 
  59.  
  60.