Commit a2547a1378e9039ea54bdaa53e917b74e55487ee
Committed by
Paul Brook
1 parent
379f6698
ELF codedump build failures
Rename ELF coredump types to avoid conflict with the corresponding host types. Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Showing
1 changed file
with
30 additions
and
29 deletions
linux-user/elfload.c
... | ... | @@ -134,13 +134,13 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i |
134 | 134 | regs->rip = infop->entry; |
135 | 135 | } |
136 | 136 | |
137 | -typedef target_ulong elf_greg_t; | |
137 | +typedef target_ulong target_elf_greg_t; | |
138 | 138 | typedef uint32_t target_uid_t; |
139 | 139 | typedef uint32_t target_gid_t; |
140 | 140 | typedef int32_t target_pid_t; |
141 | 141 | |
142 | 142 | #define ELF_NREG 27 |
143 | -typedef elf_greg_t elf_gregset_t[ELF_NREG]; | |
143 | +typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; | |
144 | 144 | |
145 | 145 | /* |
146 | 146 | * Note that ELF_NREG should be 29 as there should be place for |
... | ... | @@ -149,7 +149,7 @@ typedef elf_greg_t elf_gregset_t[ELF_NREG]; |
149 | 149 | * |
150 | 150 | * See linux kernel: arch/x86/include/asm/elf.h |
151 | 151 | */ |
152 | -static void elf_core_copy_regs(elf_gregset_t *regs, const CPUState *env) | |
152 | +static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) | |
153 | 153 | { |
154 | 154 | (*regs)[0] = env->regs[15]; |
155 | 155 | (*regs)[1] = env->regs[14]; |
... | ... | @@ -211,13 +211,13 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i |
211 | 211 | regs->edx = 0; |
212 | 212 | } |
213 | 213 | |
214 | -typedef target_ulong elf_greg_t; | |
214 | +typedef target_ulong target_elf_greg_t; | |
215 | 215 | typedef uint16_t target_uid_t; |
216 | 216 | typedef uint16_t target_gid_t; |
217 | 217 | typedef int32_t target_pid_t; |
218 | 218 | |
219 | 219 | #define ELF_NREG 17 |
220 | -typedef elf_greg_t elf_gregset_t[ELF_NREG]; | |
220 | +typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; | |
221 | 221 | |
222 | 222 | /* |
223 | 223 | * Note that ELF_NREG should be 19 as there should be place for |
... | ... | @@ -226,7 +226,7 @@ typedef elf_greg_t elf_gregset_t[ELF_NREG]; |
226 | 226 | * |
227 | 227 | * See linux kernel: arch/x86/include/asm/elf.h |
228 | 228 | */ |
229 | -static void elf_core_copy_regs(elf_gregset_t *regs, const CPUState *env) | |
229 | +static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) | |
230 | 230 | { |
231 | 231 | (*regs)[0] = env->regs[R_EBX]; |
232 | 232 | (*regs)[1] = env->regs[R_ECX]; |
... | ... | @@ -286,15 +286,15 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i |
286 | 286 | regs->ARM_r10 = infop->start_data; |
287 | 287 | } |
288 | 288 | |
289 | -typedef uint32_t elf_greg_t; | |
289 | +typedef uint32_t target_elf_greg_t; | |
290 | 290 | typedef uint16_t target_uid_t; |
291 | 291 | typedef uint16_t target_gid_t; |
292 | 292 | typedef int32_t target_pid_t; |
293 | 293 | |
294 | 294 | #define ELF_NREG 18 |
295 | -typedef elf_greg_t elf_gregset_t[ELF_NREG]; | |
295 | +typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG]; | |
296 | 296 | |
297 | -static void elf_core_copy_regs(elf_gregset_t *regs, const CPUState *env) | |
297 | +static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) | |
298 | 298 | { |
299 | 299 | (*regs)[0] = env->regs[0]; |
300 | 300 | (*regs)[1] = env->regs[1]; |
... | ... | @@ -1748,7 +1748,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, |
1748 | 1748 | |
1749 | 1749 | /* |
1750 | 1750 | * Definitions to generate Intel SVR4-like core files. |
1751 | - * These mostly have the same names as the SVR4 types with "elf_" | |
1751 | + * These mostly have the same names as the SVR4 types with "target_elf_" | |
1752 | 1752 | * tacked on the front to prevent clashes with linux definitions, |
1753 | 1753 | * and the typedef forms have been avoided. This is mostly like |
1754 | 1754 | * the SVR4 structure, but more Linuxy, with things that Linux does |
... | ... | @@ -1768,9 +1768,9 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, |
1768 | 1768 | * Next you define type of register set used for dumping. ELF specification |
1769 | 1769 | * says that it needs to be array of elf_greg_t that has size of ELF_NREG. |
1770 | 1770 | * |
1771 | - * typedef <target_regtype> elf_greg_t; | |
1771 | + * typedef <target_regtype> target_elf_greg_t; | |
1772 | 1772 | * #define ELF_NREG <number of registers> |
1773 | - * typedef elf_greg_t elf_gregset_t[ELF_NREG]; | |
1773 | + * typedef taret_elf_greg_t target_elf_gregset_t[ELF_NREG]; | |
1774 | 1774 | * |
1775 | 1775 | * Then define following types to match target types. Actual types can |
1776 | 1776 | * be found from linux kernel (arch/<ARCH>/include/asm/posix_types.h): |
... | ... | @@ -1782,7 +1782,8 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, |
1782 | 1782 | * Last step is to implement target specific function that copies registers |
1783 | 1783 | * from given cpu into just specified register set. Prototype is: |
1784 | 1784 | * |
1785 | - * static void elf_core_copy_regs(elf_gregset_t *regs, const CPUState *env); | |
1785 | + * static void elf_core_copy_regs(taret_elf_gregset_t *regs, | |
1786 | + * const CPUState *env); | |
1786 | 1787 | * |
1787 | 1788 | * Parameters: |
1788 | 1789 | * regs - copy register values into here (allocated and zeroed by caller) |
... | ... | @@ -1802,14 +1803,14 @@ struct memelfnote { |
1802 | 1803 | size_t notesz; |
1803 | 1804 | }; |
1804 | 1805 | |
1805 | -struct elf_siginfo { | |
1806 | +struct target_elf_siginfo { | |
1806 | 1807 | int si_signo; /* signal number */ |
1807 | 1808 | int si_code; /* extra code */ |
1808 | 1809 | int si_errno; /* errno */ |
1809 | 1810 | }; |
1810 | 1811 | |
1811 | -struct elf_prstatus { | |
1812 | - struct elf_siginfo pr_info; /* Info associated with signal */ | |
1812 | +struct target_elf_prstatus { | |
1813 | + struct target_elf_siginfo pr_info; /* Info associated with signal */ | |
1813 | 1814 | short pr_cursig; /* Current signal */ |
1814 | 1815 | target_ulong pr_sigpend; /* XXX */ |
1815 | 1816 | target_ulong pr_sighold; /* XXX */ |
... | ... | @@ -1821,13 +1822,13 @@ struct elf_prstatus { |
1821 | 1822 | struct target_timeval pr_stime; /* XXX System time */ |
1822 | 1823 | struct target_timeval pr_cutime; /* XXX Cumulative user time */ |
1823 | 1824 | struct target_timeval pr_cstime; /* XXX Cumulative system time */ |
1824 | - elf_gregset_t pr_reg; /* GP registers */ | |
1825 | + target_elf_gregset_t pr_reg; /* GP registers */ | |
1825 | 1826 | int pr_fpvalid; /* XXX */ |
1826 | 1827 | }; |
1827 | 1828 | |
1828 | 1829 | #define ELF_PRARGSZ (80) /* Number of chars for args */ |
1829 | 1830 | |
1830 | -struct elf_prpsinfo { | |
1831 | +struct target_elf_prpsinfo { | |
1831 | 1832 | char pr_state; /* numeric process state */ |
1832 | 1833 | char pr_sname; /* char for pr_state */ |
1833 | 1834 | char pr_zomb; /* zombie */ |
... | ... | @@ -1844,7 +1845,7 @@ struct elf_prpsinfo { |
1844 | 1845 | /* Here is the structure in which status of each thread is captured. */ |
1845 | 1846 | struct elf_thread_status { |
1846 | 1847 | TAILQ_ENTRY(elf_thread_status) ets_link; |
1847 | - struct elf_prstatus prstatus; /* NT_PRSTATUS */ | |
1848 | + struct target_elf_prstatus prstatus; /* NT_PRSTATUS */ | |
1848 | 1849 | #if 0 |
1849 | 1850 | elf_fpregset_t fpu; /* NT_PRFPREG */ |
1850 | 1851 | struct task_struct *thread; |
... | ... | @@ -1856,8 +1857,8 @@ struct elf_thread_status { |
1856 | 1857 | |
1857 | 1858 | struct elf_note_info { |
1858 | 1859 | struct memelfnote *notes; |
1859 | - struct elf_prstatus *prstatus; /* NT_PRSTATUS */ | |
1860 | - struct elf_prpsinfo *psinfo; /* NT_PRPSINFO */ | |
1860 | + struct target_elf_prstatus *prstatus; /* NT_PRSTATUS */ | |
1861 | + struct target_elf_prpsinfo *psinfo; /* NT_PRPSINFO */ | |
1861 | 1862 | |
1862 | 1863 | TAILQ_HEAD(thread_list_head, elf_thread_status) thread_list; |
1863 | 1864 | #if 0 |
... | ... | @@ -1899,8 +1900,8 @@ static int vma_walker(void *priv, unsigned long start, unsigned long end, |
1899 | 1900 | static void fill_elf_header(struct elfhdr *, int, uint16_t, uint32_t); |
1900 | 1901 | static void fill_note(struct memelfnote *, const char *, int, |
1901 | 1902 | unsigned int, void *); |
1902 | -static void fill_prstatus(struct elf_prstatus *, const TaskState *, int); | |
1903 | -static int fill_psinfo(struct elf_prpsinfo *, const TaskState *); | |
1903 | +static void fill_prstatus(struct target_elf_prstatus *, const TaskState *, int); | |
1904 | +static int fill_psinfo(struct target_elf_prpsinfo *, const TaskState *); | |
1904 | 1905 | static void fill_auxv_note(struct memelfnote *, const TaskState *); |
1905 | 1906 | static void fill_elf_note_phdr(struct elf_phdr *, int, off_t); |
1906 | 1907 | static size_t note_size(const struct memelfnote *); |
... | ... | @@ -1914,10 +1915,10 @@ static int write_note(struct memelfnote *, int); |
1914 | 1915 | static int write_note_info(struct elf_note_info *, int); |
1915 | 1916 | |
1916 | 1917 | #ifdef BSWAP_NEEDED |
1917 | -static void bswap_prstatus(struct elf_prstatus *); | |
1918 | -static void bswap_psinfo(struct elf_prpsinfo *); | |
1918 | +static void bswap_prstatus(struct target_elf_prstatus *); | |
1919 | +static void bswap_psinfo(struct target_elf_prpsinfo *); | |
1919 | 1920 | |
1920 | -static void bswap_prstatus(struct elf_prstatus *prstatus) | |
1921 | +static void bswap_prstatus(struct target_elf_prstatus *prstatus) | |
1921 | 1922 | { |
1922 | 1923 | prstatus->pr_info.si_signo = tswapl(prstatus->pr_info.si_signo); |
1923 | 1924 | prstatus->pr_info.si_code = tswapl(prstatus->pr_info.si_code); |
... | ... | @@ -1934,7 +1935,7 @@ static void bswap_prstatus(struct elf_prstatus *prstatus) |
1934 | 1935 | prstatus->pr_fpvalid = tswap32(prstatus->pr_fpvalid); |
1935 | 1936 | } |
1936 | 1937 | |
1937 | -static void bswap_psinfo(struct elf_prpsinfo *psinfo) | |
1938 | +static void bswap_psinfo(struct target_elf_prpsinfo *psinfo) | |
1938 | 1939 | { |
1939 | 1940 | psinfo->pr_flag = tswapl(psinfo->pr_flag); |
1940 | 1941 | psinfo->pr_uid = tswap16(psinfo->pr_uid); |
... | ... | @@ -2128,7 +2129,7 @@ static size_t note_size(const struct memelfnote *note) |
2128 | 2129 | return (note->notesz); |
2129 | 2130 | } |
2130 | 2131 | |
2131 | -static void fill_prstatus(struct elf_prstatus *prstatus, | |
2132 | +static void fill_prstatus(struct target_elf_prstatus *prstatus, | |
2132 | 2133 | const TaskState *ts, int signr) |
2133 | 2134 | { |
2134 | 2135 | (void) memset(prstatus, 0, sizeof (*prstatus)); |
... | ... | @@ -2143,7 +2144,7 @@ static void fill_prstatus(struct elf_prstatus *prstatus, |
2143 | 2144 | #endif |
2144 | 2145 | } |
2145 | 2146 | |
2146 | -static int fill_psinfo(struct elf_prpsinfo *psinfo, const TaskState *ts) | |
2147 | +static int fill_psinfo(struct target_elf_prpsinfo *psinfo, const TaskState *ts) | |
2147 | 2148 | { |
2148 | 2149 | char *filename, *base_filename; |
2149 | 2150 | unsigned int i, len; | ... | ... |