New issue
Advanced search Search tips

Issue 845546 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Chrome , Fuchsia
Pri: 3
Type: Bug



Sign in to add a comment

Consider building with -Wl,--discard-all

Project Member Reported by thakis@chromium.org, May 22 2018

Issue description

We currently don't pass -Wl,--discard-all. It might help with binary size (not sure if stripping gets rid of these symbols and also haven't measured if it actually helps any) and with link speed (since we don't need to call copyLocalSymbols()).

I gave it a try and most bots are happy:
https://chromium-review.googlesource.com/c/chromium/src/+/1067797

I don't have a linux box at hand today and I'm away for the next week, so filing this in case someone else wants to take it (or wants to talk me out of adding the flag).
 

Comment 1 by p...@chromium.org, May 22 2018

I don't think it will help with stripped binary size, --discard-all only has an effect on .symtab, which is one of the sections that is stripped.

It might help with link speed, but it could also have a negative effect on debuggability, so we probably only want to do this at symbol_level=0.

Comment 2 by p...@chromium.org, May 22 2018

If we are going to pass flags at symbol_level=0 it may be better to pass --strip-all which prevents creation of the .symtab section altogether.

Comment 3 by p...@chromium.org, May 23 2018

If I link with --strip-all at symbol_level=0 I see some test failures in release builds on Linux: https://chromium-review.googlesource.com/1069779

We probably should not have tests that depend on there being symbols at symbol_level=0 which specifically means "no symbols" as far I'm aware. Maybe the right thing to do here is to use --discard-all for now since the tests evidently don't depend on there being local symbols, then clean up the tests and switch to --strip-all?

Sign in to add a comment