From 68da4439ff80ed8eef5af72ba9699fa76853c6d1 Mon Sep 17 00:00:00 2001 From: Michael Krebs Date: Tue, 27 Mar 2012 14:44:13 -0700 Subject: [PATCH] Don't try to generate symbols for symbolic links In our build environment, we have lots of symbolic links such as "debug/.build-id/5c/a06545ff3812557dc5fd259db4e905c5dc3484.debug" that just link to another .debug file. In our case, those links don't actually point to the right place, so we've just been seeing lots of "Binary does not exist" warnings. But it would also be undesirable to actually generate symbols for these even if their targets *did* exist. BUG=None TEST=Ran cros_generate_breakpad_symbols Change-Id: I050c349f7fefbdf922d54250379bad9b3db073d7 Reviewed-on: https://gerrit.chromium.org/gerrit/19182 Commit-Ready: Michael Krebs Tested-by: Michael Krebs Reviewed-by: David James --- cros_generate_breakpad_symbols | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cros_generate_breakpad_symbols b/cros_generate_breakpad_symbols index 109186c2d0..78fa0417db 100755 --- a/cros_generate_breakpad_symbols +++ b/cros_generate_breakpad_symbols @@ -122,6 +122,14 @@ function dump_file() { function process_file() { local debug_file="$1" local text_file="$(get_text_for_debug ${debug_file})" + if [ -h "${debug_file}" ]; then + # Don't follow symbolic links. In particular, we don't want to bother + # with the *.debug links in the "debug/.build-id/" directory. + if [ ${FLAGS_verbose} -eq ${FLAGS_TRUE} ]; then + info "Skipping symbolic link: ${debug_file}" + fi + return 0 + fi if [ "${text_file##*.}" == "ko" ]; then # Skip kernel objects. We can't use their symbols and they sometimes # have objects with empty text sections which trigger errors in dump_sym. @@ -175,7 +183,7 @@ function main() { for either_file in ${FLAGS_ARGV}; do either_file=${either_file#\'} either_file=${either_file%\'} - if [ ! -f "${either_file}" ]; then + if [ ! -h "${either_file}" -a ! -f "${either_file}" ]; then error "Specified file ${either_file} does not exist" ANY_ERRORS=1 continue