9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] mmap and shared libraries
Date: Wed,  5 Nov 2008 20:26:42 -0500	[thread overview]
Message-ID: <fb909ef77064c089183135b0e42e0669@quanstro.net> (raw)
In-Reply-To: <BEC7E0CE49C4FFC1E59BFC49@[192.168.1.2]>

> File size can be less than memory size when you have data reserved but not
> initialized. That happens in many cases, e.g. when you reserve a buffer.

>> One benefit to declaring data in the bss section is that the data is not
>> included in the executable program. When data is defined in the data
>> section, it must be included in the executable program, since it must be
>> initialized with a specific value. Because the data areas declared in the
>> bss section are not initialized with program data, the memory areas are
>> reserved at runtime, and do not have to be included in the final program.

i don't think uninitialized means what you think it does.  for the
benefit of those who might be confused by this largely purposeful
misdirection, the bss is initialized to zero.  the c standard
specifies that external declarations without explicit initialization
are initialized to zero.  this is intialized data that doesn't appear
in the executable.

because i'm pedantic, i'll point out that zero has always been a
specific value.

- erik




  reply	other threads:[~2008-11-06  1:26 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-06  0:17 Eris Discordia
2008-11-06  1:26 ` erik quanstrom [this message]
     [not found] <88F7FC88EA146B5826CA4895@192.168.1.2>
2008-11-06  8:45 ` Bruce Ellis
  -- strict thread matches above, loose matches on Subject: below --
2008-11-06  7:34 Eris Discordia
     [not found] <C9A2E584874CDAD0B23E1ABF@192.168.1.2>
2008-11-06  1:25 ` ron minnich
2008-11-06  1:20   ` erik quanstrom
2008-11-06  7:20   ` Skip Tavakkolian
2008-11-06  0:45 Eris Discordia
2008-11-06  5:32 ` Wes Kussmaul
     [not found] <B9EFF9908B07EE7F3D52A6FE@192.168.1.2>
2008-11-05 21:09 ` andrey mirtchovski
2008-11-05 21:58   ` Eris Discordia
2008-11-05 21:12 ` Rob Pike
2008-11-05 22:02   ` Eris Discordia
2008-11-05 22:44     ` Skip Tavakkolian
2008-11-05 22:50     ` john
2008-11-05 22:13 ` ron minnich
2008-11-06  0:48   ` Eris Discordia
2008-11-06  0:53   ` Eris Discordia
     [not found]   ` <F57A01C450F2AF0D885A4EA2@192.168.1.2>
2008-11-06  1:17     ` andrey mirtchovski
2008-11-06  1:23       ` Rob Pike
2008-11-06  7:11         ` Eris Discordia
     [not found]   ` <4E85CF437A5996E22A154410@192.168.1.2>
2008-11-06  4:01     ` Noah Evans
2008-11-08  2:07       ` Lyndon Nerenberg
2008-11-08 15:21         ` Eris Discordia
     [not found]         ` <08704C38FEA587112964C8F7@192.168.1.2>
2008-11-08 21:37           ` Noah Evans
2008-11-08 22:12             ` Bruce Ellis
2008-11-09 14:53               ` Eris Discordia
     [not found]               ` <44E0B0824F0CA75923FADB8F@192.168.1.2>
2008-11-09 15:52                 ` Bruce Ellis
2008-11-09 21:16                 ` Noah Evans
2008-11-09 22:07                   ` Bruce Ellis
2008-11-09 22:37                     ` Dan Cross
2008-11-09 22:57                       ` Bruce Ellis
2008-11-06  4:03   ` Roman Shaposhnik
2008-11-05 20:54 Eris Discordia
     [not found] <98D93FD5E6510345BB763E1E@192.168.1.2>
2008-11-05 18:15 ` ron minnich
2008-11-05 18:55   ` David Leimbach
2008-11-05 19:28     ` Rob Pike
2008-11-05 10:57 Eris Discordia
2008-11-05 16:34 ` Abhishek Kulkarni
2008-11-05 17:19   ` roger peppe
     [not found] <0BA37138CD8655143F1F7260@192.168.1.2>
2008-11-04 15:59 ` ron minnich
2008-11-05  8:26   ` Bruce Ellis
2008-11-05  8:32     ` Lyndon Nerenberg
2008-11-05  8:38       ` Bruce Ellis
2008-11-05  8:43         ` Lyndon Nerenberg
2008-11-05 10:33   ` Eris Discordia
     [not found]   ` <4EA3104D894655DB38E5DC15@192.168.1.2>
2008-11-05 10:55     ` Robert Raschke
2008-11-05 11:02       ` Eris Discordia
2008-11-04 15:06 Eris Discordia
2008-11-03  6:27 [9fans] mmap Charles Forsyth
2008-11-03 13:16 ` [9fans] mmap and shared libraries dave.l
2008-11-03 15:55   ` Kernel Panic
2008-11-04  1:23   ` Lyndon Nerenberg
2008-11-04  3:46   ` michael block
2008-11-05  5:17   ` Roman Shaposhnik
2008-11-05  5:21     ` ron minnich
2008-11-05  5:25       ` Lyndon Nerenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb909ef77064c089183135b0e42e0669@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).