<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
On 5/3/2011 10:30 AM, Steve Schveighoffer wrote:
<blockquote cite="mid:472028.76923.qm@web161705.mail.bf1.yahoo.com"
type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255,
255); font-family: arial,helvetica,sans-serif; font-size: 12pt;">
<div><span>This is not a fair response to this problem. When
the code size triples
(<a class="moz-txt-link-freetext" href="http://d.puremagic.com/issues/show_bug.cgi?id=2254">http://d.puremagic.com/issues/show_bug.cgi?id=2254</a>) because
you add the -lib switch, and adding unit tests adds to the
size of the executable, even when unit tests are turned off
(</span><span><a class="moz-txt-link-freetext" href="http://d.puremagic.com/issues/show_bug.cgi?id=5560">http://d.puremagic.com/issues/show_bug.cgi?id=5560</a>)
again, when adding the -lib switch, it's obvious to everyone
(but you it seems) that the -lib switch is adding bloat.
Bug 5660 proves that beyond all reasonable doubt.</span></div>
</div>
</blockquote>
<br>
Again, this is simply not relevant information. Each obj file has
bookkeeping overhead required by the ELF file format. By looking at
the object file size, you have ZERO information about the size of
code/data making it into the executable.<br>
<br>
<blockquote cite="mid:472028.76923.qm@web161705.mail.bf1.yahoo.com"
type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255,
255); font-family: arial,helvetica,sans-serif; font-size: 12pt;">
<div><br>
<span></span></div>
<div><span>Whether it accounts for all the added bloat, I'm not
sure. obj2asm is a great tool, but I am not an assembly
developer, I can't always decipher what's going on.</span></div>
</div>
</blockquote>
<br>
You do not need to know a single iota of assembler to understand
where size is coming from in the output of obj2asm.<br>
<br>
<blockquote cite="mid:472028.76923.qm@web161705.mail.bf1.yahoo.com"
type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255,
255); font-family: arial,helvetica,sans-serif; font-size: 12pt;">
<div><span> the -map switch only tells you what the compiler is
outputting,</span></div>
</div>
</blockquote>
<br>
No, it doesn't. It tells you what symbols (i.e. functions) made it
into the executable, and the size contributed by each function.<br>
<br>
<blockquote cite="mid:472028.76923.qm@web161705.mail.bf1.yahoo.com"
type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255,
255); font-family: arial,helvetica,sans-serif; font-size: 12pt;">
<div><span> it doesn't tell you if the output contains
unnecessary bloat.</span></div>
</div>
</blockquote>
<br>
It does if the functions in the executable don't need to be there.<br>
<br>
<blockquote cite="mid:472028.76923.qm@web161705.mail.bf1.yahoo.com"
type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255,
255); font-family: arial,helvetica,sans-serif; font-size: 12pt;">
<div><br>
</div>
<div>Please, at least agree to look at bug 5560, it's
irrefutable proof that the -lib switch adds bloat, it cannot
get any simpler than that.</div>
</div>
</blockquote>
<br>
I'm afraid 5560 doesn't prove that. Without looking at the obj2asm
contents of those .o files, you simply cannot conclude there is any
bloat in there or if it is nothing more than the ELF bookkeeping.<br>
<br>
<blockquote cite="mid:472028.76923.qm@web161705.mail.bf1.yahoo.com"
type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255,
255); font-family: arial,helvetica,sans-serif; font-size: 12pt;">
<div><br>
<span></span></div>
<div><span>-Steve<br>
</span></div>
<div><br>
<blockquote style="border-left: 2px solid rgb(16, 16, 255);
margin-left: 5px; padding-left: 5px;">
<div style="font-family: arial,helvetica,sans-serif;
font-size: 12pt;">
<div style="font-family: times new roman,new
york,times,serif; font-size: 12pt;"><font size="2"
face="Arial">
<hr size="1"><b><span style="font-weight: bold;">From:</span></b>
Walter Bright <a class="moz-txt-link-rfc2396E" href="mailto:walter@digitalmars.com"><walter@digitalmars.com></a><br>
<b><span style="font-weight: bold;">To:</span></b>
Steve Schveighoffer <a class="moz-txt-link-rfc2396E" href="mailto:schveiguy@yahoo.com"><schveiguy@yahoo.com></a>;
Discuss the phobos library for D
<a class="moz-txt-link-rfc2396E" href="mailto:phobos@puremagic.com"><phobos@puremagic.com></a><br>
<b><span style="font-weight: bold;">Sent:</span></b>
Tuesday, May 3, 2011 12:57 PM<br>
<b><span style="font-weight: bold;">Subject:</span></b>
large object files and binaries<br>
</font><br>
<meta http-equiv="x-dns-prefetch-control" content="off">
<div id="yiv1095387885"> <br>
<br>
On 5/3/2011 7:39 AM, Steve Schveighoffer wrote:
<blockquote type="cite">
<div style="color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255); font-family:
arial,helvetica,sans-serif; font-size: 12pt;">
<div><span>Dmd has steadily been making binaries
more bloated for the last couple years (many
times pointed out in the NG and there are
several bugzilla reports).<br>
</span></div>
</div>
</blockquote>
<br>
There are two causes of this:<br>
<br>
1. Typeinfo getting larger, and people wanting more
features in Typeinfo (like precise gc) so this will
continue to increase.<br>
<br>
2. Every phobos module imports and relies on every
other one.<br>
<br>
<br>
To find out why .o files are large, run obj2asm on it.
To find out why executables are large, compile with
the -map switch and examine the linker .map file.
<rant>AFAIK, I'm the only person who ever does
this.</rant><br>
<br>
Please, everyone. Once in a while, run obj2asm on the
library module you're developing and have a look-see
at what is coming out of the compiler.<br>
<br>
</div>
<meta http-equiv="x-dns-prefetch-control" content="on">
<br>
<br>
</div>
</div>
</blockquote>
</div>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
phobos mailing list
<a class="moz-txt-link-abbreviated" href="mailto:phobos@puremagic.com">phobos@puremagic.com</a>
<a class="moz-txt-link-freetext" href="http://lists.puremagic.com/mailman/listinfo/phobos">http://lists.puremagic.com/mailman/listinfo/phobos</a></pre>
</blockquote>
</body>
</html>