Skip to content

Commit a6384ed

Browse files
committed
Fix calculation of ElfSegmentRange.Size
1 parent 8d4bd5e commit a6384ed

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

src/LibObjectFile/Elf/ElfSegmentRange.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,7 @@ public ulong Size
9999
return 0;
100100
}
101101

102-
var parent = BeginSection.Parent;
103-
ulong size = 0;
104-
for (uint i = BeginSection.Index; i < EndSection.Index; i++)
105-
{
106-
var section = parent.Sections[(int)i];
107-
if (section.HasContent)
108-
{
109-
size += section.Size;
110-
}
111-
}
112-
102+
ulong size = EndSection.Offset - BeginSection.Offset;
113103
size -= BeginOffset;
114104
size += EndOffset < 0 ? (ulong)((long)EndSection.Size + EndOffset + 1) : (ulong)(EndOffset + 1);
115105
return size;

0 commit comments

Comments
 (0)