Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
AA5555AA
OSKernel2023-LuoOS
Commits
2774d820
Commit
2774d820
authored
1 year ago
by
某某某
Browse files
Options
Download
Plain Diff
Merge branch 'ldelf-fix' into signal
parents
235f2841
75e14f6b
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kernel/ld.cc
+1
-1
kernel/ld.cc
with
1 addition
and
1 deletion
+1
-1
kernel/ld.cc
+
1
−
1
View file @
2774d820
...
...
@@ -12,7 +12,7 @@ xlen_t ld::loadElf(const uint8_t *buff,vm::VMAR &vmar){
for
(
int
i
=
0
;
i
<
elfHeader
->
e_phnum
;
i
++
){
const
Elf64_Phdr
&
entry
=
phdrTable
[
i
];
if
(
entry
.
p_type
!=
PT_LOAD
)
continue
;
int
pages
=
vm
::
bytes2pages
(
entry
.
p_
memsz
)
;
int
pages
=
vm
::
bytes2pages
(
entry
.
p_
vaddr
+
entry
.
p_memsz
)
-
vm
::
bytes2pages
(
entry
.
p_vaddr
)
+
1
;
vm
::
PageNum
ppn
=
(
kGlobObjs
->
pageMgr
->
alloc
(
pages
));
Log
(
debug
,
"%x<=%x[%d pages@%x]"
,
vm
::
addr2pn
(
entry
.
p_vaddr
),
ppn
,
pages
,
ld
::
elf
::
flags2perm
(
entry
.
p_flags
));
vmar
.
map
(
vm
::
PageMapping
{
vm
::
addr2pn
(
entry
.
p_vaddr
),
vm
::
VMO
{
ppn
,
pages
},
ld
::
elf
::
flags2perm
(
entry
.
p_flags
),
vm
::
PageMapping
::
MappingType
::
file
});
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets