[Toybox] perf(1)

Rich Felker dalias at libc.org
Thu Mar 12 17:45:53 PDT 2015


On Thu, Mar 12, 2015 at 05:24:00PM -0700, enh wrote:
> On Thu, Mar 12, 2015 at 4:18 PM, Rich Felker <dalias at libc.org> wrote:
> > On Thu, Mar 12, 2015 at 03:12:18PM -0700, enh wrote:
> >> https://android-review.googlesource.com/#/c/128430/
> >>
> >> On Thu, Mar 12, 2015 at 3:10 PM, Rich Felker <dalias at libc.org> wrote:
> >> > On Thu, Mar 12, 2015 at 03:07:39PM -0700, enh wrote:
> >> >> there's a tool in Android that packs relative relocations. saves
> >> >> several MiB on the chromium webview .so. long term we'd like to see
> >> >> gold support it directly, but in the meantime it's a post-processing
> >> >> phase.
> >> >
> >> > What kind of packing are you doing?
> >
> > OK, so it's via customization of the loader to process a different
> > form of relocations. This seems dubious to me -- if the number of
> > relocations is so large that it makes a practical difference to the
> > file size, then you also have a large number of dirty pages that are
> > wasting memory at runtime. Fixing the need for so many relative
> > relocations, which are presumably a result of unnecessary and harmful
> > global state containing pointers to functions or to other global
> > state, seems like it would be a much more beneficial approach than
> > packing the relocations.
> 
> no one ever argued that chromium was svelte. but picking off 10%
> mechanically is a lot easier than rewriting all the code.

I just see it a bit differently -- shaving off some portion of the
relative relocations in chromium itself is a local change that's a
strict improvement, but hacking the ELF format to pack relative
relocations is a tradeoff -- a change that affects many different
tools and has permanent maintenance cost for all of them.

> the fact that this only affects LP64 makes me think it's not as simple
> as that anyway, but afaik no one's looked into that. aarch64 is
> especially bad.

Yes, that seems really suspicious -- perhaps it's a toolchain bug
that's generating all those relocations to begin with.

Rich

 1426207553.0


More information about the Toybox mailing list