Update of /cvsroot/oprofile/oprofile/libutil++
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31585/libutil++
Modified Files:
bfd_support.cpp op_bfd.cpp op_bfd.h
Log Message:
Fix a couple problems relating to overlay symbols for Cell SPE applications
Index: bfd_support.cpp
===================================================================
RCS file: /cvsroot/oprofile/oprofile/libutil++/bfd_support.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -p -d -r1.10 -r1.11
--- bfd_support.cpp 3 Jul 2008 17:12:06 -0000 1.10
+++ bfd_support.cpp 7 Aug 2008 13:01:16 -0000 1.11
@@ -364,6 +364,9 @@ bool interesting_symbol(asymbol * sym)
if (!strcmp("gcc2_compiled.", sym->name))
return false;
+ if (sym->flags & BSF_SECTION_SYM)
+ return false;
+
return true;
}
Index: op_bfd.cpp
===================================================================
RCS file: /cvsroot/oprofile/oprofile/libutil++/op_bfd.cpp,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -p -d -r1.84 -r1.85
--- op_bfd.cpp 3 Jul 2008 17:12:06 -0000 1.84
+++ op_bfd.cpp 7 Aug 2008 13:01:16 -0000 1.85
@@ -91,6 +91,11 @@ bool op_bfd_symbol::operator<(op_bfd_sym
return filepos() < rhs.filepos();
}
+unsigned long op_bfd_symbol::symbol_endpos(void) const
+{
+ return bfd_symbol->section->filepos + bfd_symbol->section->size;
+}
+
op_bfd::op_bfd(string const & fname, string_filter const & symbol_filter,
extra_images const & extra_images, bool & ok)
@@ -245,7 +250,8 @@ void op_bfd::get_symbols(op_bfd::symbols
while (it != symbols.end()) {
symbols_found_t::iterator temp = it;
++temp;
- if (temp != symbols.end() && (it->vma() == temp->vma())) {
+ if (temp != symbols.end() && (it->vma() == temp->vma()) &&
+ (it->filepos() == temp->filepos())) {
if (boring_symbol(*it, *temp)) {
it = symbols.erase(it);
} else {
@@ -382,7 +388,12 @@ size_t op_bfd::symbol_size(op_bfd_symbol
op_bfd_symbol const * next) const
{
unsigned long long start = sym.filepos();
- unsigned long long end = next ? next->filepos() : file_size;
+ unsigned long long end;
+
+ if (next && (sym.section() != next->section()))
+ end = sym.symbol_endpos();
+ else
+ end = next ? next->filepos() : file_size;
return end - start;
}
Index: op_bfd.h
===================================================================
RCS file: /cvsroot/oprofile/oprofile/libutil++/op_bfd.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -p -d -r1.52 -r1.53
--- op_bfd.h 3 Jul 2008 17:12:06 -0000 1.52
+++ op_bfd.h 7 Aug 2008 13:01:16 -0000 1.53
@@ -50,6 +50,8 @@ public:
bfd_vma vma() const { return symb_value + section_vma; }
unsigned long value() const { return symb_value; }
unsigned long filepos() const { return symb_value + section_filepos; }
+ unsigned long symbol_endpos(void) const;
+ asection const * section(void) const { return bfd_symbol->section; }
std::string const & name() const { return symb_name; }
asymbol const * symbol() const { return bfd_symbol; }
size_t size() const { return symb_size; }
|