diff options
author | Marcel Moolenaar <marcel@FreeBSD.org> | 2002-12-21 01:15:39 +0000 |
---|---|---|
committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2002-12-21 01:15:39 +0000 |
commit | 551d79e177cc92e8d87f32ed37caa571a61036c9 (patch) | |
tree | 29049541586b21317c18af1dd63f3b2042a9b074 /sys/kern/imgact_elf.c | |
parent | aed62c0980f26baa438801072ffc8ec05cc37258 (diff) | |
download | src-551d79e177cc92e8d87f32ed37caa571a61036c9.tar.gz src-551d79e177cc92e8d87f32ed37caa571a61036c9.zip |
Fix multiple registration of the elf_legacy_coredump sysctl variable.
The duplication is caused by the fact that imgact_elf.c is included
by both imgact_elf32.c and imgact_elf64.c and both are compiled by
default on ia64. Consequently, we have two seperate copies of the
elf_legacy_coredump variable due to them being declared static, and
two entries for the same sysctl in the linker set, both referencing
the unique copy of the elf_legacy_coredump variable. Since the second
sysctl cannot be registered, one of the elf_legacy_coredump variables
can not be tuned (if ordering still holds, it's the ELF64 related one).
The only solution is to create two different sysctl variables, just
like the elf<32|64>_trace sysctl variables. This unfortunately is an
(user) interface change, but unavoidable. Thus, on ELF32 platforms
the sysctl variable is called elf32_legacy_coredump and on ELF64
platforms it is called elf64_legacy_coredump. Platforms that have
both ELF formats have both sysctl variables.
These variables should probably be retired sooner rather than later.
Notes
Notes:
svn path=/head/; revision=108148
Diffstat (limited to 'sys/kern/imgact_elf.c')
-rw-r--r-- | sys/kern/imgact_elf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 44d4bf097aea..3fba3cd7a073 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -82,14 +82,16 @@ static int __elfN(load_section)(struct proc *p, static int __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp); static int elf_trace = 0; +static int elf_legacy_coredump = 0; #if __ELF_WORD_SIZE == 32 SYSCTL_INT(_debug, OID_AUTO, elf32_trace, CTLFLAG_RW, &elf_trace, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, elf32_legacy_coredump, CTLFLAG_RW, + &elf_legacy_coredump, 0, ""); #else SYSCTL_INT(_debug, OID_AUTO, elf64_trace, CTLFLAG_RW, &elf_trace, 0, ""); -#endif -static int elf_legacy_coredump = 0; -SYSCTL_INT(_debug, OID_AUTO, elf_legacy_coredump, CTLFLAG_RW, +SYSCTL_INT(_debug, OID_AUTO, elf64_legacy_coredump, CTLFLAG_RW, &elf_legacy_coredump, 0, ""); +#endif static Elf_Brandinfo *elf_brand_list[MAX_BRANDS]; extern int fallback_elf_brand; |