From c4b62f5eb1f92ffd3f03d618619f2f98eaf37d1e Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Tue, 14 Oct 2003 21:49:21 +0000 Subject: [PATCH] fall back to dynamic symbol table if no symbols were found in the symtab section. bug 222165, r=dbaron git-svn-id: svn://10.0.0.236/trunk@147971 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/tools/jprof/bfd.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mozilla/tools/jprof/bfd.cpp b/mozilla/tools/jprof/bfd.cpp index dd3738871a5..df3f7c42db9 100644 --- a/mozilla/tools/jprof/bfd.cpp +++ b/mozilla/tools/jprof/bfd.cpp @@ -48,7 +48,7 @@ void leaky::ReadSymbols(const char *aFileName, u_long aBaseAddress) sp->Init(aFileName, aBaseAddress); NEXT_SYMBOL - static bfd_boolean kDynamic = (bfd_boolean) false; + bfd_boolean kDynamic = (bfd_boolean) false; static int firstTime = 1; if (firstTime) { @@ -73,6 +73,11 @@ void leaky::ReadSymbols(const char *aFileName, u_long aBaseAddress) PTR minisyms; unsigned int size; long symcount = bfd_read_minisymbols(lib, kDynamic, &minisyms, &size); + if (symcount == 0) { + // symtab is empty; try dynamic symbols + kDynamic = (bfd_boolean) true; + symcount = bfd_read_minisymbols(lib, kDynamic, &minisyms, &size); + } // Scan symbols bfd_byte* from = (bfd_byte *) minisyms;