]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Don't be quite so paranoid about rejecting symbols that fall outside
authorJulian Seward <jseward@acm.org>
Mon, 3 Mar 2008 15:51:58 +0000 (15:51 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 3 Mar 2008 15:51:58 +0000 (15:51 +0000)
the .text segment.  Instead only reject ones that fall outside the r-x
area.  This is in line with r7427, which instituted such a change in
other places in the system.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7546

coregrind/m_debuginfo/readelf.c

index ca9ef0cc5704a8cee8ec6ca14ad7f286f992975c..24aeb5bda293c8ec9cd1b286d43700f8037a0d72 100644 (file)
@@ -458,7 +458,19 @@ Bool get_elf_symbol_info (
 
 
    if (*is_text_out) {
-      if (!in_text) {
+      /* This used to reject any symbol falling outside the text
+         segment ("if (!in_text) ...").  Now it is relaxed slightly,
+         to reject only symbols which fall outside the area mapped
+         r-x.  This is in accordance with r7427.  See
+         "Comment_Regarding_Text_Range_Checks" in storage.c for
+         background. */
+      Bool in_rx;
+      vg_assert(di->have_rx_map);
+      in_rx = (!(*sym_avma_out + *sym_size_out <= di->rx_map_avma
+                 || *sym_avma_out >= di->rx_map_avma + di->rx_map_size));
+      if (in_text)
+         vg_assert(in_rx);
+      if (!in_rx) {
          TRACE_SYMTAB(
             "ignore -- %p .. %p outside .text svma range %p .. %p\n",
             *sym_avma_out, *sym_avma_out + *sym_size_out,