aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-02-08 07:19:28 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:30 -0500
commit7fa3031500ec9b0a7460c8c23751799006ffee74 (patch)
tree2a7e9202b35a39dc8217e95825263c0629e67e35 /arch/sparc
parentb0b933c08bd5fd053bbba8ba6387f543be03d49f (diff)
aout: suppress A.OUT library support if !CONFIG_ARCH_SUPPORTS_AOUT
Suppress A.OUT library support if CONFIG_ARCH_SUPPORTS_AOUT is not set. Not all architectures support the A.OUT binfmt, so the ELF binfmt should not be permitted to go looking for A.OUT libraries to load in such a case. Not only that, but under such conditions A.OUT core dumps are not produced either. To make this work, this patch also does the following: (1) Makes the existence of the contents of linux/a.out.h contingent on CONFIG_ARCH_SUPPORTS_AOUT. (2) Renames dump_thread() to aout_dump_thread() as it's only called by A.OUT core dumping code. (3) Moves aout_dump_thread() into asm/a.out-core.h and makes it inline. This is then included only where needed. This means that this bit of arch code will be stored in the appropriate A.OUT binfmt module rather than the core kernel. (4) Drops A.OUT support for Blackfin (according to Mike Frysinger it's not needed) and FRV. This patch depends on the previous patch to move STACK_TOP[_MAX] out of asm/a.out.h and into asm/processor.h as they're required whether or not A.OUT format is available. [jdike@addtoit.com: uml: re-remove accidentally restored code] Signed-off-by: David Howells <dhowells@redhat.com> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/kernel/process.c32
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c2
2 files changed, 0 insertions, 34 deletions
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
index 77460e316a03..a248e81caa0e 100644
--- a/arch/sparc/kernel/process.c
+++ b/arch/sparc/kernel/process.c
@@ -567,38 +567,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
567} 567}
568 568
569/* 569/*
570 * fill in the user structure for a core dump..
571 */
572void dump_thread(struct pt_regs * regs, struct user * dump)
573{
574 unsigned long first_stack_page;
575
576 dump->magic = SUNOS_CORE_MAGIC;
577 dump->len = sizeof(struct user);
578 dump->regs.psr = regs->psr;
579 dump->regs.pc = regs->pc;
580 dump->regs.npc = regs->npc;
581 dump->regs.y = regs->y;
582 /* fuck me plenty */
583 memcpy(&dump->regs.regs[0], &regs->u_regs[1], (sizeof(unsigned long) * 15));
584 dump->uexec = current->thread.core_exec;
585 dump->u_tsize = (((unsigned long) current->mm->end_code) -
586 ((unsigned long) current->mm->start_code)) & ~(PAGE_SIZE - 1);
587 dump->u_dsize = ((unsigned long) (current->mm->brk + (PAGE_SIZE-1)));
588 dump->u_dsize -= dump->u_tsize;
589 dump->u_dsize &= ~(PAGE_SIZE - 1);
590 first_stack_page = (regs->u_regs[UREG_FP] & ~(PAGE_SIZE - 1));
591 dump->u_ssize = (TASK_SIZE - first_stack_page) & ~(PAGE_SIZE - 1);
592 memcpy(&dump->fpu.fpstatus.fregs.regs[0], &current->thread.float_regs[0], (sizeof(unsigned long) * 32));
593 dump->fpu.fpstatus.fsr = current->thread.fsr;
594 dump->fpu.fpstatus.flags = dump->fpu.fpstatus.extra = 0;
595 dump->fpu.fpstatus.fpq_count = current->thread.fpqdepth;
596 memcpy(&dump->fpu.fpstatus.fpq[0], &current->thread.fpqueue[0],
597 ((sizeof(unsigned long) * 2) * 16));
598 dump->sigcode = 0;
599}
600
601/*
602 * fill in the fpu structure for a core dump. 570 * fill in the fpu structure for a core dump.
603 */ 571 */
604int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs) 572int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs)
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index ef647acc479e..62f6221db74f 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -214,8 +214,6 @@ EXPORT_SYMBOL(kunmap_atomic);
214EXPORT_SYMBOL(svr4_setcontext); 214EXPORT_SYMBOL(svr4_setcontext);
215EXPORT_SYMBOL(svr4_getcontext); 215EXPORT_SYMBOL(svr4_getcontext);
216 216
217EXPORT_SYMBOL(dump_thread);
218
219/* prom symbols */ 217/* prom symbols */
220EXPORT_SYMBOL(idprom); 218EXPORT_SYMBOL(idprom);
221EXPORT_SYMBOL(prom_root_node); 219EXPORT_SYMBOL(prom_root_node);