Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: tools/binary_size/libsupersize/archive.py

Issue 2869793002: supersize: Fix --toolprefix="" not being followed (Closed)
Patch Set: fix arch detection Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/binary_size/libsupersize/paths.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/binary_size/libsupersize/archive.py
diff --git a/tools/binary_size/libsupersize/archive.py b/tools/binary_size/libsupersize/archive.py
index 3016dd96fb586a7c5eb4afccc1199b79869245d7..8fa685b732bce08ca60ae4d981b50114ef3a3752 100644
--- a/tools/binary_size/libsupersize/archive.py
+++ b/tools/binary_size/libsupersize/archive.py
@@ -549,7 +549,16 @@ def _SectionSizesFromElf(elf_path, tool_prefix):
def _ArchFromElf(elf_path, tool_prefix):
args = [tool_prefix + 'readelf', '-h', elf_path]
stdout = subprocess.check_output(args)
- return re.search('Machine:\s*(\S+)', stdout).group(1)
+ machine = re.search('Machine:\s*(.+)', stdout).group(1)
+ if machine == 'Intel 80386':
+ return 'x86'
+ if machine == 'Advanced Micro Devices X86-64':
+ return 'x64'
+ elif machine == 'ARM':
+ return 'arm'
+ elif machine == 'AArch64':
+ return 'arm64'
+ return machine
def _ParseGnArgs(args_path):
@@ -664,9 +673,10 @@ def Run(args, parser):
packed_section_name = None
architecture = metadata[models.METADATA_ELF_ARCHITECTURE]
- if architecture == 'ARM':
+ # Packing occurs enabled only arm32 & arm64.
+ if architecture == 'arm':
packed_section_name = '.rel.dyn'
- elif architecture == 'AArch64':
+ elif architecture == 'arm64':
packed_section_name = '.rela.dyn'
if packed_section_name:
« no previous file with comments | « no previous file | tools/binary_size/libsupersize/paths.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698