New issue
Advanced search Search tips

Issue 905329 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 14
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 892648



Sign in to add a comment

SuperSize: Named symbols are masked by symbols with '.L_MergedGlobals' prefix

Project Member Reported by hua...@chromium.org, Nov 14

Issue description

For 32-bit arm (LTO and non-LTO), ChromePublic.apk contains many symbols with prefix '.L_MergedGlobals', but should have more informative names.

To repro, build chrome_public_apk for arm (32-bit), then run:

  $ supersize archive -f ChromePublic.apk out.size
  ...
  $ supersize console out.size

  >>> size_info.raw_symbols.Filter(lambda s: s.full_name.startswith('.L_MergedGlobals'))

Non-LTO arm build has ~2300 such symbols, and ThinLTO arm build has ~2700.

These arise from the libchrome.so.map, which has entries like

 3002410  3002410       60     8         thinlto-cache/Thin-d899f7.tmp.o:(.bss..L_MergedGlobals.8)
 3002410  3002410       60     1                 .L_MergedGlobals.8
 3002410  3002410       20     1                 enterprise_management::_DevicePolicyResponse_default_instance_
 3002430  3002430       20     1                 enterprise_management::_TimePeriod_default_instance_
 3002450  3002450       20     1                 enterprise_management::_ActiveTimePeriod_default_instance_

Notice that '.L_MergedGlobals.8' masks the first named entry.

This does not happen for arm64, which can still use .L_MergedGlobals, but does not have the masking problem. Example:

         4e1c9c0          4e1c9c0       10     8         thinlto-cache/Thin-d2903d.tmp.o:(.bss..L_MergedGlobals)
         4e1c9c0          4e1c9c0        0     1                 $d.25
         4e1c9c0          4e1c9c0        8     1                 autofill::(anonymous namespace)::GetFilter()::filter
         4e1c9c8          4e1c9c8        8     1                 guard variable for autofill::(anonymous namespace)::GetFilter()::filter

Here, SuperSize ignores '$d.25', and correctly takes the first named symbol.

 
Correction: '$d.25' was ignored because it has length 0.

The easy fix is to just ignore entry if it has .L_MergedGlobals as a prefix.  A more complex fix would be to track down in LLVM (or Chrome build configs?) why .L_MergedGlobals appear in the first place?  I'm going to go with the easy fix.
Blocking: 892648
Project Member

Comment 3 by bugdroid1@chromium.org, Nov 15

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6f5762df9beac17ddcd9e1f3d45bdf81fd6b1db6

commit 6f5762df9beac17ddcd9e1f3d45bdf81fd6b1db6
Author: Samuel Huang <huangs@chromium.org>
Date: Thu Nov 15 22:19:35 2018

[SuperSize] Skip symbols with '.L_MergedGlobals' prefix when parsing LLD linker maps.

For 32-bit ARM LLD builds (LTO and non-LTO), the linker map files can
have thousands of symbols with '.L_MergedGlobals' prefix. These symbols
obscure shadow symbols with more informative name.

This CL fixes the problem by making liner map parser  skip symbols with
these prefixes.

Bug:  905329 
Change-Id: I2e72b566e17f025bdf147551bd5b569764e0ec16
Reviewed-on: https://chromium-review.googlesource.com/c/1338227
Reviewed-by: Eric Stevenson <estevenson@chromium.org>
Reviewed-by: Samuel Huang <huangs@chromium.org>
Commit-Queue: Samuel Huang <huangs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608543}
[modify] https://crrev.com/6f5762df9beac17ddcd9e1f3d45bdf81fd6b1db6/tools/binary_size/libsupersize/linker_map_parser.py

Status: Assigned (was: Untriaged)
This issue has an owner, a component and a priority, but is still listed as untriaged or unconfirmed. By definition, this bug is triaged. Changing status to "assigned". Please reach out to me if you disagree with how I've done this.
Status: Fixed (was: Assigned)

Sign in to add a comment