.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * 32-bit compatibility support for ELF format executables and core dumps. |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2007 Red Hat, Inc. All rights reserved. |
---|
5 | | - * |
---|
6 | | - * This copyrighted material is made available to anyone wishing to use, |
---|
7 | | - * modify, copy, or redistribute it subject to the terms and conditions |
---|
8 | | - * of the GNU General Public License v.2. |
---|
9 | 6 | * |
---|
10 | 7 | * Red Hat Author: Roland McGrath. |
---|
11 | 8 | * |
---|
.. | .. |
---|
20 | 17 | #include <linux/elfcore-compat.h> |
---|
21 | 18 | #include <linux/time.h> |
---|
22 | 19 | |
---|
| 20 | +#define ELF_COMPAT 1 |
---|
| 21 | + |
---|
23 | 22 | /* |
---|
24 | 23 | * Rename the basic ELF layout types to refer to the 32-bit class of files. |
---|
25 | 24 | */ |
---|
.. | .. |
---|
31 | 30 | #undef elf_shdr |
---|
32 | 31 | #undef elf_note |
---|
33 | 32 | #undef elf_addr_t |
---|
| 33 | +#undef ELF_GNU_PROPERTY_ALIGN |
---|
34 | 34 | #define elfhdr elf32_hdr |
---|
35 | 35 | #define elf_phdr elf32_phdr |
---|
36 | 36 | #define elf_shdr elf32_shdr |
---|
37 | 37 | #define elf_note elf32_note |
---|
38 | 38 | #define elf_addr_t Elf32_Addr |
---|
| 39 | +#define ELF_GNU_PROPERTY_ALIGN ELF32_GNU_PROPERTY_ALIGN |
---|
39 | 40 | |
---|
40 | 41 | /* |
---|
41 | 42 | * Some data types as stored in coredump. |
---|
42 | 43 | */ |
---|
43 | 44 | #define user_long_t compat_long_t |
---|
44 | 45 | #define user_siginfo_t compat_siginfo_t |
---|
45 | | -#define copy_siginfo_to_user copy_siginfo_to_user32 |
---|
| 46 | +#define copy_siginfo_to_external copy_siginfo_to_external32 |
---|
46 | 47 | |
---|
47 | 48 | /* |
---|
48 | 49 | * The machine-dependent core note format types are defined in elfcore-compat.h, |
---|
.. | .. |
---|
51 | 52 | #define elf_prstatus compat_elf_prstatus |
---|
52 | 53 | #define elf_prpsinfo compat_elf_prpsinfo |
---|
53 | 54 | |
---|
54 | | -#undef ns_to_timeval |
---|
55 | | -#define ns_to_timeval ns_to_compat_timeval |
---|
| 55 | +#undef ns_to_kernel_old_timeval |
---|
| 56 | +#define ns_to_kernel_old_timeval ns_to_old_timeval32 |
---|
56 | 57 | |
---|
57 | 58 | /* |
---|
58 | 59 | * To use this file, asm/elf.h must define compat_elf_check_arch. |
---|
.. | .. |
---|
116 | 117 | #define arch_setup_additional_pages compat_arch_setup_additional_pages |
---|
117 | 118 | #endif |
---|
118 | 119 | |
---|
| 120 | +#ifdef compat_elf_read_implies_exec |
---|
| 121 | +#undef elf_read_implies_exec |
---|
| 122 | +#define elf_read_implies_exec compat_elf_read_implies_exec |
---|
| 123 | +#endif |
---|
| 124 | + |
---|
119 | 125 | /* |
---|
120 | 126 | * Rename a few of the symbols that binfmt_elf.c will define. |
---|
121 | 127 | * These are all local so the names don't really matter, but it |
---|