Skip to content

fix: valgrind doesn't filter .plt.sec calls#2

Merged
not-matthias merged 2 commits intomasterfrom
cod-1315-statically-linked-libpythonso-adds-extra-frames-to-valgrind
Oct 22, 2025
Merged

fix: valgrind doesn't filter .plt.sec calls#2
not-matthias merged 2 commits intomasterfrom
cod-1315-statically-linked-libpythonso-adds-extra-frames-to-valgrind

Conversation

@not-matthias
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes Valgrind's handling of the .plt.sec (hardened PLT) section, which was previously not being filtered when the --skip-plt option was enabled. The fix adds support for detecting and tracking .plt.sec sections across different architectures and ensures they are treated similarly to regular .plt sections.

Key changes:

  • Added new API functions and enum value for .plt.sec section tracking
  • Implemented .plt.sec section detection in ELF reader for multiple architectures (x86, ppc32, ppc64)
  • Updated callgrind to skip .plt.sec sections when --skip-plt is enabled

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
include/pub_tool_debuginfo.h Added API functions for .plt.sec section access and new Vg_SectPLTSEC enum value
coregrind/m_debuginfo/priv_storage.h Added fields to track .plt.sec section presence, address, and size
coregrind/m_debuginfo/readelf.c Implemented .plt.sec section detection for x86, ppc32, and ppc64 architectures
coregrind/m_debuginfo/debuginfo.c Implemented getter functions, section kind mapping, and address range checking for .plt.sec
callgrind/fn.c Updated PLT skip logic to include Vg_SectPLTSEC sections
callgrind/tests/plt_sec_test.c Added test program that exercises library calls through .plt.sec
callgrind/tests/plt-sec-skip.vgtest Added test configuration for verifying .plt.sec filtering
callgrind/tests/plt-sec-skip.stdout.exp Added expected stdout output for the test
callgrind/tests/plt-sec-skip.stderr.exp Added expected stderr output for the test
callgrind/tests/plt-sec-skip.post.exp Added expected post-processing output showing filtered function names
callgrind/tests/filter_plt_sec Added shell script to filter and verify callgrind output
callgrind/tests/Makefile.am Updated build configuration to include new test files and compilation flags

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@not-matthias not-matthias force-pushed the cod-1315-statically-linked-libpythonso-adds-extra-frames-to-valgrind branch from f51198a to feb8824 Compare October 22, 2025 08:33
@not-matthias not-matthias requested a review from Copilot October 22, 2025 08:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@art049 art049 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@not-matthias not-matthias force-pushed the cod-1315-statically-linked-libpythonso-adds-extra-frames-to-valgrind branch from feb8824 to 17cd805 Compare October 22, 2025 09:35
@not-matthias not-matthias force-pushed the cod-1315-statically-linked-libpythonso-adds-extra-frames-to-valgrind branch from 17cd805 to dd7e028 Compare October 22, 2025 09:36
@not-matthias not-matthias merged commit dd7e028 into master Oct 22, 2025
2 checks passed
@not-matthias not-matthias deleted the cod-1315-statically-linked-libpythonso-adds-extra-frames-to-valgrind branch October 22, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants