Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
52e14d15
提交
52e14d15
11月 14, 2011
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Check for ELF_PROG_LOAD before pushing on to wq.
上级
af216111
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
3 行删除
+10
-3
exec.c
exec.c
+10
-3
没有找到文件。
exec.c
浏览文件 @
52e14d15
...
...
@@ -14,6 +14,7 @@
#include "cpu.h"
#include "vm.h"
#include "prof.h"
#include <stddef.h>
#define USTACKPAGES 2
#define BRK (USERTOP >> 1)
...
...
@@ -38,9 +39,8 @@ dosegment(uptr a0, u64 a1)
prof_start
(
dosegment_prof
);
if
(
readi
(
args
->
ip
,
(
char
*
)
&
ph
,
off
,
sizeof
(
ph
))
!=
sizeof
(
ph
))
goto
bad
;
if
(
ph
.
type
!=
ELF_PROG_LOAD
)
{
return
;
}
if
(
ph
.
type
!=
ELF_PROG_LOAD
)
goto
bad
;
if
(
ph
.
memsz
<
ph
.
filesz
)
goto
bad
;
// XXX(sbw) vaddr doesn't have to be page aligned..
...
...
@@ -112,6 +112,13 @@ exec(char *path, char **argv)
args
.
vmap
=
vmap
;
wq_start
();
for
(
i
=
0
,
off
=
elf
.
phoff
;
i
<
elf
.
phnum
;
i
++
,
off
+=
sizeof
(
ph
)){
Elf64_Word
type
;
if
(
readi
(
ip
,
(
char
*
)
&
type
,
off
+
offsetof
(
struct
proghdr
,
type
),
sizeof
(
type
))
!=
sizeof
(
type
))
goto
bad
;
if
(
type
!=
ELF_PROG_LOAD
)
continue
;
wq_push
(
dosegment
,
(
uptr
)
&
args
,
(
uptr
)
off
);
}
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论