Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
elfio mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Third Party Mirrors
elfio mirror
Commits
3385408d
Commit
3385408d
authored
8 years ago
by
Martin Bickel
Committed by
Serge Lamikhov-Center
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Rephrase condition of is_sect_in_seg() to make it more intuitive
parent
fe78d06e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
elfio/elfio.hpp
+5
-5
5 additions, 5 deletions
elfio/elfio.hpp
with
5 additions
and
5 deletions
elfio/elfio.hpp
+
5
−
5
View file @
3385408d
...
@@ -426,11 +426,11 @@ class elfio
...
@@ -426,11 +426,11 @@ class elfio
//! It doesn't matter if the addresses are memory addresses, or file offsets,
//! It doesn't matter if the addresses are memory addresses, or file offsets,
//! they just need to be in the same address space
//! they just need to be in the same address space
bool
is_sect_in_seg
(
Elf64_Off
sect_begin
,
Elf_Xword
sect_size
,
Elf64_Off
seg_begin
,
Elf64_Off
seg_end
)
{
bool
is_sect_in_seg
(
Elf64_Off
sect_begin
,
Elf_Xword
sect_size
,
Elf64_Off
seg_begin
,
Elf64_Off
seg_end
)
{
if
(
sect_size
>
0
)
{
return
seg_begin
<=
sect_begin
return
seg_begin
<=
sect_begin
&&
sect_begin
+
sect_size
<=
seg_end
;
&&
sect_begin
+
sect_size
<=
seg_end
}
else
{
&&
sect_begin
<
seg_end
;
// this is important criteria when sect_size == 0
return
seg_begin
<=
sect_begin
&&
sect_begin
<
seg_end
;
// Example: seg_begin=10, seg_end=12 (-> covering the bytes 10 and 11)
}
// sect_begin=12, sect_size=0 -> shall return false!
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment