Hello, Since updating our toolchains for PPC 405, e300c3, and e500v2 we experience a massive size increase for small binaries. Our 405 target has very small storage, and as the rootfs contains a lot of small binaries, we can't supply images linked with binutils 2.27 or 2.28 anymore. I filed a bug over at crosstool-ng [1] to get some help, and Alexey Neyman was kind enough to give me a hint to COMMONPAGESIZE. Doing some research, I found out that it was raised from 4k to 64k in 2014 [2]. You discussed about the impact on embedded, but it wasn't considered as an obstacle. Maybe that should be reconsidered. Is it possible to treat embedded, size constrained targets differently than servers? There's a special 4k COMMONPAGESIZE for __QNXTARGET__. Or would it be possible to add a configure option for this? Or is there already another mechanism to alter COMMONPAGESIZE? Kind regards, Flössie [1] https://github.com/crosstool-ng/crosstool-ng/issues/656 [2] https://sourceware.org/ml/binutils/2014-12/msg00165.html
I think the size change is because ld 2.27 and later defaults to -z relro for linux targets. Making COMMONPAGESIZE equal to MAXPAGESIZE usually *decreases* disk size (at the expense of memory size). Try configuring with --disable-relro
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9194f82dc372d5045ae06c617a49a5a9b17c1d24 commit 9194f82dc372d5045ae06c617a49a5a9b17c1d24 Author: Alan Modra <amodra@gmail.com> Date: Tue Oct 3 15:10:28 2017 +1030 PR21294, Binary size regression on PPC embedded PR 21294 * NEWS: Note that defaulting to -z relro results in increased memory and disk size.
I should note here for future reference that a common-page-size configure option has a difficulty: What exactly would it mean when ld supports multiple targets? Should *all* targets use the given page size, or just the default target? It's likely that neither of those two possible implementations would please everybody..