[PATCH] D56325: Sort symbols in .bss by size.

Vic Yang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 4 13:20:45 PST 2019


victoryang added a comment.

In D56325#1346834 <https://reviews.llvm.org/D56325#1346834>, @ruiu wrote:

> What is the entire size of your program?


The numbers are measured across all processes running, so there are multiple programs. If you are looking for numbers from a single binary, I saw private dirty from .bss in libc went down from 36KB to 16KB. Unfortunately I didn't record the saving from sorting .bss+.data in libc. I can do the test again if that's necessary.

> I'm tempted to sort all SHF_WRITE sections by size by default. Unlike some other sections such as .init_array, there should not be really any program that have an assumption on how .data sections are laid out, but I'm not sure if that wouldn't surprise users. But maybe, we should do that?

Unless there's a certain logic in how things in SHF_WRITE sections are ordered right now, I don't think anyone can realistically depend on the ordering, so this should be safe.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56325/new/

https://reviews.llvm.org/D56325





More information about the llvm-commits mailing list