]> git.wh0rd.org Git - patches.git/blob - glibc-no-elf-header.patch
initial import
[patches.git] / glibc-no-elf-header.patch
1 2008-06-07  Mike Frysinger  <vapier@gentoo.org>
2
3         * sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
4         * sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
5         definitions from the kernel header to sys/procfs.h and remove the
6         #include of asm/elf.h.
7         * sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
8
9 --- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
10 +++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
11 @@ -29,10 +29,23 @@
12  #include <sys/types.h>
13  #include <sys/ucontext.h>
14  #include <sys/user.h>
15 -#include <asm/elf.h>
16  
17  __BEGIN_DECLS
18  
19 +/*
20 + * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
21 + * I have no idea why that is so.  For now, we just leave it at 33
22 + * (32 general regs + processor status word).
23 + */
24 +#define ELF_NGREG  33
25 +#define ELF_NFPREG 32
26 +
27 +typedef unsigned long elf_greg_t;
28 +typedef elf_greg_t elf_gregset_t[ELF_NGREG];
29 +
30 +typedef double elf_fpreg_t;
31 +typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
32 +
33  struct elf_siginfo
34    {
35      int si_signo;                      /* Signal number.  */
36 --- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
37 +++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
38 @@ -29,10 +29,19 @@
39  #include <sys/types.h>
40  #include <sys/ucontext.h>
41  #include <sys/user.h>
42 -#include <asm/elf.h>
43  
44  __BEGIN_DECLS
45  
46 +/*
47 + * ELF register definitions...
48 + */
49 +typedef unsigned long elf_greg_t;
50 +
51 +#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
52 +typedef elf_greg_t elf_gregset_t[ELF_NGREG];
53 +
54 +typedef struct user_fpu_struct elf_fpregset_t;
55 +
56  struct elf_siginfo
57    {
58      int si_signo;                      /* Signal number.  */
59 --- a/sysdeps/unix/sysv/linux/sys/procfs.h
60 +++ b/sysdeps/unix/sysv/linux/sys/procfs.h
61 @@ -1,115 +1,2 @@
62 -/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
63 -   This file is part of the GNU C Library.
64 -
65 -   The GNU C Library is free software; you can redistribute it and/or
66 -   modify it under the terms of the GNU Lesser General Public
67 -   License as published by the Free Software Foundation; either
68 -   version 2.1 of the License, or (at your option) any later version.
69 -
70 -   The GNU C Library is distributed in the hope that it will be useful,
71 -   but WITHOUT ANY WARRANTY; without even the implied warranty of
72 -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
73 -   Lesser General Public License for more details.
74 -
75 -   You should have received a copy of the GNU Lesser General Public
76 -   License along with the GNU C Library; if not, write to the Free
77 -   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
78 -   02111-1307 USA.  */
79 -
80 -#ifndef _SYS_PROCFS_H
81 -#define _SYS_PROCFS_H  1
82 -
83 -/* This is somehow modelled after the file of the same name on SysVr4
84 -   systems.  It provides a definition of the core file format for ELF
85 -   used on Linux.  */
86 -
87 -#include <features.h>
88 -#include <signal.h>
89 -#include <sys/time.h>
90 -#include <sys/types.h>
91 -#include <sys/ucontext.h>
92 -#include <sys/user.h>
93 -#include <asm/elf.h>
94 -
95 -__BEGIN_DECLS
96 -
97 -struct elf_siginfo
98 -  {
99 -    int si_signo;                      /* Signal number.  */
100 -    int si_code;                       /* Extra code.  */
101 -    int si_errno;                      /* Errno.  */
102 -  };
103 -
104 -/* Definitions to generate Intel SVR4-like core files.  These mostly
105 -   have the same names as the SVR4 types with "elf_" tacked on the
106 -   front to prevent clashes with linux definitions, and the typedef
107 -   forms have been avoided.  This is mostly like the SVR4 structure,
108 -   but more Linuxy, with things that Linux does not support and which
109 -   gdb doesn't really use excluded.  Fields present but not used are
110 -   marked with "XXX".  */
111 -struct elf_prstatus
112 -  {
113 -#if 0
114 -    long int pr_flags;                 /* XXX Process flags.  */
115 -    short int pr_why;                  /* XXX Reason for process halt.  */
116 -    short int pr_what;                 /* XXX More detailed reason.  */
117 -#endif
118 -    struct elf_siginfo pr_info;                /* Info associated with signal.  */
119 -    short int pr_cursig;               /* Current signal.  */
120 -    unsigned long int pr_sigpend;      /* Set of pending signals.  */
121 -    unsigned long int pr_sighold;      /* Set of held signals.  */
122 -#if 0
123 -    struct sigaltstack pr_altstack;    /* Alternate stack info.  */
124 -    struct sigaction pr_action;                /* Signal action for current sig.  */
125 -#endif
126 -    __pid_t pr_pid;
127 -    __pid_t pr_ppid;
128 -    __pid_t pr_pgrp;
129 -    __pid_t pr_sid;
130 -    struct timeval pr_utime;           /* User time.  */
131 -    struct timeval pr_stime;           /* System time.  */
132 -    struct timeval pr_cutime;          /* Cumulative user time.  */
133 -    struct timeval pr_cstime;          /* Cumulative system time.  */
134 -#if 0
135 -    long int pr_instr;                 /* Current instruction.  */
136 -#endif
137 -    elf_gregset_t pr_reg;              /* GP registers.  */
138 -    int pr_fpvalid;                    /* True if math copro being used.  */
139 -  };
140 -
141 -
142 -#define ELF_PRARGSZ     (80)    /* Number of chars for args */
143 -
144 -struct elf_prpsinfo
145 -  {
146 -    char pr_state;                     /* Numeric process state.  */
147 -    char pr_sname;                     /* Char for pr_state.  */
148 -    char pr_zomb;                      /* Zombie.  */
149 -    char pr_nice;                      /* Nice val.  */
150 -    unsigned long int pr_flag;         /* Flags.  */
151 -    unsigned short int pr_uid;
152 -    unsigned short int pr_gid;
153 -    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
154 -    /* Lots missing */
155 -    char pr_fname[16];                 /* Filename of executable.  */
156 -    char pr_psargs[ELF_PRARGSZ];       /* Initial part of arg list.  */
157 -  };
158 -
159 -/* Addresses.  */
160 -typedef void *psaddr_t;
161 -
162 -/* Register sets.  Linux has different names.  */
163 -typedef gregset_t prgregset_t;
164 -typedef fpregset_t prfpregset_t;
165 -
166 -/* We don't have any differences between processes and threads,
167 -   therefore habe only ine PID type.  */
168 -typedef __pid_t lwpid_t;
169 -
170 -
171 -typedef struct elf_prstatus prstatus_t;
172 -typedef struct elf_prpsinfo prpsinfo_t;
173 -
174 -__END_DECLS
175 -
176 -#endif /* sys/procfs.h */
177 +/* sys/procfs.h is architecture specific.  */
178 +#error "This file must be supplied by every Linux architecture."