home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / linux / 22001 < prev    next >
Encoding:
Text File  |  1992-12-29  |  1.2 KB  |  30 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!sdd.hp.com!network.ucsd.edu!munnari.oz.au!bruce.cs.monash.edu.au!monu6!yoyo.cc.monash.edu.au!parry
  3. From: parry@yoyo.cc.monash.edu.au (Tom J Parry)
  4. Subject: Re: why is it with kernel 0.99 that -fwritable-strings is required
  5. Message-ID: <1992Dec29.085026.14621@monu6.cc.monash.edu.au>
  6. Originator: parry@yoyo.cc.monash.edu.au
  7. Sender: news@monu6.cc.monash.edu.au (Usenet system)
  8. Organization: Monash University, Melb., Australia.
  9. References: <Bzzv0w.F9@rshark.mixcom.com>
  10. Date: Tue, 29 Dec 1992 08:50:26 GMT
  11. Lines: 17
  12.  
  13. Brian Kapitan (root@rshark.mixcom.com) wrote:
  14. >why is it now, that the gcc option -fwritable-strings is required to
  15. >correctly make certain programs, when in the past it wasn't true?
  16.  
  17. The ANSI standard says that "C" strings are of type "const char[]". Thus
  18. your shouldn't be able to write to them. The gcc compiler puts strings
  19. in a read only part of the text... thus there is only ever one copy of
  20. them in memory at any time.
  21.  
  22. >what was changed in the kernel to cause this?
  23.  
  24. The kernel now enforces non-writable program texts. Thus you get a seg
  25. fault when you try to write into your text.
  26.  
  27. -- 
  28. Tom J Parry.
  29. Your reality is a figment of my imagination.
  30.