Update gconv_strip to do scanelf search for multiple symbols at once
BUG=chromium:404636
TEST=Run `gconv_strip --dry-run /build/$BOARD/` with & without this change, confirm that the output are the same
Change-Id: I2868ca35aa05fb1d473acd9135417b7c4438211c
Reviewed-on: https://chromium-review.googlesource.com/1387170
Commit-Ready: Ned Nguyen <nednguyen@google.com>
Tested-by: Ned Nguyen <nednguyen@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/gconv_strip.py b/scripts/gconv_strip.py
index f4c038f..9992e04 100644
--- a/scripts/gconv_strip.py
+++ b/scripts/gconv_strip.py
@@ -259,15 +259,13 @@
# Use scanelf to search for all the binary files on the rootfs that require
# or define the symbol iconv_open. We also include the binaries that define
# it since there could be internal calls to it from other functions.
- files = set()
- for symbol in GCONV_SYMBOLS:
- cmd = ['scanelf', '--mount', '--quiet', '--recursive', '--format', '#s%F',
- '--symbol', symbol, opts.root]
- result = cros_build_lib.RunCommand(cmd, redirect_stdout=True,
- print_cmd=False)
- symbol_files = result.output.splitlines()
- logging.debug('Symbol %s found on %d files.', symbol, len(symbol_files))
- files.update(symbol_files)
+ symbols = ','.join(GCONV_SYMBOLS)
+ cmd = ['scanelf', '--mount', '--quiet', '--recursive', '--format', '#s%F',
+ '--symbol', symbols, opts.root]
+ result = cros_build_lib.RunCommand(cmd, redirect_stdout=True,
+ print_cmd=False)
+ files = set(result.output.splitlines())
+ logging.debug('Symbols %s found on %d files.', symbols, len(files))
# The charsets are represented as nul-terminated strings in the binary files,
# so we append the '\0' to each string. This prevents some false positives