9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] mmap and shared libraries
@ 2008-11-04 15:06 Eris Discordia
  0 siblings, 0 replies; 59+ messages in thread
From: Eris Discordia @ 2008-11-04 15:06 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> I can run Plan 9 quite nicely in 128 MB of RAM. In the same amount of
> memory FreeBSD is paging nightmare, despite it's wonderfully complex
> shared library environment.

You're wrong. Case in point: my FreeBSD 6.2-RELEASE installation on a 233
MHz PII (one of those Slot 1 processors) with 128 MB of RAM runs just fine
and serves well the purpose of 24x7 downloading and serving FTP; home
scale, of course. Attempts to live boot Plan 9 on the same machine fail
because some 9wacko believes CD-ROM drives must be secondary master or
something--and I won't move a jumper to suit a 9wacko's whim; not that I've
ever been asked to do that.

--On Monday, November 03, 2008 5:23 PM -0800 Lyndon Nerenberg
<lyndon@orthanc.ca> wrote:

>> A thought ...
>>
>> Shared libraries do 2 possibly useful things:
>> 1) save space
>> 2) stop you having to re-link when a new library is released.
>>
>> Now 2) doesn't really happen anyway, due to .so versioning hell,
>> so we're left with 1) ...
>
> I can run Plan 9 quite nicely in 128 MB of RAM. In the same amount of
> memory FreeBSD is paging nightmare, despite it's wonderfully complex
> shared library environment. Oh, and Solaris won't even boot with less 512
> MB these days.
>
> There is no space shortage on Plan 9 that's looking for a solution.
>



^ permalink raw reply	[flat|nested] 59+ messages in thread
[parent not found: <0BA37138CD8655143F1F7260@192.168.1.2>]
* Re: [9fans] mmap and shared libraries
@ 2008-11-05 10:57 Eris Discordia
  2008-11-05 16:34 ` Abhishek Kulkarni
  0 siblings, 1 reply; 59+ messages in thread
From: Eris Discordia @ 2008-11-05 10:57 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[root@host ~/clms]# ls -l `which vim`
-rwxr-xr-x  1 root  wheel  1221212 Oct 15  2006 /usr/local/bin/vim

--------------------------------------------------------------------------------

C:\Program Files (x86)\Vim\vim71>dir gvim.exe
 Volume in drive C has no label.
 Volume Serial Number is B001-B4A3

 Directory of C:\Program Files (x86)\Vim\vim71

05/12/2007  12:19 PM         1,585,152 gvim.exe
               1 File(s)      1,585,152 bytes
               0 Dir(s)   5,075,197,952 bytes free

C:\Program Files (x86)\Vim\vim71>dir vim.exe
 Volume in drive C has no label.
 Volume Serial Number is B001-B4A3

 Directory of C:\Program Files (x86)\Vim\vim71

05/12/2007  12:14 PM         1,372,160 vim.exe
               1 File(s)      1,372,160 bytes
               0 Dir(s)   5,075,197,952 bytes free

C:\Program Files (x86)\Vim\vim71>

--------------------------------------------------------------------------------

So what? (and the two latter were _Windows_ binaries).

> I realize that is utterly unfair. Sort of.

Nice of you to realize that. Sort of.

--On Tuesday, November 04, 2008 9:21 PM -0800 ron minnich
<rminnich@gmail.com> wrote:

> On Tue, Nov 4, 2008 at 9:17 PM, Roman Shaposhnik <rvs@sun.com> wrote:
>
>> A standalone statically linked binary is going to be considerable larger
>> while
>> in flight over data links.
>>
>
> ah yes well maybe.
>
> rminnich@login3.surveyor:~/mtelnet> ls -l `which emacs`
> -rwxr-xr-t 1 root root 4587528 2006-06-17 06:59 /usr/bin/emacs
> rminnich@login3.surveyor:~/mtelnet> ls -l `which acme`
> -rwxr-xr-x 1 rminnich users 1361257 2008-11-04 12:39
> /home/rminnich/plan9/bin/acme
> rminnich@login3.surveyor:~/mtelnet>
>
> I realize that is utterly unfair. Sort of.
>
>
>
> ron
>







^ permalink raw reply	[flat|nested] 59+ messages in thread
[parent not found: <98D93FD5E6510345BB763E1E@192.168.1.2>]
* Re: [9fans] mmap and shared libraries
@ 2008-11-05 20:54 Eris Discordia
  0 siblings, 0 replies; 59+ messages in thread
From: Eris Discordia @ 2008-11-05 20:54 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> yes, I agree, I was being terribly unfair to plan 9. Acme on plan 9 is
> about 1/2 M. Vim on DOS is 3x larger? impressive.

My intent was, of course, to show your comparison is baseless. It seems you
still haven't realized that. You think Plan 9 is great? Sure you know a lot
more about it than I do so I think you are entitled to your opinion, but
drawing a baseless analogy and ridiculing other OS's--as is common on this
mailing list--won't help your cause.

I didn't post a listing for a DOS executable. Vim running under cmd.exe
(vim.exe) is a normal 32-bit Windows process, only with output to Windows
"console." The little DOS in every popular Windows ceased to exist like 8
years ago.

The GUI version of Vim on Windows (gvim.exe) compresses to 734,713 bytes
because the bigger part of the uncompressed 1,585,152 bytes is redundant
filler required by the binary format specification. The same happens for
the vim executable on FreeBSD (1,221,212 bzip2'ed to 616,236). The Windows
PE binary format and ELF both require the executable image to contain all
initialized but essentially redundant (i.e. zeroed) parts of the data
segement. Don't pretend you didn't know that.

Also, Acme in p9p or on Plan 9 performs less than 1 in 5 of the functions
vi/vim does. That ratio is even smaller when comparing Acme to Emacs. So
you have been unfair. No kidding.

--On Wednesday, November 05, 2008 10:15 AM -0800 ron minnich
<rminnich@gmail.com> wrote:

> On Wed, Nov 5, 2008 at 2:57 AM, Eris Discordia <eris.discordia@gmail.com>
> wrote:
>> [root@host ~/clms]# ls -l `which vim`
>> -rwxr-xr-x  1 root  wheel  1221212 Oct 15  2006 /usr/local/bin/vim
>>
>> ------------------------------------------------------------------------
>> --------
>>
>> C:\Program Files (x86)\Vim\vim71>dir gvim.exe
>> Volume in drive C has no label.
>> Volume Serial Number is B001-B4A3
>>
>> Directory of C:\Program Files (x86)\Vim\vim71
>>
>> 05/12/2007  12:19 PM         1,585,152 gvim.exe
>>              1 File(s)      1,585,152 bytes
>>              0 Dir(s)   5,075,197,952 bytes free
>>
>> C:\Program Files (x86)\Vim\vim71>dir vim.exe
>> Volume in drive C has no label.
>> Volume Serial Number is B001-B4A3
>>
>> Directory of C:\Program Files (x86)\Vim\vim71
>>
>> 05/12/2007  12:14 PM         1,372,160 vim.exe
>>              1 File(s)      1,372,160 bytes
>>              0 Dir(s)   5,075,197,952 bytes free
>>
>> C:\Program Files (x86)\Vim\vim71>
>>
>> ------------------------------------------------------------------------
>> --------
>>
>> So what? (and the two latter were _Windows_ binaries).
>>
>>> I realize that is utterly unfair. Sort of.
>>
>> Nice of you to realize that. Sort of.
>>
>
> yes, I agree, I was being terribly unfair to plan 9. Acme on plan 9 is
> about 1/2 M. Vim on DOS is 3x larger? impressive.
>
> Ron
>



^ permalink raw reply	[flat|nested] 59+ messages in thread
[parent not found: <B9EFF9908B07EE7F3D52A6FE@192.168.1.2>]
* Re: [9fans] mmap and shared libraries
@ 2008-11-06  0:17 Eris Discordia
  2008-11-06  1:26 ` erik quanstrom
  0 siblings, 1 reply; 59+ messages in thread
From: Eris Discordia @ 2008-11-06  0:17 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Sadly, the picture changes at run time: clock on plan 9 is 128k in
> memory, xclock is 4.2M RSS and 10M VSZ.
> Sic transit gloria .so. Of course, then we hear that "well, all that
> is shared". Hmm. Prove it.

I know one thing: shared libraries are employed on every major operating
system I have ever heard of. Can all these people be wrong? I don't think
so.

> FWIW, the whole issue of goodness/badness of shared libraries has
> never been systematically measured as far as I know -- in terms of
> performance cost, overhead, throughput, the usual suspects -- or at
> least
> I've never seen it done. It would be a lot of work to do it correctly.
> Might be interesting.

Title: Dynamic Linking of Software Components
Author: Michael Franz
YoP: 1997

> ABSTRACT
>
> The concepts underlying dynamic linking reached maturity through modular
> operating systems and are being reintroduced in some of the most popular
> workstation and PC operating systems. [...]

<http://portal.acm.org/citation.cfm?id=619016.620662&coll=GUIDE&dl=GUIDE&CFID=8901601&CFTOKEN=68907171>

The abstract says it is an overall survey of dynamic linking. I don't have
access to the full text and even if I had I wouldn't understand a word of
it. You are the CS/CE person. Be the judge, too.

> So the compressed version is only 50% larger than acme. The point being?

That there's a lot of redundancy in the executable principally imposed by
the binary format.

In case of the FreeBSD vim executable:

$ readelf -e /usr/local/bin/vim

Reveals 171,365 bytes of redundant data only in .data, .rodata, and .bss
sections.

$ objdump -s /usr/local/bin/vim

Will display tons of zeroes in all other sections except .text. Even RLE
could significantly reduce the image size.

> note that filesize is < memory size. I'll let you figure out how it works.

I'm not that intelligent but didn't I say it was _initialized_ data that
had to be written to executable image?

Example from a simple program I wrote to be assembled by Flat Assembler for
Win32:

--------------------------------------------------------------------------------
section '.data' data readable writeable
.
.
.
  buffer_ptr	dd 00h           <----- pointer reserved, and initialized
.
.
.
  buffer	db 00FFFFh dup (?)     <----- buffer reserved, not initialized
.
.
.
--------------------------------------------------------------------------------

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.

As for ELF:

> Defining data elements in the bss section is somewhat different from
> defining them in the data section. Instead of declaring specific data
> types, you just declare raw segments of memory that  are reserved for
> whatever purpose you need them for.
>
> [...]
>
> 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.

-- Richard Blum, Professional Assembly Language, in the context of using
(g)as and ELF format

I don't want to sound authoritative but when something is right it is right
and there's nothing you or I can do about it.

> Does the redundant litter cross the network when I have it mounted via
> a share and execute the program or not? That was the original
> discussion.

I don't know. The size of Emacs executable has as much connection to that
question as I do, but it was _you_ who made the bad Emacs joke.

> Ah! Now we're into feature comparisons! I'm game. How did you get to 1
> in 5 and not 1 in 4.8, or 1 in 6?

You know very well that the ratio is just an inaccurate measure as the
context suggests. 1 to 5 means like your pinkie compared to your entire
hand. Trying to "context-switch" and move from an inaccurate measure to an
exact number is just a diversionary technique you have employed for
countering an easily demonstrable fact. Namely that Acme is a minimal text
editor claiming to be an IDE while Emacs is a behemoth with more features
than you could count through a day, and the following night--not that I
believe Emacs is any better than Acme.

--On Wednesday, November 05, 2008 2:13 PM -0800 ron minnich
<rminnich@gmail.com> wrote:

> On Wed, Nov 5, 2008 at 12:54 PM, Eris Discordia
> <eris.discordia@gmail.com> wrote:
>>> yes, I agree, I was being terribly unfair to plan 9. Acme on plan 9 is
>>> about 1/2 M. Vim on DOS is 3x larger? impressive.
>>
>> My intent was, of course, to show your comparison is baseless. It seems
>> you still haven't realized that. You think Plan 9 is great?
>
> Actually, to keep it simple, I was trying to make a simple point, with
> a bit of humor intended, and not actually even directed at you,: that
> code built with shared libraries is not
> necessarily, or always, smaller than code built otherwise, for
> programs of similar capability. I don't have an emacs
> linked statically, however, so I took the nearest materials at hand.
> It depends on a lot of circumstances.
>
> There is the example of xclock which is small with X11 .so, and quite
> large otherwise. And there, for the case of a "clock", shared
> libraries clearly reduce disk footprint:
> xclock binary is about 1/10 the size of plan 9 clock (19K vs. 158K)..
>
> Sadly, the picture changes at run time: clock on plan 9 is 128k in
> memory, xclock is 4.2M RSS and 10M VSZ.
> Sic transit gloria .so. Of course, then we hear that "well, all that
> is shared". Hmm. Prove it.
>
> FWIW, the whole issue of goodness/badness of shared libraries has
> never been systematically measured as far as I know -- in terms of
> performance cost, overhead, throughput, the usual suspects -- or at
> least
> I've never seen it done. It would be a lot of work to do it correctly.
> Might be interesting.
>
>> The GUI version of Vim on Windows (gvim.exe) compresses to 734,713 bytes
>
> So the compressed version is only 50% larger than acme. The point being?
>
>> because the bigger part of the uncompressed 1,585,152 bytes is redundant
>> filler required by the binary format specification.
>
> Does the redundant litter cross the network when I have it mounted via
> a share and execute the program or not? That was the original
> discussion.
>
>> The same happens for the
>> vim executable on FreeBSD (1,221,212 bzip2'ed to 616,236). The Windows PE
>> binary format and ELF both require the executable image to contain all
>> initialized but essentially redundant (i.e. zeroed) parts of the data
>> segement. Don't pretend you didn't know that.
>
> Wrong for ELF.
>
> Simple example from /bin/cat:
>   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
>   LOAD           0x0049e8 0x100149e8 0x100149e8 0x00284 0x003cc RW
> 0x10000
>
> note that filesize is < memory size. I'll let you figure out how it works.
>
> This is the problem with your posts. You sound very authoritative, and
> I'm sure you figure you know all these bits,
> but you're wrong so often. It's confusing. It would be unfortunate
> were people to believe you are as right as you think you are.
>
>>
>> Also, Acme in p9p or on Plan 9 performs less than 1 in 5 of the functions
>> vi/vim does. That ratio is even smaller when comparing Acme to Emacs. So
>> you have been unfair. No kidding.
>>
>
> Ah! Now we're into feature comparisons! I'm game. How did you get to 1
> in 5 and not 1 in 4.8, or 1 in 6?
> Of course, you have to take into account that acme's extensions live
> in /bin or your number is bogus.
>
> ron
>



^ permalink raw reply	[flat|nested] 59+ messages in thread
* Re: [9fans] mmap and shared libraries
@ 2008-11-06  0:45 Eris Discordia
  2008-11-06  5:32 ` Wes Kussmaul
  0 siblings, 1 reply; 59+ messages in thread
From: Eris Discordia @ 2008-11-06  0:45 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Sadly, the picture changes at run time: clock on plan 9 is 128k in
> memory, xclock is 4.2M RSS and 10M VSZ.
> Sic transit gloria .so. Of course, then we hear that "well, all that
> is shared". Hmm. Prove it.

I know one thing: every major operating system I have ever heard of
leverages shared libraries. Can all those people be wrong? I don't think
so.

> FWIW, the whole issue of goodness/badness of shared libraries has
> never been systematically measured as far as I know -- in terms of
> performance cost, overhead, throughput, the usual suspects -- or at
> least
> I've never seen it done. It would be a lot of work to do it correctly.
> Might be interesting.

Title: Dynamic Linking of Software Components
Author: Michael Franz
YoP: 1997

> ABSTRACT
>
> The concepts underlying dynamic linking reached maturity through modular
> operating systems and are being reintroduced in some of the most popular
> workstation and PC operating systems.

<http://portal.acm.org/citation.cfm?id=619016.620662&coll=GUIDE&dl=GUIDE&CFID=8901601&CFTOKEN=68907171>

The abstract says this is an overall survey of dynamic linking. I can't
access the full text and I wouldn't understand it even if I could. You are
the CS/CE person. Be the judge, too.

> So the compressed version is only 50% larger than acme. The point being?

That there's a lot of redundancy in the executable image principally
imposed by the binary format.

$ readelf -e /usr/local/bin/vim

Reveals over 170 KB of data only in .data, .rodata, and .bss sections.

$ objdump -s /usr/local/bin/vim

Displays tons of zeroes in all sections except .text. Even RLE could have
considerably reduced the image size.

> Does the redundant litter cross the network when I have it mounted via
> a share and execute the program or not? That was the original
> discussion.

I don't know. The size of Emacs executable has as much connection to that
question as I do, but it was _you_ who made the bad Emacs joke.

> Wrong for ELF.

About ELF:

> Defining data elements in the bss section is somewhat different from
> defining them in the data section. Instead of declaring specific data
> types, you just declare raw segments of memory that are reserved for
> whatever purpose you need them for.
>
> [...]
>
> 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.

-- Professional Assembly Programming, Richard Blum, in the context of using
(g)as and ELF

Exactly what I said. I don't want to sound authoritative but when something
is right it is right and there's nothing you or I can do about it. So:
"right for ELF."

Executable image size can be less than memory size because there can be
_uninitialized_ data reserved in data segments, e.g. when you reserve a
buffer but don't care what it initially contains. However, _initialized_
data always and invariably gets written to disk--think of a whole 64K of
zeroes.

Example from a simple program for Flat Assembler with Win32 target:

section '.data' data readable writeable

	buffer_ptr	dd 00h                <---- a pointer reserved, and initialized

	buffer		db 00FFFFh dup (?)    <---- a buffer reserved, but not initialized


> Ah! Now we're into feature comparisons! I'm game. How did you get to 1
> in 5 and not 1 in 4.8, or 1 in 6?

You know very well that the ratio is an inaccurate measure as the context
suggests. 1 to 5 is like your pinkie to all your fingers. Trying to
"context-switch" and turn a guesstimate into an exact number is only a
diversionary technique you have employed to evade an easily demonstrable
fact. Namely that Acme is a minimal text editor claiming to be an IDE while
Emacs is a behemoth with more features than you could count in a day, and
the following night--not that I believe Emacs is any better than Acme. Vim
leans more towards Emacs.

--On Wednesday, November 05, 2008 2:13 PM -0800 ron minnich
<rminnich@gmail.com> wrote:

> On Wed, Nov 5, 2008 at 12:54 PM, Eris Discordia
> <eris.discordia@gmail.com> wrote:
>>> yes, I agree, I was being terribly unfair to plan 9. Acme on plan 9 is
>>> about 1/2 M. Vim on DOS is 3x larger? impressive.
>>
>> My intent was, of course, to show your comparison is baseless. It seems
>> you still haven't realized that. You think Plan 9 is great?
>
> Actually, to keep it simple, I was trying to make a simple point, with
> a bit of humor intended, and not actually even directed at you,: that
> code built with shared libraries is not
> necessarily, or always, smaller than code built otherwise, for
> programs of similar capability. I don't have an emacs
> linked statically, however, so I took the nearest materials at hand.
> It depends on a lot of circumstances.
>
> There is the example of xclock which is small with X11 .so, and quite
> large otherwise. And there, for the case of a "clock", shared
> libraries clearly reduce disk footprint:
> xclock binary is about 1/10 the size of plan 9 clock (19K vs. 158K)..
>
> Sadly, the picture changes at run time: clock on plan 9 is 128k in
> memory, xclock is 4.2M RSS and 10M VSZ.
> Sic transit gloria .so. Of course, then we hear that "well, all that
> is shared". Hmm. Prove it.
>
> FWIW, the whole issue of goodness/badness of shared libraries has
> never been systematically measured as far as I know -- in terms of
> performance cost, overhead, throughput, the usual suspects -- or at
> least
> I've never seen it done. It would be a lot of work to do it correctly.
> Might be interesting.
>
>> The GUI version of Vim on Windows (gvim.exe) compresses to 734,713 bytes
>
> So the compressed version is only 50% larger than acme. The point being?
>
>> because the bigger part of the uncompressed 1,585,152 bytes is redundant
>> filler required by the binary format specification.
>
> Does the redundant litter cross the network when I have it mounted via
> a share and execute the program or not? That was the original
> discussion.
>
>> The same happens for the
>> vim executable on FreeBSD (1,221,212 bzip2'ed to 616,236). The Windows PE
>> binary format and ELF both require the executable image to contain all
>> initialized but essentially redundant (i.e. zeroed) parts of the data
>> segement. Don't pretend you didn't know that.
>
> Wrong for ELF.
>
> Simple example from /bin/cat:
>   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
>   LOAD           0x0049e8 0x100149e8 0x100149e8 0x00284 0x003cc RW
> 0x10000
>
> note that filesize is < memory size. I'll let you figure out how it works.
>
> This is the problem with your posts. You sound very authoritative, and
> I'm sure you figure you know all these bits,
> but you're wrong so often. It's confusing. It would be unfortunate
> were people to believe you are as right as you think you are.
>
>>
>> Also, Acme in p9p or on Plan 9 performs less than 1 in 5 of the functions
>> vi/vim does. That ratio is even smaller when comparing Acme to Emacs. So
>> you have been unfair. No kidding.
>>
>
> Ah! Now we're into feature comparisons! I'm game. How did you get to 1
> in 5 and not 1 in 4.8, or 1 in 6?
> Of course, you have to take into account that acme's extensions live
> in /bin or your number is bogus.
>
> ron
>



^ permalink raw reply	[flat|nested] 59+ messages in thread
[parent not found: <C9A2E584874CDAD0B23E1ABF@192.168.1.2>]
* Re: [9fans] mmap and shared libraries
@ 2008-11-06  7:34 Eris Discordia
  0 siblings, 0 replies; 59+ messages in thread
From: Eris Discordia @ 2008-11-06  7:34 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Sorry, but "everyone does it" just doesn't hack it.

Common-sensically it does, but if you say it doesn't I concede.

> not what I asked.

It seems to answer your question by implying there's no question regarding
the use or disuse of shared libraries only regarding the strategy (and that
back in 1997). But I can't read beyond the abstract so I can't tell if it
really goes that far. Incidentally, it references some Wirth papers.

> you're kind of confusing how the file is created with what ELF wants,
> but that's up to you.

Perhaps, I'll try to read up on it.

> You need to understand the difference between sections and segments.
> From the point of view of the program loader, there is no such thing
> as a ..bss.

I believe I understand the difference. The loader may put .bss, .data,
.rodata, and some other data sections around the same place in memory and
decide about the order and relative placement of each. That doesn't change
anything about the binary format, however. Only when the image is being
loaded .bss grows to its true size. On the other hand, .data is more or
less the same in memory or on disk.

> But think of it this way: You can have a valid ELF executable that has
> no sections. Sections have nothing to do with running the program.

Initialized data has to be placed somewhere in the image, anyway.

> So, Wrong for ELF. Sorry. But it's an incredibly common mistake.

I'll try to learn more about it (and probably report back... okay, I won't).

> So I guess that acme has more features than vi, since it's extensions
> are "any executable"; you guess not.
> My claim is you don't actually understand acme.

That's a probable cause but only probable.

> Let's leave it at that. Except, uh, who claimed acme was an IDE? Just
> wondering. It wasn't me.

Well, leave it at that. By the way, the programmer's do-all is an IDE I
presume.

Finally, thanks for bearing with me and supplying things I didn't know.

--On Wednesday, November 05, 2008 5:25 PM -0800 ron minnich
<rminnich@gmail.com> wrote:

> On Wed, Nov 5, 2008 at 4:45 PM, Eris Discordia <eris.discordia@gmail.com>
> wrote:
>
>> I know one thing: every major operating system I have ever heard of
>> leverages shared libraries. Can all those people be wrong? I don't think
>> so.
>
> I know one thing. Every major operating system in the late 1960s
> "knew" that card image files were the way to go. Could all those
> people be wrong?
>
> Yes.
>
> Sorry, but "everyone does it" just doesn't hack it.
>
>>
>>> FWIW, the whole issue of goodness/badness of shared libraries has
>>> never been systematically measured as far as I know -- in terms of
>>> performance cost, overhead, throughput, the usual suspects -- or at
>>> least
>>> I've never seen it done. It would be a lot of work to do it correctly.
>>> Might be interesting.
> =
>> The abstract says this is an overall survey of dynamic linking. I can't
>> access the full text and I wouldn't understand it even if I could. You
>> are the CS/CE person. Be the judge, too.
>
> not what I asked.
>
>>
>>> So the compressed version is only 50% larger than acme. The point being?
>>
>> That there's a lot of redundancy in the executable image principally
>> imposed by the binary format.
>>
>> $ readelf -e /usr/local/bin/vim
>>
>> Reveals over 170 KB of data only in .data, .rodata, and .bss sections.
>>
>> $ objdump -s /usr/local/bin/vim
>>
>> Displays tons of zeroes in all sections except .text. Even RLE could have
>> considerably reduced the image size.
>> ]
>
> you're kind of confusing how the file is created with what ELF wants,
> but that's up to you.
>
>>> Does the redundant litter cross the network when I have it mounted via
>>> a share and execute the program or not? That was the original
>>> discussion.
>>
>> I don't know. The size of Emacs executable has as much connection to that
>> question as I do, but it was _you_ who made the bad Emacs joke.
>
> I.e. You don't know. OK, I'll accept that.
>
>>
>>> Wrong for ELF.
>>
>> About ELF:
>>
>>> Defining data elements in the bss section is somewhat different from
>>> defining them in the data section. Instead of declaring specific data
>>> types, you just declare raw segments of memory that are reserved for
>>> whatever purpose you need them for.
>>>
>>> [...]
>>>
>>> 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.
>>
>> -- Professional Assembly Programming, Richard Blum, in the context of
>> using (g)as and ELF
>>
>> Exactly what I said. I don't want to sound authoritative but when
>> something is right it is right and there's nothing you or I can do about
>> it. So: "right for ELF."
>
> I see your confusion, and it is common, and I have made this mistake
> too. ELF is like that :-)
> And readelf can make it worse.
>
> You need to understand the difference between sections and segments.
> From the point of view of the program loader, there is no such thing
> as a ..bss.
>
> From the point of view of the linker, there are .bss segments. But
> those don't have lots of meaning for a program loader. In fact program
> loaders that look at sections are broken.
>
> So you're going to need to go back to the standard, but most people
> are: I once worked with code that was created by a big company that
> mistakenly parsed the sections, not the segments, of an executable. It
> was a mess.
>
> But think of it this way: You can have a valid ELF executable that has
> no sections. Sections have nothing to do with running the program.
>
> So, Wrong for ELF. Sorry. But it's an incredibly common mistake.
>
>> Example from a simple program for Flat Assembler with Win32 target:
>>
>> section '.data' data readable writeable
>>
>>        buffer_ptr      dd 00h                <---- a pointer reserved,
>>        and initialized
>>
>>        buffer          db 00FFFFh dup (?)    <---- a buffer reserved, but
>> not initialized
>
> Trust me. I don't care about win32 targets.
>
>
>>
>>
>>> Ah! Now we're into feature comparisons! I'm game. How did you get to 1
>>> in 5 and not 1 in 4.8, or 1 in 6?
>>
>> You know very well that the ratio is an inaccurate measure as the context
>> suggests. 1 to 5 is like your pinkie to all your fingers. Trying to
>> "context-switch" and turn a guesstimate into an exact number is only a
>> diversionary technique you have employed to evade an easily demonstrable
>> fact. Namely that Acme is a minimal text editor claiming to be an IDE
>> while Emacs is a behemoth with more features than you could count in a
>> day, and the following night--not that I believe Emacs is any better
>> than Acme. Vim leans more towards Emacs.
>
> So I guess that acme has more features than vi, since it's extensions
> are "any executable"; you guess not.
> My claim is you don't actually understand acme.
> Let's leave it at that. Except, uh, who claimed acme was an IDE? Just
> wondering. It wasn't me.
>
> ron
>



^ permalink raw reply	[flat|nested] 59+ messages in thread
[parent not found: <88F7FC88EA146B5826CA4895@192.168.1.2>]

end of thread, other threads:[~2008-11-09 22:57 UTC | newest]

Thread overview: 59+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1d371286c515cad580f68eddbe2cdf57@quanstro.net>
2008-11-03  3:18 ` [9fans] mmap Enrico Weigelt
2008-11-03  3:31   ` ron minnich
2008-11-03  6:27     ` 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
2008-11-04 15:06 Eris Discordia
     [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-05 10:57 Eris Discordia
2008-11-05 16:34 ` Abhishek Kulkarni
2008-11-05 17:19   ` roger peppe
     [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 20:54 Eris Discordia
     [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-06  0:17 Eris Discordia
2008-11-06  1:26 ` erik quanstrom
2008-11-06  0:45 Eris Discordia
2008-11-06  5:32 ` Wes Kussmaul
     [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  7:34 Eris Discordia
     [not found] <88F7FC88EA146B5826CA4895@192.168.1.2>
2008-11-06  8:45 ` Bruce Ellis

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).