Skip to content

Commit 1e6b57d

Browse files
author
Al Viro
committed
unexport linux/elfcore.h
It's unusable from userland - it uses elf_gregset_t, which is not provided by exported headers. glibc has it in sys/procfs.h, but the same file defines struct elf_prstatus, so linux/elfcore.h can't be included once sys/procfs.h has been pulled. Same goes for uclibc and dietlibc simply doesn't have elf_gregset_t defined anywhere. IOW, no userland source is including that thing. Signed-off-by: Al Viro <[email protected]>
1 parent b4e9c95 commit 1e6b57d

File tree

4 files changed

+66
-106
lines changed

4 files changed

+66
-106
lines changed

include/linux/elfcore.h

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,75 @@
55
#include <linux/user.h>
66
#include <linux/bug.h>
77
#include <linux/sched/task_stack.h>
8-
9-
#include <asm/elf.h>
10-
#include <uapi/linux/elfcore.h>
8+
#include <linux/types.h>
9+
#include <linux/signal.h>
10+
#include <linux/time.h>
11+
#include <linux/ptrace.h>
12+
#include <linux/fs.h>
13+
#include <linux/elf.h>
1114

1215
struct coredump_params;
1316

17+
struct elf_siginfo
18+
{
19+
int si_signo; /* signal number */
20+
int si_code; /* extra code */
21+
int si_errno; /* errno */
22+
};
23+
24+
/*
25+
* Definitions to generate Intel SVR4-like core files.
26+
* These mostly have the same names as the SVR4 types with "elf_"
27+
* tacked on the front to prevent clashes with linux definitions,
28+
* and the typedef forms have been avoided. This is mostly like
29+
* the SVR4 structure, but more Linuxy, with things that Linux does
30+
* not support and which gdb doesn't really use excluded.
31+
*/
32+
struct elf_prstatus
33+
{
34+
struct elf_siginfo pr_info; /* Info associated with signal */
35+
short pr_cursig; /* Current signal */
36+
unsigned long pr_sigpend; /* Set of pending signals */
37+
unsigned long pr_sighold; /* Set of held signals */
38+
pid_t pr_pid;
39+
pid_t pr_ppid;
40+
pid_t pr_pgrp;
41+
pid_t pr_sid;
42+
struct __kernel_old_timeval pr_utime; /* User time */
43+
struct __kernel_old_timeval pr_stime; /* System time */
44+
struct __kernel_old_timeval pr_cutime; /* Cumulative user time */
45+
struct __kernel_old_timeval pr_cstime; /* Cumulative system time */
46+
elf_gregset_t pr_reg; /* GP registers */
47+
#ifdef CONFIG_BINFMT_ELF_FDPIC
48+
/* When using FDPIC, the loadmap addresses need to be communicated
49+
* to GDB in order for GDB to do the necessary relocations. The
50+
* fields (below) used to communicate this information are placed
51+
* immediately after ``pr_reg'', so that the loadmap addresses may
52+
* be viewed as part of the register set if so desired.
53+
*/
54+
unsigned long pr_exec_fdpic_loadmap;
55+
unsigned long pr_interp_fdpic_loadmap;
56+
#endif
57+
int pr_fpvalid; /* True if math co-processor being used. */
58+
};
59+
60+
#define ELF_PRARGSZ (80) /* Number of chars for args */
61+
62+
struct elf_prpsinfo
63+
{
64+
char pr_state; /* numeric process state */
65+
char pr_sname; /* char for pr_state */
66+
char pr_zomb; /* zombie */
67+
char pr_nice; /* nice val */
68+
unsigned long pr_flag; /* flags */
69+
__kernel_uid_t pr_uid;
70+
__kernel_gid_t pr_gid;
71+
pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
72+
/* Lots missing */
73+
char pr_fname[16]; /* filename of executable */
74+
char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
75+
};
76+
1477
static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *regs)
1578
{
1679
#ifdef ELF_CORE_COPY_REGS

include/uapi/linux/elfcore.h

Lines changed: 0 additions & 101 deletions
This file was deleted.

scripts/headers_install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ arch/x86/include/uapi/asm/auxvec.h:CONFIG_X86_64
8686
arch/x86/include/uapi/asm/mman.h:CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
8787
include/uapi/asm-generic/fcntl.h:CONFIG_64BIT
8888
include/uapi/linux/atmdev.h:CONFIG_COMPAT
89-
include/uapi/linux/elfcore.h:CONFIG_BINFMT_ELF_FDPIC
9089
include/uapi/linux/eventpoll.h:CONFIG_PM_SLEEP
9190
include/uapi/linux/hw_breakpoint.h:CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
9291
include/uapi/linux/pktcdvd.h:CONFIG_CDROM_PKTCDVD_WCACHE

usr/include/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ no-header-test += linux/am437x-vpfe.h
2828
no-header-test += linux/android/binder.h
2929
no-header-test += linux/android/binderfs.h
3030
no-header-test += linux/coda.h
31-
no-header-test += linux/elfcore.h
3231
no-header-test += linux/errqueue.h
3332
no-header-test += linux/fsmap.h
3433
no-header-test += linux/hdlc/ioctl.h

0 commit comments

Comments
 (0)