Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elfIsPie: Clarify Haddocks (especially around Permissions argument) #48

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Data/ElfEdit/Dynamic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,14 @@ dynamicEntries d cl dynamic = elfClassInstances cl $ runDynamicParser d cl $ do
-- | Returns 'True' if the supplied 'ElfHeaderInfo' describes a
-- position-independent executable (PIE). The approach used here is adapted from
-- the source code for the @file@ binutils program, which was in turn summarized
-- here: https://unix.stackexchange.com/a/435038
-- here: https://unix.stackexchange.com/a/435038. In brief:
--
-- * A dynamically linked executable is a PIE if it contains a certain value in
-- its DT_FLAGS_1 dynamic section entry, or (if it lacks the certain value)
-- the file has executable permissions. The file permission fallback is why
-- this function requires 'Permissions' as an argument.
--
-- * Non-dynamically-linked executables are not PIEs.
elfIsPie :: forall w. Permissions -> ElfHeaderInfo w -> Bool
elfIsPie perms ehi =
case headerType hdr of
Expand Down
Loading