[PATCH] D17817: [ELF] do not allow .bss to occupy the file space when producing relocatable output.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 3 12:02:19 PST 2016


>The spec is pretty much vague at this point -- it is not clear what "the conceptual placement" means and what it should be.

>
>That being said, I'm not entirely against setting a file offset to the bss section. But the two if's don't look good. It probably needs some explanation, but the explanation is that "bss >section should point to its conceptual placement", which doesn't really explain the reason that much. So, how about this?
>
>  for (OutputSectionBase<ELFT> *Sec : OutputSections) {
>    FileOff = alignTo(FileOff, Sec->getAlign());
>    Sec->setFileOffset(FileOff);
>    FileOff += Sec->getSize();
>  }

That the same how it was before the patch :)
?But the point was that .bss should not occupy the space in file. Without that for example tescase for the patch would generate 5 magabytes output what we can and want to avoid, don't we ?

George.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160303/e55a6839/attachment.html>


More information about the llvm-commits mailing list