Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
506f21c5
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
506f21c5
编写于
10月 05, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch elf_core_write_extra_phdrs() to dump_emit()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
ecc8c772
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
21 deletion
+15
-21
arch/ia64/kernel/elfcore.c
arch/ia64/kernel/elfcore.c
+2
-4
arch/x86/um/elfcore.c
arch/x86/um/elfcore.c
+2
-5
fs/binfmt_elf.c
fs/binfmt_elf.c
+2
-2
fs/binfmt_elf_fdpic.c
fs/binfmt_elf_fdpic.c
+3
-1
include/linux/elfcore.h
include/linux/elfcore.h
+3
-2
kernel/elfcore.c
kernel/elfcore.c
+3
-7
未找到文件。
arch/ia64/kernel/elfcore.c
浏览文件 @
506f21c5
...
...
@@ -11,8 +11,7 @@ Elf64_Half elf_core_extra_phdrs(void)
return
GATE_EHDR
->
e_phnum
;
}
int
elf_core_write_extra_phdrs
(
struct
file
*
file
,
loff_t
offset
,
size_t
*
size
,
unsigned
long
limit
)
int
elf_core_write_extra_phdrs
(
struct
coredump_params
*
cprm
,
loff_t
offset
)
{
const
struct
elf_phdr
*
const
gate_phdrs
=
(
const
struct
elf_phdr
*
)
(
GATE_ADDR
+
GATE_EHDR
->
e_phoff
);
...
...
@@ -35,8 +34,7 @@ int elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
phdr
.
p_offset
+=
ofs
;
}
phdr
.
p_paddr
=
0
;
/* match other core phdrs */
*
size
+=
sizeof
(
phdr
);
if
(
*
size
>
limit
||
!
dump_write
(
file
,
&
phdr
,
sizeof
(
phdr
)))
if
(
!
dump_emit
(
cprm
,
&
phdr
,
sizeof
(
phdr
)))
return
0
;
}
return
1
;
...
...
arch/x86/um/elfcore.c
浏览文件 @
506f21c5
...
...
@@ -11,8 +11,7 @@ Elf32_Half elf_core_extra_phdrs(void)
return
vsyscall_ehdr
?
(((
struct
elfhdr
*
)
vsyscall_ehdr
)
->
e_phnum
)
:
0
;
}
int
elf_core_write_extra_phdrs
(
struct
file
*
file
,
loff_t
offset
,
size_t
*
size
,
unsigned
long
limit
)
int
elf_core_write_extra_phdrs
(
struct
coredump_params
*
cprm
,
loff_t
offset
)
{
if
(
vsyscall_ehdr
)
{
const
struct
elfhdr
*
const
ehdrp
=
...
...
@@ -32,9 +31,7 @@ int elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
phdr
.
p_offset
+=
ofs
;
}
phdr
.
p_paddr
=
0
;
/* match other core phdrs */
*
size
+=
sizeof
(
phdr
);
if
(
*
size
>
limit
||
!
dump_write
(
file
,
&
phdr
,
sizeof
(
phdr
)))
if
(
!
dump_emit
(
cprm
,
&
phdr
,
sizeof
(
phdr
)))
return
0
;
}
}
...
...
fs/binfmt_elf.c
浏览文件 @
506f21c5
...
...
@@ -2152,11 +2152,11 @@ static int elf_core_dump(struct coredump_params *cprm)
if
(
!
dump_emit
(
cprm
,
&
phdr
,
sizeof
(
phdr
)))
goto
end_coredump
;
}
size
=
cprm
->
written
;
if
(
!
elf_core_write_extra_phdrs
(
cprm
->
file
,
offset
,
&
size
,
cprm
->
limi
t
))
if
(
!
elf_core_write_extra_phdrs
(
cprm
,
offse
t
))
goto
end_coredump
;
size
=
cprm
->
written
;
cprm
->
written
=
foffset
;
/* will disappear */
/* write out the notes section */
if
(
!
write_note_info
(
&
info
,
cprm
))
...
...
fs/binfmt_elf_fdpic.c
浏览文件 @
506f21c5
...
...
@@ -1791,9 +1791,11 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm)
goto
end_coredump
;
}
if
(
!
elf_core_write_extra_phdrs
(
cprm
->
file
,
offset
,
&
size
,
cprm
->
limit
))
cprm
->
written
=
size
;
if
(
!
elf_core_write_extra_phdrs
(
cprm
,
offset
))
goto
end_coredump
;
size
=
cprm
->
written
;
/* write out the notes section */
for
(
i
=
0
;
i
<
numnote
;
i
++
)
if
(
!
writenote
(
notes
+
i
,
cprm
->
file
,
&
foffset
))
...
...
include/linux/elfcore.h
浏览文件 @
506f21c5
...
...
@@ -6,6 +6,8 @@
#include <asm/elf.h>
#include <uapi/linux/elfcore.h>
struct
coredump_params
;
static
inline
void
elf_core_copy_regs
(
elf_gregset_t
*
elfregs
,
struct
pt_regs
*
regs
)
{
#ifdef ELF_CORE_COPY_REGS
...
...
@@ -63,8 +65,7 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse
*/
extern
Elf_Half
elf_core_extra_phdrs
(
void
);
extern
int
elf_core_write_extra_phdrs
(
struct
file
*
file
,
loff_t
offset
,
size_t
*
size
,
unsigned
long
limit
);
elf_core_write_extra_phdrs
(
struct
coredump_params
*
cprm
,
loff_t
offset
);
extern
int
elf_core_write_extra_data
(
struct
file
*
file
,
size_t
*
size
,
unsigned
long
limit
);
extern
size_t
elf_core_extra_data_size
(
void
);
...
...
kernel/elfcore.c
浏览文件 @
506f21c5
#include <linux/elf.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <asm/elf.h>
#include <linux/binfmts.h>
Elf_Half
__weak
elf_core_extra_phdrs
(
void
)
{
return
0
;
}
int
__weak
elf_core_write_extra_phdrs
(
struct
file
*
file
,
loff_t
offset
,
size_t
*
size
,
unsigned
long
limit
)
int
__weak
elf_core_write_extra_phdrs
(
struct
coredump_params
*
cprm
,
loff_t
offset
)
{
return
1
;
}
int
__weak
elf_core_write_extra_data
(
struct
file
*
file
,
size_t
*
size
,
unsigned
long
limit
)
int
__weak
elf_core_write_extra_data
(
struct
coredump_params
*
cprm
)
{
return
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录