Commit 626e421d authored by Samuel Huang's avatar Samuel Huang Committed by Commit Bot

[SuperSize] Extend SuperSize-archive to embrace section ranges.

Previously SuperSize-archive focuses on section sizes and largely
ignores section addresses. As a result, "** ELF Section" symbols all
have address of 0. This CL refactors archive.py so that |section_range|
(2-tuple of address and size) become a primary object of interest, and
replaces widespread |section_size| usage. Details:
* linker_map_parser.py: Changes to store and return section ranges.
  * Requires test output update.
* archive.py: Extensive changes to use ranges throughout.
  * Add _ExtendSectionRange() helper.
  * _AddUnattributedSectionSymbols(): Add "** ELF Section" symbols in
    section name order, to make later sorting more predictable.
* Not changed: CreateSectionSizesAndSymbols() params, to maintain
  .size format compatibility.

"** ELF Section:" symbols can now have non-0 addresse (and better
sort order). This required update of integration_test.py expected
outputs.

Other changes:
* Add dbg.py to aid debugging (compatible with Python 3).

Change-Id: Ife5a695a4d3d75a6c67dabae5de91c9bb9618100
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2099466Reviewed-by: default avatarSamuel Huang <huangs@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Samuel Huang <huangs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749544}
parent 40f2eb08
...@@ -705,6 +705,11 @@ def _CollectModuleSizes(minimal_apks_path): ...@@ -705,6 +705,11 @@ def _CollectModuleSizes(minimal_apks_path):
return sizes_by_module return sizes_by_module
def _ExtendSectionRange(section_range_by_name, section_name, delta_size):
(prev_address, prev_size) = section_range_by_name.get(section_name, (0, 0))
section_range_by_name[section_name] = (prev_address, prev_size + delta_size)
def CreateMetadata(map_path, elf_path, apk_path, minimal_apks_path, def CreateMetadata(map_path, elf_path, apk_path, minimal_apks_path,
tool_prefix, output_directory, linker_name): tool_prefix, output_directory, linker_name):
"""Creates metadata dict. """Creates metadata dict.
...@@ -834,7 +839,7 @@ def _NameStringLiterals(raw_symbols, elf_path, tool_prefix): ...@@ -834,7 +839,7 @@ def _NameStringLiterals(raw_symbols, elf_path, tool_prefix):
def _ParseElfInfo(map_path, elf_path, tool_prefix, track_string_literals, def _ParseElfInfo(map_path, elf_path, tool_prefix, track_string_literals,
outdir_context=None, linker_name=None): outdir_context=None, linker_name=None):
"""Adds ELF section sizes and symbols.""" """Adds ELF section ranges and symbols."""
if elf_path: if elf_path:
# Run nm on the elf file to retrieve the list of symbol names per-address. # Run nm on the elf file to retrieve the list of symbol names per-address.
# This list is required because the .map file contains only a single name # This list is required because the .map file contains only a single name
...@@ -859,7 +864,7 @@ def _ParseElfInfo(map_path, elf_path, tool_prefix, track_string_literals, ...@@ -859,7 +864,7 @@ def _ParseElfInfo(map_path, elf_path, tool_prefix, track_string_literals,
logging.info('Parsing Linker Map') logging.info('Parsing Linker Map')
with _OpenMaybeGz(map_path) as map_file: with _OpenMaybeGz(map_path) as map_file:
map_section_sizes, raw_symbols, linker_map_extras = ( map_section_ranges, raw_symbols, linker_map_extras = (
linker_map_parser.MapFileParser().Parse(linker_name, map_file)) linker_map_parser.MapFileParser().Parse(linker_name, map_file))
if outdir_context and outdir_context.thin_archives: if outdir_context and outdir_context.thin_archives:
...@@ -867,13 +872,16 @@ def _ParseElfInfo(map_path, elf_path, tool_prefix, track_string_literals, ...@@ -867,13 +872,16 @@ def _ParseElfInfo(map_path, elf_path, tool_prefix, track_string_literals,
if elf_path: if elf_path:
logging.debug('Validating section sizes') logging.debug('Validating section sizes')
_, elf_section_sizes = _SectionInfoFromElf(elf_path, tool_prefix) elf_section_ranges = _SectionInfoFromElf(elf_path, tool_prefix)
differing_elf_section_sizes = {} differing_elf_section_sizes = {}
differing_map_section_sizes = {} differing_map_section_sizes = {}
for k, v in elf_section_sizes.iteritems(): for k, (_, elf_size) in elf_section_ranges.iteritems():
if k not in _SECTION_SIZE_BLACKLIST and v != map_section_sizes.get(k): if k in _SECTION_SIZE_BLACKLIST:
differing_map_section_sizes[k] = map_section_sizes.get(k) continue
differing_elf_section_sizes[k] = v (_, map_size) = map_section_ranges.get(k)
if map_size != elf_size:
differing_map_section_sizes[k] = map_size
differing_elf_section_sizes[k] = elf_size
if differing_map_section_sizes: if differing_map_section_sizes:
logging.error('ELF file and .map file do not agree on section sizes.') logging.error('ELF file and .map file do not agree on section sizes.')
logging.error('readelf: %r', differing_elf_section_sizes) logging.error('readelf: %r', differing_elf_section_sizes)
...@@ -947,9 +955,9 @@ def _ParseElfInfo(map_path, elf_path, tool_prefix, track_string_literals, ...@@ -947,9 +955,9 @@ def _ParseElfInfo(map_path, elf_path, tool_prefix, track_string_literals,
if elf_path: if elf_path:
_NameStringLiterals(raw_symbols, elf_path, tool_prefix) _NameStringLiterals(raw_symbols, elf_path, tool_prefix)
# If we have an ELF file, use its sizes as the source of truth, since some # If we have an ELF file, use its ranges as the source of truth, since some
# sections can differ from the .map. # sections can differ from the .map.
return (elf_section_sizes if elf_path else map_section_sizes, raw_symbols, return (elf_section_ranges if elf_path else map_section_ranges, raw_symbols,
object_paths_by_name) object_paths_by_name)
...@@ -1086,10 +1094,10 @@ def _ParsePakSymbols(symbols_by_id, object_paths_by_pak_id): ...@@ -1086,10 +1094,10 @@ def _ParsePakSymbols(symbols_by_id, object_paths_by_pak_id):
return raw_symbols return raw_symbols
def _ParseApkElfSectionSize(section_sizes, metadata, apk_elf_result): def _ParseApkElfSectionRanges(section_ranges, metadata, apk_elf_result):
if metadata: if metadata:
logging.debug('Extracting section sizes from .so within .apk') logging.debug('Extracting section sizes from .so within .apk')
apk_build_id, _, apk_section_sizes, elf_overhead_size = apk_elf_result.get() apk_build_id, apk_section_ranges, elf_overhead_size = apk_elf_result.get()
assert apk_build_id == metadata[models.METADATA_ELF_BUILD_ID], ( assert apk_build_id == metadata[models.METADATA_ELF_BUILD_ID], (
'BuildID from apk_elf_result did not match') 'BuildID from apk_elf_result did not match')
...@@ -1102,15 +1110,16 @@ def _ParseApkElfSectionSize(section_sizes, metadata, apk_elf_result): ...@@ -1102,15 +1110,16 @@ def _ParseApkElfSectionSize(section_sizes, metadata, apk_elf_result):
packed_section_name = '.rela.dyn' packed_section_name = '.rela.dyn'
if packed_section_name: if packed_section_name:
unpacked_size = section_sizes.get(packed_section_name) unpacked_range = section_ranges.get(packed_section_name)
if unpacked_size is None: if unpacked_range is None:
logging.warning('Packed section not present: %s', packed_section_name) logging.warning('Packed section not present: %s', packed_section_name)
elif unpacked_size != apk_section_sizes.get(packed_section_name): elif unpacked_range != apk_section_ranges.get(packed_section_name):
# These sizes are different only when using relocation_packer, which # These ranges are different only when using relocation_packer, which
# hasn't been used since switching from gold -> lld. # hasn't been used since switching from gold -> lld.
apk_section_sizes['%s (unpacked)' % packed_section_name] = unpacked_size apk_section_ranges['%s (unpacked)' %
return apk_section_sizes, elf_overhead_size packed_section_name] = unpacked_range
return section_sizes, 0 return apk_section_ranges, elf_overhead_size
return section_ranges, 0
class _ResourcePathDeobfuscator: class _ResourcePathDeobfuscator:
...@@ -1151,7 +1160,7 @@ class _ResourcePathDeobfuscator: ...@@ -1151,7 +1160,7 @@ class _ResourcePathDeobfuscator:
return path return path
def _ParseApkOtherSymbols(section_sizes, apk_path, apk_so_path, def _ParseApkOtherSymbols(section_ranges, apk_path, apk_so_path,
resources_pathmap_path, size_info_prefix, knobs): resources_pathmap_path, size_info_prefix, knobs):
res_source_mapper = _ResourceSourceMapper(size_info_prefix, knobs) res_source_mapper = _ResourceSourceMapper(size_info_prefix, knobs)
resource_deobfuscator = _ResourcePathDeobfuscator(resources_pathmap_path) resource_deobfuscator = _ResourcePathDeobfuscator(resources_pathmap_path)
...@@ -1185,9 +1194,8 @@ def _ParseApkOtherSymbols(section_sizes, apk_path, apk_so_path, ...@@ -1185,9 +1194,8 @@ def _ParseApkOtherSymbols(section_sizes, apk_path, apk_so_path,
zip_overhead_symbol = models.Symbol( zip_overhead_symbol = models.Symbol(
models.SECTION_OTHER, overhead_size, full_name='Overhead: APK file') models.SECTION_OTHER, overhead_size, full_name='Overhead: APK file')
apk_symbols.append(zip_overhead_symbol) apk_symbols.append(zip_overhead_symbol)
prev = section_sizes.setdefault(models.SECTION_OTHER, 0) _ExtendSectionRange(section_ranges, models.SECTION_OTHER,
section_sizes[models.SECTION_OTHER] = prev + sum(s.size for s in apk_symbols) sum(s.size for s in apk_symbols))
return dex_size, apk_symbols return dex_size, apk_symbols
...@@ -1206,7 +1214,7 @@ def _CreatePakObjectMap(object_paths_by_name): ...@@ -1206,7 +1214,7 @@ def _CreatePakObjectMap(object_paths_by_name):
return object_paths_by_pak_id return object_paths_by_pak_id
def _FindPakSymbolsFromApk(section_sizes, apk_path, size_info_prefix, knobs): def _FindPakSymbolsFromApk(section_ranges, apk_path, size_info_prefix, knobs):
with zipfile.ZipFile(apk_path) as z: with zipfile.ZipFile(apk_path) as z:
pak_zip_infos = (f for f in z.infolist() if f.filename.endswith('.pak')) pak_zip_infos = (f for f in z.infolist() if f.filename.endswith('.pak'))
pak_info_path = size_info_prefix + '.pak.info' pak_info_path = size_info_prefix + '.pak.info'
...@@ -1224,8 +1232,7 @@ def _FindPakSymbolsFromApk(section_sizes, apk_path, size_info_prefix, knobs): ...@@ -1224,8 +1232,7 @@ def _FindPakSymbolsFromApk(section_sizes, apk_path, size_info_prefix, knobs):
section_name = _ComputePakFileSymbols( section_name = _ComputePakFileSymbols(
zip_info.filename, contents, zip_info.filename, contents,
res_info, symbols_by_id, compression_ratio=compression_ratio) res_info, symbols_by_id, compression_ratio=compression_ratio)
prev_size = section_sizes.get(section_name, 0) _ExtendSectionRange(section_ranges, section_name, zip_info.compress_size)
section_sizes[section_name] = prev_size + zip_info.compress_size
if total_uncompressed_size > 0: if total_uncompressed_size > 0:
actual_ratio = ( actual_ratio = (
...@@ -1237,8 +1244,8 @@ def _FindPakSymbolsFromApk(section_sizes, apk_path, size_info_prefix, knobs): ...@@ -1237,8 +1244,8 @@ def _FindPakSymbolsFromApk(section_sizes, apk_path, size_info_prefix, knobs):
return symbols_by_id return symbols_by_id
def _FindPakSymbolsFromFiles( def _FindPakSymbolsFromFiles(section_ranges, pak_files, pak_info_path,
section_sizes, pak_files, pak_info_path, output_directory): output_directory):
"""Uses files from args to find and add pak symbols.""" """Uses files from args to find and add pak symbols."""
res_info = _ParsePakInfoFile(pak_info_path) res_info = _ParsePakInfoFile(pak_info_path)
symbols_by_id = {} symbols_by_id = {}
...@@ -1248,15 +1255,16 @@ def _FindPakSymbolsFromFiles( ...@@ -1248,15 +1255,16 @@ def _FindPakSymbolsFromFiles(
section_name = _ComputePakFileSymbols( section_name = _ComputePakFileSymbols(
os.path.relpath(pak_file_path, output_directory), contents, res_info, os.path.relpath(pak_file_path, output_directory), contents, res_info,
symbols_by_id) symbols_by_id)
prev_size = section_sizes.get(section_name, 0) _ExtendSectionRange(section_ranges, section_name,
section_sizes[section_name] = prev_size + os.path.getsize(pak_file_path) os.path.getsize(pak_file_path))
return symbols_by_id return symbols_by_id
def _CalculateElfOverhead(section_sizes, elf_path): def _CalculateElfOverhead(section_ranges, elf_path):
if elf_path: if elf_path:
section_sizes_total_without_bss = sum( section_sizes_total_without_bss = sum(
s for k, s in section_sizes.iteritems() if k not in models.BSS_SECTIONS) size for k, (address, size) in section_ranges.iteritems()
if k not in models.BSS_SECTIONS)
elf_overhead_size = ( elf_overhead_size = (
os.path.getsize(elf_path) - section_sizes_total_without_bss) os.path.getsize(elf_path) - section_sizes_total_without_bss)
assert elf_overhead_size >= 0, ( assert elf_overhead_size >= 0, (
...@@ -1306,22 +1314,22 @@ def _OverwriteSymbolSizesWithRelocationCount(raw_symbols, tool_prefix, ...@@ -1306,22 +1314,22 @@ def _OverwriteSymbolSizesWithRelocationCount(raw_symbols, tool_prefix,
raw_symbols[:] = [sym for sym in raw_symbols if sym.size or sym.IsNative()] raw_symbols[:] = [sym for sym in raw_symbols if sym.size or sym.IsNative()]
def _AddUnattributedSectionSymbols(raw_symbols, section_sizes, elf_result): def _AddUnattributedSectionSymbols(raw_symbols, section_ranges, elf_result):
# Create symbols for ELF sections not covered by existing symbols. # Create symbols for ELF sections not covered by existing symbols.
logging.info('Searching for symbol gaps...') logging.info('Searching for symbol gaps...')
section_addresses = elf_result.get()[1] _, section_ranges, _ = elf_result.get()
last_symbol_ends = collections.defaultdict(int) last_symbol_ends = collections.defaultdict(int)
for sym in raw_symbols: for sym in raw_symbols:
if sym.end_address > last_symbol_ends[sym.section_name]: if sym.end_address > last_symbol_ends[sym.section_name]:
last_symbol_ends[sym.section_name] = sym.end_address last_symbol_ends[sym.section_name] = sym.end_address
for section_name, last_symbol_end in last_symbol_ends.iteritems(): for section_name, last_symbol_end in last_symbol_ends.iteritems():
size_from_syms = last_symbol_end - section_addresses[section_name] size_from_syms = last_symbol_end - section_ranges[section_name][0]
overhead = section_sizes[section_name] - size_from_syms overhead = section_ranges[section_name][1] - size_from_syms
assert overhead >= 0, ( assert overhead >= 0, (
('End of last symbol (%x) in section %s is %d bytes after the end of ' ('End of last symbol (%x) in section %s is %d bytes after the end of '
'section from readelf (%x).') % 'section from readelf (%x).') % (last_symbol_end, section_name,
(last_symbol_end, section_name, -overhead, -overhead,
section_sizes[section_name] + section_addresses[section_name])) sum(section_ranges[section_name])))
if overhead > 0 and section_name not in models.BSS_SECTIONS: if overhead > 0 and section_name not in models.BSS_SECTIONS:
raw_symbols.append( raw_symbols.append(
models.Symbol( models.Symbol(
...@@ -1332,19 +1340,20 @@ def _AddUnattributedSectionSymbols(raw_symbols, section_sizes, elf_result): ...@@ -1332,19 +1340,20 @@ def _AddUnattributedSectionSymbols(raw_symbols, section_sizes, elf_result):
logging.info('Last symbol in %s does not reach end of section, gap=%d', logging.info('Last symbol in %s does not reach end of section, gap=%d',
section_name, overhead) section_name, overhead)
for section_name in section_addresses: # Sort keys to ensure consistent order (> 1 sections may have address = 0).
for section_name in sorted(section_ranges.keys()):
# Handle sections that don't appear in |raw_symbols|. # Handle sections that don't appear in |raw_symbols|.
if section_name not in last_symbol_ends: if section_name not in last_symbol_ends:
section_size = section_sizes[section_name] address, section_size = section_ranges[section_name]
logging.info('All bytes in %s are unattributed, gap=%d', section_name, logging.info('All bytes in %s are unattributed, gap=%d', section_name,
overhead) overhead)
raw_symbols.append( raw_symbols.append(
models.Symbol( models.Symbol(
models.SECTION_OTHER, models.SECTION_OTHER,
section_size, section_size,
full_name='** ELF Section: {}'.format(section_name))) full_name='** ELF Section: {}'.format(section_name),
prev = section_sizes.setdefault(models.SECTION_OTHER, 0) address=address))
section_sizes[models.SECTION_OTHER] = prev + section_size _ExtendSectionRange(section_ranges, models.SECTION_OTHER, section_size)
def CreateSectionSizesAndSymbols(map_path=None, def CreateSectionSizesAndSymbols(map_path=None,
...@@ -1386,8 +1395,8 @@ def CreateSectionSizesAndSymbols(map_path=None, ...@@ -1386,8 +1395,8 @@ def CreateSectionSizesAndSymbols(map_path=None,
Returns: Returns:
A tuple of (section_sizes, raw_symbols). A tuple of (section_sizes, raw_symbols).
section_sizes is a dict mapping section names to their size section_ranges is a dict mapping section names to their (address, size).
raw_symbols is a list of Symbol objects raw_symbols is a list of Symbol objects.
""" """
knobs = knobs or SectionSizeKnobs() knobs = knobs or SectionSizeKnobs()
if apk_path and elf_path: if apk_path and elf_path:
...@@ -1444,7 +1453,7 @@ def CreateSectionSizesAndSymbols(map_path=None, ...@@ -1444,7 +1453,7 @@ def CreateSectionSizesAndSymbols(map_path=None,
thin_archives=thin_archives) thin_archives=thin_archives)
if knobs.analyze_native: if knobs.analyze_native:
section_sizes, raw_symbols, object_paths_by_name = _ParseElfInfo( section_ranges, raw_symbols, object_paths_by_name = _ParseElfInfo(
map_path, map_path,
elf_path, elf_path,
tool_prefix, tool_prefix,
...@@ -1452,22 +1461,25 @@ def CreateSectionSizesAndSymbols(map_path=None, ...@@ -1452,22 +1461,25 @@ def CreateSectionSizesAndSymbols(map_path=None,
outdir_context=outdir_context, outdir_context=outdir_context,
linker_name=linker_name) linker_name=linker_name)
else: else:
section_sizes, raw_symbols, object_paths_by_name = {}, [], None section_ranges, raw_symbols, object_paths_by_name = {}, [], None
elf_overhead_size = _CalculateElfOverhead(section_sizes, elf_path) elf_overhead_size = _CalculateElfOverhead(section_ranges, elf_path)
pak_symbols_by_id = None pak_symbols_by_id = None
if apk_path and size_info_prefix: if apk_path and size_info_prefix:
if elf_path: if elf_path:
section_sizes, elf_overhead_size = _ParseApkElfSectionSize( section_ranges, elf_overhead_size = _ParseApkElfSectionRanges(
section_sizes, metadata, apk_elf_result) section_ranges, metadata, apk_elf_result)
_AddUnattributedSectionSymbols(raw_symbols, section_sizes, apk_elf_result) _AddUnattributedSectionSymbols(raw_symbols, section_ranges,
apk_elf_result)
pak_symbols_by_id = _FindPakSymbolsFromApk( # Can modify |section_ranges|.
section_sizes, apk_path, size_info_prefix, knobs) pak_symbols_by_id = _FindPakSymbolsFromApk(section_ranges, apk_path,
size_info_prefix, knobs)
# Can modify |section_ranges|.
dex_size, other_symbols = _ParseApkOtherSymbols( dex_size, other_symbols = _ParseApkOtherSymbols(
section_sizes, apk_path, apk_so_path, resources_pathmap_path, section_ranges, apk_path, apk_so_path, resources_pathmap_path,
size_info_prefix, knobs) size_info_prefix, knobs)
if knobs.analyze_java: if knobs.analyze_java:
...@@ -1482,14 +1494,14 @@ def CreateSectionSizesAndSymbols(map_path=None, ...@@ -1482,14 +1494,14 @@ def CreateSectionSizesAndSymbols(map_path=None,
round( round(
sum(s.pss for s in dex_symbols sum(s.pss for s in dex_symbols
if s.section_name == models.SECTION_DEX_METHOD))) if s.section_name == models.SECTION_DEX_METHOD)))
section_sizes[models.SECTION_DEX_METHOD] = dex_method_size section_ranges[models.SECTION_DEX_METHOD] = (0, dex_method_size)
section_sizes[models.SECTION_DEX] = dex_size - dex_method_size section_ranges[models.SECTION_DEX] = (0, dex_size - dex_method_size)
dex_other_size = int( dex_other_size = int(
round( round(
sum(s.pss for s in dex_symbols sum(s.pss for s in dex_symbols
if s.section_name == models.SECTION_DEX))) if s.section_name == models.SECTION_DEX)))
unattributed_dex = section_sizes[models.SECTION_DEX] - dex_other_size unattributed_dex = section_ranges[models.SECTION_DEX][1] - dex_other_size
# Compare against -5 instead of 0 to guard against round-off errors. # Compare against -5 instead of 0 to guard against round-off errors.
assert unattributed_dex >= -5, ('Dex symbols take up more space than ' assert unattributed_dex >= -5, ('Dex symbols take up more space than '
'the dex sections have available') 'the dex sections have available')
...@@ -1503,14 +1515,14 @@ def CreateSectionSizesAndSymbols(map_path=None, ...@@ -1503,14 +1515,14 @@ def CreateSectionSizesAndSymbols(map_path=None,
raw_symbols.extend(other_symbols) raw_symbols.extend(other_symbols)
elif pak_files and pak_info_file: elif pak_files and pak_info_file:
# Can modify |section_ranges|.
pak_symbols_by_id = _FindPakSymbolsFromFiles( pak_symbols_by_id = _FindPakSymbolsFromFiles(
section_sizes, pak_files, pak_info_file, output_directory) section_ranges, pak_files, pak_info_file, output_directory)
if elf_path: if elf_path:
elf_overhead_symbol = models.Symbol( elf_overhead_symbol = models.Symbol(
models.SECTION_OTHER, elf_overhead_size, full_name='Overhead: ELF file') models.SECTION_OTHER, elf_overhead_size, full_name='Overhead: ELF file')
prev = section_sizes.setdefault(models.SECTION_OTHER, 0) _ExtendSectionRange(section_ranges, models.SECTION_OTHER, elf_overhead_size)
section_sizes[models.SECTION_OTHER] = prev + elf_overhead_size
raw_symbols.append(elf_overhead_symbol) raw_symbols.append(elf_overhead_symbol)
if pak_symbols_by_id: if pak_symbols_by_id:
...@@ -1532,6 +1544,7 @@ def CreateSectionSizesAndSymbols(map_path=None, ...@@ -1532,6 +1544,7 @@ def CreateSectionSizesAndSymbols(map_path=None,
if elf_path and knobs.relocations_mode: if elf_path and knobs.relocations_mode:
_OverwriteSymbolSizesWithRelocationCount(raw_symbols, tool_prefix, elf_path) _OverwriteSymbolSizesWithRelocationCount(raw_symbols, tool_prefix, elf_path)
section_sizes = {k: size for k, (address, size) in section_ranges.items()}
return section_sizes, raw_symbols return section_sizes, raw_symbols
...@@ -1581,19 +1594,17 @@ def BuildIdFromElf(elf_path, tool_prefix): ...@@ -1581,19 +1594,17 @@ def BuildIdFromElf(elf_path, tool_prefix):
def _SectionInfoFromElf(elf_path, tool_prefix): def _SectionInfoFromElf(elf_path, tool_prefix):
args = [path_util.GetReadElfPath(tool_prefix), '-S', '--wide', elf_path] args = [path_util.GetReadElfPath(tool_prefix), '-S', '--wide', elf_path]
stdout = subprocess.check_output(args) stdout = subprocess.check_output(args)
section_addresses = {} section_ranges = {}
section_sizes = {}
# Matches [ 2] .hash HASH 00000000006681f0 0001f0 003154 04 A 3 0 8 # Matches [ 2] .hash HASH 00000000006681f0 0001f0 003154 04 A 3 0 8
for match in re.finditer(r'\[[\s\d]+\] (\..*)$', stdout, re.MULTILINE): for match in re.finditer(r'\[[\s\d]+\] (\..*)$', stdout, re.MULTILINE):
items = match.group(1).split() items = match.group(1).split()
section_addresses[items[0]] = int(items[2], 16) section_ranges[items[0]] = (int(items[2], 16), int(items[4], 16))
section_sizes[items[0]] = int(items[4], 16) return section_ranges
return section_addresses, section_sizes
def _ElfIsMainPartition(elf_path, tool_prefix): def _ElfIsMainPartition(elf_path, tool_prefix):
_, section_sizes = _SectionInfoFromElf(elf_path, tool_prefix) section_ranges = _SectionInfoFromElf(elf_path, tool_prefix)
return models.SECTION_PART_END in section_sizes.keys() return models.SECTION_PART_END in section_ranges.keys()
def _ArchFromElf(elf_path, tool_prefix): def _ArchFromElf(elf_path, tool_prefix):
...@@ -1637,15 +1648,15 @@ def _DetectLinkerName(map_path): ...@@ -1637,15 +1648,15 @@ def _DetectLinkerName(map_path):
def _ElfInfoFromApk(apk_path, apk_so_path, tool_prefix): def _ElfInfoFromApk(apk_path, apk_so_path, tool_prefix):
"""Returns a tuple of (build_id, section_sizes, elf_overhead_size).""" """Returns a tuple of (build_id, section_ranges, elf_overhead_size)."""
with zipfile.ZipFile(apk_path) as apk, \ with zipfile.ZipFile(apk_path) as apk, \
tempfile.NamedTemporaryFile() as f: tempfile.NamedTemporaryFile() as f:
f.write(apk.read(apk_so_path)) f.write(apk.read(apk_so_path))
f.flush() f.flush()
build_id = BuildIdFromElf(f.name, tool_prefix) build_id = BuildIdFromElf(f.name, tool_prefix)
section_addresses, section_sizes = _SectionInfoFromElf(f.name, tool_prefix) section_ranges = _SectionInfoFromElf(f.name, tool_prefix)
elf_overhead_size = _CalculateElfOverhead(section_sizes, f.name) elf_overhead_size = _CalculateElfOverhead(section_ranges, f.name)
return build_id, section_addresses, section_sizes, elf_overhead_size return build_id, section_ranges, elf_overhead_size
def _AutoIdentifyInputFile(args): def _AutoIdentifyInputFile(args):
......
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Simple utilities for printf debugging."""
import sys
def _joinArgs(args):
return ' '.join(str(t) for t in args) + '\n'
def out(*args):
sys.stderr.write(_joinArgs(args))
def outR(*args):
sys.stderr.write('\x1b[91m%s\x1b[0m' % _joinArgs(args))
def outG(*args):
sys.stderr.write('\x1b[92m%s\x1b[0m' % _joinArgs(args))
def outY(*args):
sys.stderr.write('\x1b[93m%s\x1b[0m' % _joinArgs(args))
def outB(*args):
sys.stderr.write('\x1b[94m%s\x1b[0m' % _joinArgs(args))
def outM(*args):
sys.stderr.write('\x1b[95m%s\x1b[0m' % _joinArgs(args))
def outC(*args):
sys.stderr.write('\x1b[96m%s\x1b[0m' % _joinArgs(args))
...@@ -87,7 +87,7 @@ class MapFileParserGold(object): ...@@ -87,7 +87,7 @@ class MapFileParserGold(object):
def __init__(self): def __init__(self):
self._common_symbols = [] self._common_symbols = []
self._symbols = [] self._symbols = []
self._section_sizes = {} self._section_ranges = {}
self._lines = None self._lines = None
def Parse(self, lines): def Parse(self, lines):
...@@ -98,7 +98,7 @@ class MapFileParserGold(object): ...@@ -98,7 +98,7 @@ class MapFileParserGold(object):
identify file type. identify file type.
Returns: Returns:
A tuple of (section_sizes, symbols, extras). A tuple of (section_ranges, symbols, extras).
""" """
self._lines = iter(lines) self._lines = iter(lines)
logging.debug('Scanning for Header') logging.debug('Scanning for Header')
...@@ -112,7 +112,7 @@ class MapFileParserGold(object): ...@@ -112,7 +112,7 @@ class MapFileParserGold(object):
elif line.startswith('Memory map'): elif line.startswith('Memory map'):
self._ParseSections() self._ParseSections()
break break
return self._section_sizes, self._symbols, {} return self._section_ranges, self._symbols, {}
def _SkipToLineWithPrefix(self, prefix, prefix2=None): def _SkipToLineWithPrefix(self, prefix, prefix2=None):
for l in self._lines: for l in self._lines:
...@@ -192,7 +192,7 @@ class MapFileParserGold(object): ...@@ -192,7 +192,7 @@ class MapFileParserGold(object):
section_name, section_address_str, section_size_str = parts section_name, section_address_str, section_size_str = parts
section_address = int(section_address_str[2:], 16) section_address = int(section_address_str[2:], 16)
section_size = int(section_size_str[2:], 16) section_size = int(section_size_str[2:], 16)
self._section_sizes[section_name] = section_size self._section_ranges[section_name] = (section_address, section_size)
if (section_name in models.BSS_SECTIONS if (section_name in models.BSS_SECTIONS
or section_name in (models.SECTION_RODATA, models.SECTION_TEXT) or section_name in (models.SECTION_RODATA, models.SECTION_TEXT)
or section_name.startswith(models.SECTION_DATA)): or section_name.startswith(models.SECTION_DATA)):
...@@ -338,7 +338,7 @@ class MapFileParserLld(object): ...@@ -338,7 +338,7 @@ class MapFileParserLld(object):
def __init__(self, linker_name): def __init__(self, linker_name):
self._linker_name = linker_name self._linker_name = linker_name
self._common_symbols = [] self._common_symbols = []
self._section_sizes = {} self._section_ranges = {}
@staticmethod @staticmethod
def ParseArmAnnotations(tok): def ParseArmAnnotations(tok):
...@@ -428,7 +428,7 @@ class MapFileParserLld(object): ...@@ -428,7 +428,7 @@ class MapFileParserLld(object):
identify file type. identify file type.
Returns: Returns:
A tuple of (section_sizes, symbols). A tuple of (section_ranges, symbols).
""" """
# Newest format: # Newest format:
# VMA LMA Size Align Out In Symbol # VMA LMA Size Align Out In Symbol
...@@ -513,7 +513,7 @@ class MapFileParserLld(object): ...@@ -513,7 +513,7 @@ class MapFileParserLld(object):
cur_section_is_useful = False cur_section_is_useful = False
else: else:
if not tok.startswith('PROVIDE_HIDDEN'): if not tok.startswith('PROVIDE_HIDDEN'):
self._section_sizes[tok] = size self._section_ranges[tok] = (address, size)
cur_section = tok cur_section = tok
# E.g., Want to convert "(.text._name)" -> "_name" later. # E.g., Want to convert "(.text._name)" -> "_name" later.
mangled_start_idx = len(cur_section) + 2 mangled_start_idx = len(cur_section) + 2
...@@ -657,7 +657,7 @@ class MapFileParserLld(object): ...@@ -657,7 +657,7 @@ class MapFileParserLld(object):
if jump_tables_count: if jump_tables_count:
logging.info('Found %d CFI jump tables with %d total entries', logging.info('Found %d CFI jump tables with %d total entries',
jump_tables_count, jump_entries_count) jump_tables_count, jump_entries_count)
return self._section_sizes, syms, {'thin_map': thin_map} return self._section_ranges, syms, {'thin_map': thin_map}
def _DetectLto(lines): def _DetectLto(lines):
...@@ -727,7 +727,7 @@ class MapFileParser(object): ...@@ -727,7 +727,7 @@ class MapFileParser(object):
lines: Iterable of lines from the linker map. lines: Iterable of lines from the linker map.
Returns: Returns:
A tuple of (section_sizes, symbols, extras). A tuple of (section_ranges, symbols, extras).
""" """
next(lines) # Consume the first line of headers. next(lines) # Consume the first line of headers.
if linker_name.startswith('lld'): if linker_name.startswith('lld'):
...@@ -737,13 +737,13 @@ class MapFileParser(object): ...@@ -737,13 +737,13 @@ class MapFileParser(object):
else: else:
raise Exception('.map file is from a unsupported linker.') raise Exception('.map file is from a unsupported linker.')
section_sizes, syms, extras = inner_parser.Parse(lines) section_ranges, syms, extras = inner_parser.Parse(lines)
for sym in syms: for sym in syms:
if sym.object_path and not sym.object_path.endswith(')'): if sym.object_path and not sym.object_path.endswith(')'):
# Don't want '' to become '.'. # Don't want '' to become '.'.
# Thin archives' paths will get fixed in |ar.CreateThinObjectPath|. # Thin archives' paths will get fixed in |ar.CreateThinObjectPath|.
sym.object_path = os.path.normpath(sym.object_path) sym.object_path = os.path.normpath(sym.object_path)
return (section_sizes, syms, extras) return (section_ranges, syms, extras)
def DeduceObjectPathsFromThinMap(raw_symbols, extras): def DeduceObjectPathsFromThinMap(raw_symbols, extras):
...@@ -820,20 +820,24 @@ def main(): ...@@ -820,20 +820,24 @@ def main():
print('Linker type: %s' % linker_name) print('Linker type: %s' % linker_name)
with open(args.linker_file, 'r') as map_file: with open(args.linker_file, 'r') as map_file:
section_sizes, syms, extras = MapFileParser().Parse(linker_name, map_file) section_ranges, syms, extras = MapFileParser().Parse(linker_name, map_file)
if args.dump: if args.dump:
print(section_sizes) print(section_ranges)
for sym in syms: for sym in syms:
print(sym) print(sym)
else: else:
# Enter interactive shell. # Enter interactive shell.
readline.parse_and_bind('tab: complete') readline.parse_and_bind('tab: complete')
variables = {'section_sizes': section_sizes, 'syms': syms, 'extras': extras} variables = {
'section_ranges': section_ranges,
'syms': syms,
'extras': extras
}
banner_lines = [ banner_lines = [
'*' * 80, '*' * 80,
'Variables:', 'Variables:',
' section_sizes: Map from section to sizes.', ' section_ranges: Map from section name to (address, size).',
' syms: Raw symbols parsed from the linker map file.', ' syms: Raw symbols parsed from the linker map file.',
' extras: Format-specific extra data.', ' extras: Format-specific extra data.',
'*' * 80, '*' * 80,
......
...@@ -51,8 +51,9 @@ def _ReadMapFile(map_file): ...@@ -51,8 +51,9 @@ def _ReadMapFile(map_file):
def _RenderSectionSizesAndRawSymbols(section_sizes, raw_symbols): def _RenderSectionSizesAndRawSymbols(section_sizes, raw_symbols):
ret = [] ret = []
ret.append('******** section_sizes ********') ret.append('******** section_sizes ********')
for k, v in sorted(section_sizes.iteritems()): for k, (address, size) in sorted(section_sizes.items()):
ret.append('%-24s %d' % (k, v)) address_text = '@%x' % address
ret.append('%-24s %-9s %d' % (k, address_text, size))
ret.append('') ret.append('')
ret.append('******** raw_symbols ********') ret.append('******** raw_symbols ********')
for sym in raw_symbols: for sym in raw_symbols:
......
...@@ -289,33 +289,33 @@ Section .other: has 100.0% of 95595797 bytes accounted for from 27 symbols. 0 by ...@@ -289,33 +289,33 @@ Section .other: has 100.0% of 95595797 bytes accounted for from 27 symbols. 0 by
.dex.method@0(size_without_padding=79,padding=0,full_name=org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimationLandscape#getScreenPositionInScrollDirection(org.chromium.chrome.browser.compositor.layouts.phone.stack.StackTab): float,object_path=$APK/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimationLandscape,source_path=,flags={},num_aliases=1,component=) .dex.method@0(size_without_padding=79,padding=0,full_name=org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimationLandscape#getScreenPositionInScrollDirection(org.chromium.chrome.browser.compositor.layouts.phone.stack.StackTab): float,object_path=$APK/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimationLandscape,source_path=,flags={},num_aliases=1,component=)
.dex.method@0(size_without_padding=54,padding=0,full_name=org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimationLandscape#getScreenSizeInScrollDirection(): float,object_path=$APK/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimationLandscape,source_path=,flags={},num_aliases=1,component=) .dex.method@0(size_without_padding=54,padding=0,full_name=org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimationLandscape#getScreenSizeInScrollDirection(): float,object_path=$APK/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimationLandscape,source_path=,flags={},num_aliases=1,component=)
.dex.method@0(size_without_padding=52,padding=0,full_name=org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimationLandscape#isDefaultDiscardDirectionPositive(): boolean,object_path=$APK/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimationLandscape,source_path=,flags={},num_aliases=1,component=) .dex.method@0(size_without_padding=52,padding=0,full_name=org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimationLandscape#isDefaultDiscardDirectionPositive(): boolean,object_path=$APK/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimationLandscape,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=2655384,padding=0,full_name=** ELF Section: .rel.dyn,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=60,padding=0,full_name=** ELF Section: .ARM.attributes,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=2816,padding=0,full_name=** ELF Section: .rel.plt,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=19,padding=0,full_name=** ELF Section: .interp,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=28,padding=0,full_name=** ELF Section: .note.gnu.gold-version,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=28,padding=0,full_name=** ELF Section: .note.gnu.gold-version,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=6496,padding=0,full_name=** ELF Section: .dynsym,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=42956,padding=0,full_name=** ELF Section: .got,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=812,padding=0,full_name=** ELF Section: .gnu.version,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=28,padding=0,full_name=** ELF Section: .gnu.version_d,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=436,padding=0,full_name=** ELF Section: .shstrtab,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=436,padding=0,full_name=** ELF Section: .shstrtab,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=36,padding=0,full_name=** ELF Section: .note.gnu.build-id,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=17166112,padding=0,full_name=** ELF Section: .symtab,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=96,padding=0,full_name=** ELF Section: .gnu.version_r,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=4025,padding=0,full_name=** ELF Section: .dynstr,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=2684,padding=0,full_name=** ELF Section: .hash,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=183632,padding=0,full_name=** ELF Section: .ARM.extab,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=1536456,padding=0,full_name=** ELF Section: .ARM.exidx,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=8,padding=0,full_name=** ELF Section: .fini_array,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=8,padding=0,full_name=** ELF Section: .init_array,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=304,padding=0,full_name=** ELF Section: .dynamic,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=4244,padding=0,full_name=** ELF Section: .plt,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=34841854,padding=0,full_name=** ELF Section: .strtab,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=34841854,padding=0,full_name=** ELF Section: .strtab,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=60,padding=0,full_name=** ELF Section: .ARM.attributes,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=17166112,padding=0,full_name=** ELF Section: .symtab,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=4194304,padding=0,full_name=smalltest.so,object_path=,source_path=$APK/smalltest.so,flags={gen},num_aliases=1,component=) .other@0(size_without_padding=4194304,padding=0,full_name=smalltest.so,object_path=,source_path=$APK/smalltest.so,flags={gen},num_aliases=1,component=)
.other@0(size_without_padding=1048576,padding=0,full_name=assets/icudtl.dat,object_path=,source_path=third_party/icu/android/icudtl.dat,flags={},num_aliases=1,component=Internal>Android) .other@0(size_without_padding=1048576,padding=0,full_name=assets/icudtl.dat,object_path=,source_path=third_party/icu/android/icudtl.dat,flags={},num_aliases=1,component=Internal>Android)
.other@0(size_without_padding=1024,padding=0,full_name=res/drawable-v13/test.xml,object_path=,source_path=chrome/android/res/drawable/test.xml,flags={},num_aliases=1,component=) .other@0(size_without_padding=1024,padding=0,full_name=res/drawable-v13/test.xml,object_path=,source_path=chrome/android/res/drawable/test.xml,flags={},num_aliases=1,component=)
.other@0(size_without_padding=0,padding=764,full_name=Overhead: APK file,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=0,padding=764,full_name=Overhead: APK file,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=0,padding=33902635,full_name=Overhead: ELF file,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=0,padding=33902635,full_name=Overhead: ELF file,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@154(size_without_padding=19,padding=0,full_name=** ELF Section: .interp,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@168(size_without_padding=36,padding=0,full_name=** ELF Section: .note.gnu.build-id,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@18c(size_without_padding=6496,padding=0,full_name=** ELF Section: .dynsym,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@1b0c(size_without_padding=4025,padding=0,full_name=** ELF Section: .dynstr,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2ad4(size_without_padding=2684,padding=0,full_name=** ELF Section: .hash,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@3558(size_without_padding=812,padding=0,full_name=** ELF Section: .gnu.version,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@3888(size_without_padding=28,padding=0,full_name=** ELF Section: .gnu.version_d,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@38a4(size_without_padding=96,padding=0,full_name=** ELF Section: .gnu.version_r,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@3904(size_without_padding=2655384,padding=0,full_name=** ELF Section: .rel.dyn,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@29fbec(size_without_padding=2816,padding=0,full_name=** ELF Section: .rel.plt,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2a06ec(size_without_padding=4244,padding=0,full_name=** ELF Section: .plt,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2bd3d10(size_without_padding=1536456,padding=0,full_name=** ELF Section: .ARM.exidx,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2bd5858(size_without_padding=183632,padding=0,full_name=** ELF Section: .ARM.extab,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2ddc608(size_without_padding=8,padding=0,full_name=** ELF Section: .init_array,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2ddc6f4(size_without_padding=8,padding=0,full_name=** ELF Section: .fini_array,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2ddc6fc(size_without_padding=304,padding=0,full_name=** ELF Section: .dynamic,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2ddc834(size_without_padding=42956,padding=0,full_name=** ELF Section: .got,object_path=,source_path=,flags={},num_aliases=1,component=)
.rodata@266e600(size_without_padding=5,padding=0,full_name="Str1",object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={},num_aliases=2,component=Blink>Internal) .rodata@266e600(size_without_padding=5,padding=0,full_name="Str1",object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={},num_aliases=2,component=Blink>Internal)
.rodata@266e600(size_without_padding=5,padding=0,full_name="Str1",object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen},num_aliases=2,component=Internal>Android) .rodata@266e600(size_without_padding=5,padding=0,full_name="Str1",object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen},num_aliases=2,component=Internal>Android)
.rodata@266e605(size_without_padding=16,padding=0,full_name="String literal2",object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen},num_aliases=1,component=Internal>Android) .rodata@266e605(size_without_padding=16,padding=0,full_name="String literal2",object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen},num_aliases=1,component=Internal>Android)
......
...@@ -290,33 +290,33 @@ Section .other: has 100.0% of 95595797 bytes accounted for from 27 symbols. 0 by ...@@ -290,33 +290,33 @@ Section .other: has 100.0% of 95595797 bytes accounted for from 27 symbols. 0 by
.dex.method@0(size_without_padding=79,padding=0,full_name=org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimationLandscape#getScreenPositionInScrollDirection(org.chromium.chrome.browser.compositor.layouts.phone.stack.StackTab): float,object_path=$APK/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimationLandscape,source_path=,flags={},num_aliases=1,component=) .dex.method@0(size_without_padding=79,padding=0,full_name=org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimationLandscape#getScreenPositionInScrollDirection(org.chromium.chrome.browser.compositor.layouts.phone.stack.StackTab): float,object_path=$APK/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimationLandscape,source_path=,flags={},num_aliases=1,component=)
.dex.method@0(size_without_padding=54,padding=0,full_name=org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimationLandscape#getScreenSizeInScrollDirection(): float,object_path=$APK/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimationLandscape,source_path=,flags={},num_aliases=1,component=) .dex.method@0(size_without_padding=54,padding=0,full_name=org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimationLandscape#getScreenSizeInScrollDirection(): float,object_path=$APK/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimationLandscape,source_path=,flags={},num_aliases=1,component=)
.dex.method@0(size_without_padding=52,padding=0,full_name=org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimationLandscape#isDefaultDiscardDirectionPositive(): boolean,object_path=$APK/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimationLandscape,source_path=,flags={},num_aliases=1,component=) .dex.method@0(size_without_padding=52,padding=0,full_name=org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimationLandscape#isDefaultDiscardDirectionPositive(): boolean,object_path=$APK/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackAnimationLandscape,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=2655384,padding=0,full_name=** ELF Section: .rel.dyn,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=60,padding=0,full_name=** ELF Section: .ARM.attributes,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=2816,padding=0,full_name=** ELF Section: .rel.plt,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=19,padding=0,full_name=** ELF Section: .interp,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=28,padding=0,full_name=** ELF Section: .note.gnu.gold-version,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=28,padding=0,full_name=** ELF Section: .note.gnu.gold-version,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=6496,padding=0,full_name=** ELF Section: .dynsym,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=42956,padding=0,full_name=** ELF Section: .got,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=812,padding=0,full_name=** ELF Section: .gnu.version,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=28,padding=0,full_name=** ELF Section: .gnu.version_d,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=436,padding=0,full_name=** ELF Section: .shstrtab,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=436,padding=0,full_name=** ELF Section: .shstrtab,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=36,padding=0,full_name=** ELF Section: .note.gnu.build-id,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=17166112,padding=0,full_name=** ELF Section: .symtab,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=96,padding=0,full_name=** ELF Section: .gnu.version_r,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=4025,padding=0,full_name=** ELF Section: .dynstr,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=2684,padding=0,full_name=** ELF Section: .hash,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=183632,padding=0,full_name=** ELF Section: .ARM.extab,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=1536456,padding=0,full_name=** ELF Section: .ARM.exidx,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=8,padding=0,full_name=** ELF Section: .fini_array,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=8,padding=0,full_name=** ELF Section: .init_array,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=304,padding=0,full_name=** ELF Section: .dynamic,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=4244,padding=0,full_name=** ELF Section: .plt,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=34841854,padding=0,full_name=** ELF Section: .strtab,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=34841854,padding=0,full_name=** ELF Section: .strtab,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=60,padding=0,full_name=** ELF Section: .ARM.attributes,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=17166112,padding=0,full_name=** ELF Section: .symtab,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=4194304,padding=0,full_name=smalltest.so,object_path=,source_path=$APK/smalltest.so,flags={gen},num_aliases=1,component=) .other@0(size_without_padding=4194304,padding=0,full_name=smalltest.so,object_path=,source_path=$APK/smalltest.so,flags={gen},num_aliases=1,component=)
.other@0(size_without_padding=1048576,padding=0,full_name=assets/icudtl.dat,object_path=,source_path=third_party/icu/android/icudtl.dat,flags={},num_aliases=1,component=Internal>Android) .other@0(size_without_padding=1048576,padding=0,full_name=assets/icudtl.dat,object_path=,source_path=third_party/icu/android/icudtl.dat,flags={},num_aliases=1,component=Internal>Android)
.other@0(size_without_padding=1024,padding=0,full_name=res/drawable-v13/test.xml,object_path=,source_path=chrome/android/res/drawable/test.xml,flags={},num_aliases=1,component=) .other@0(size_without_padding=1024,padding=0,full_name=res/drawable-v13/test.xml,object_path=,source_path=chrome/android/res/drawable/test.xml,flags={},num_aliases=1,component=)
.other@0(size_without_padding=0,padding=764,full_name=Overhead: APK file,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=0,padding=764,full_name=Overhead: APK file,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@0(size_without_padding=0,padding=33902635,full_name=Overhead: ELF file,object_path=,source_path=,flags={},num_aliases=1,component=) .other@0(size_without_padding=0,padding=33902635,full_name=Overhead: ELF file,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@154(size_without_padding=19,padding=0,full_name=** ELF Section: .interp,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@168(size_without_padding=36,padding=0,full_name=** ELF Section: .note.gnu.build-id,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@18c(size_without_padding=6496,padding=0,full_name=** ELF Section: .dynsym,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@1b0c(size_without_padding=4025,padding=0,full_name=** ELF Section: .dynstr,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2ad4(size_without_padding=2684,padding=0,full_name=** ELF Section: .hash,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@3558(size_without_padding=812,padding=0,full_name=** ELF Section: .gnu.version,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@3888(size_without_padding=28,padding=0,full_name=** ELF Section: .gnu.version_d,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@38a4(size_without_padding=96,padding=0,full_name=** ELF Section: .gnu.version_r,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@3904(size_without_padding=2655384,padding=0,full_name=** ELF Section: .rel.dyn,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@29fbec(size_without_padding=2816,padding=0,full_name=** ELF Section: .rel.plt,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2a06ec(size_without_padding=4244,padding=0,full_name=** ELF Section: .plt,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2bd3d10(size_without_padding=1536456,padding=0,full_name=** ELF Section: .ARM.exidx,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2bd5858(size_without_padding=183632,padding=0,full_name=** ELF Section: .ARM.extab,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2ddc608(size_without_padding=8,padding=0,full_name=** ELF Section: .init_array,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2ddc6f4(size_without_padding=8,padding=0,full_name=** ELF Section: .fini_array,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2ddc6fc(size_without_padding=304,padding=0,full_name=** ELF Section: .dynamic,object_path=,source_path=,flags={},num_aliases=1,component=)
.other@2ddc834(size_without_padding=42956,padding=0,full_name=** ELF Section: .got,object_path=,source_path=,flags={},num_aliases=1,component=)
.rodata@266e600(size_without_padding=5,padding=0,full_name="Str1",object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={},num_aliases=2,component=Blink>Internal) .rodata@266e600(size_without_padding=5,padding=0,full_name="Str1",object_path=base/base/page_allocator.o,source_path=base/page_allocator.cc,flags={},num_aliases=2,component=Blink>Internal)
.rodata@266e600(size_without_padding=5,padding=0,full_name="Str1",object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen},num_aliases=2,component=Internal>Android) .rodata@266e600(size_without_padding=5,padding=0,full_name="Str1",object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen},num_aliases=2,component=Internal>Android)
.rodata@266e605(size_without_padding=16,padding=0,full_name="String literal2",object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen},num_aliases=1,component=Internal>Android) .rodata@266e605(size_without_padding=16,padding=0,full_name="String literal2",object_path=third_party/icu/icuuc/ucnv_ext.o,source_path=third_party/icu/ucnv_ext.c,flags={gen},num_aliases=1,component=Internal>Android)
......
******** section_sizes ******** ******** section_sizes ********
.ARM.attributes 35 .ARM.attributes @0 35
.ARM.exidx 1975928 .ARM.exidx @188 1975928
.ARM.extab 36860 .ARM.extab @82504c 36860
.bss 1089404 .bss @2f56000 1089404
.comment 168 .comment @0 168
.data 118728 .data @2d4c000 118728
.data.rel.ro 2013024 .data.rel.ro @2d69000 2013024
.dynamic 240 .dynamic @2f54778 240
.dynstr 3947 .dynstr @1e43fc 3947
.dynsym 6256 .dynsym @1e2800 6256
.fini_array 8 .fini_array @2f54760 8
.gnu.hash 28 .gnu.hash @1e43e0 28
.gnu.version 782 .gnu.version @1e4070 782
.gnu.version_r 96 .gnu.version_r @1e4380 96
.got 1452 .got @2f54868 1452
.got.plt 1528 .got.plt @2f54e14 1528
.init_array 16 .init_array @2f54768 16
.interp 19 .interp @174 19
.note.android.ident 152 .note.android.ident @213134 152
.note.crashpad.info 28 .note.crashpad.info @213118 28
.note.gnu.build-id 36 .note.gnu.build-id @2131cc 36
.part.end 4096 .part.end @0 4096
.plt 6096 .plt @2d4a7f0 6096
.rel.dyn 184789 .rel.dyn @1e5368 184789
.rel.plt 3032 .rel.plt @212540 3032
.rodata 6364747 .rodata @213200 6364747
.shstrtab 452 .shstrtab @0 452
.strtab 49754930 .strtab @0 49754930
.symtab 18626064 .symtab @0 18626064
.text 38909928 .text @82f000 38909928
******** raw_symbols ******** ******** raw_symbols ********
.rodata@213200(size_without_padding=4,padding=0,full_name=v8_Default_embedded_blob_size_,object_path=obj/v8/v8_external_snapshot/embedded.o,source_path=,flags={},num_aliases=1,component=) .rodata@213200(size_without_padding=4,padding=0,full_name=v8_Default_embedded_blob_size_,object_path=obj/v8/v8_external_snapshot/embedded.o,source_path=,flags={},num_aliases=1,component=)
......
******** section_sizes ******** ******** section_sizes ********
.ARM.extab 24100 .ARM.extab @8b02ec 24100
.data.rel.ro 2430180 .data.rel.ro @3255000 2430180
.rodata 6759914 .rodata @23dd00 6759914
.text 43636188 .text @8b6140 43636188
******** raw_symbols ******** ******** raw_symbols ********
.rodata@23dd00(size_without_padding=4,padding=0,full_name=v8_Default_embedded_blob_size_,object_path=obj/v8/v8_external_snapshot/embedded.o,source_path=,flags={},num_aliases=1,component=) .rodata@23dd00(size_without_padding=4,padding=0,full_name=v8_Default_embedded_blob_size_,object_path=obj/v8/v8_external_snapshot/embedded.o,source_path=,flags={},num_aliases=1,component=)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment