https://bugs.kde.org/show_bug.cgi?id=353192

Fredrik Tolf <fred...@dolda2000.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fred...@dolda2000.com

--- Comment #6 from Fredrik Tolf <fred...@dolda2000.com> ---
I also have this issue. The reason I have an executable data segment is because
I create a new section that is writable/executable for patchable code:

> .pushsection .genfuns,\"awx\",@progbits;
> [...]
> .popsection

This causes the linker to make the entire data segment RWX. Regardless of the
security implications, it seems Valgrind should be able to debug the file with
symbol info.


Also, while debugging Valgrind to see why it didn't load my symbols, I also
encountered what seemed to be unintentional behavior in
discard_syms_in_range(). On a completely unrelated munmap() call, it discarded
the DebugInfo for my executable because of how the in-range test is formulated.
It currently looks like this:

>         if (curr->text_present
>             && curr->text_size > 0
>             && (start+length - 1 < curr->text_avma 
>                 || curr->text_avma + curr->text_size - 1 < start)) {
>            /* no overlap */
>         } else {
>            found = True;
>            break;
>         }

This way, `found' is set not only when the range overlaps, but also when there
is no range. I don't know if there is any information elsewhere that makes this
meaningful, but it seems to me that the test should look like this instead:

>         if (curr->text_present && curr->text_size > 0) {
>             if (start+length - 1 < curr->text_avma 
>                 || curr->text_avma + curr->text_size - 1 < start) {
>                 /* no overlap */
>             } else {
>                 found = True;
>                 break;
>             }
>         }

Technically, I guess this should perhaps be another report, but since it
doesn't cause any problems in and of itself, I wasn't sure how to report it. :)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to