From 3d3d6a85dfa1fa6b6a33d710dedd866666bec2ad Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Fri, 12 May 2017 13:01:25 -0700 Subject: [PATCH] x86: remove hacks to include functions None of this is currently necessary, the spurious interrupt stubs and exception entry code is included in the binary just fine. To make matters worse, some data referenced lives in the .intList section which is completely stripped out of the binary. If in the future we find certain essential functions are being garbage collected when they should not be, the proper way to mitigate this is with KEEP() directives in the linker script. Signed-off-by: Andrew Boie --- arch/x86/core/irq_manage.c | 11 ----------- arch/x86/include/kernel_arch_func.h | 23 ----------------------- 2 files changed, 34 deletions(-) diff --git a/arch/x86/core/irq_manage.c b/arch/x86/core/irq_manage.c index d9a1682cda7..4fee223ddad 100644 --- a/arch/x86/core/irq_manage.c +++ b/arch/x86/core/irq_manage.c @@ -25,17 +25,6 @@ extern void _SpuriousIntHandler(void *); extern void _SpuriousIntNoErrCodeHandler(void *); -/* - * These 'dummy' variables are used in kernel_arch_init() to force the - * inclusion of the spurious interrupt handlers. They *must* be declared in a - * module other than the one they are used in to get around garbage collection - * issues and warnings issued some compilers that they aren't used. Therefore - * care must be taken if they are to be moved. See kernel_structs.h for more - * information. - */ -void *_dummy_spurious_interrupt; -void *_dummy_exception_vector_stub; - /* * Place the addresses of the spurious interrupt handlers into the intList * section. The genIdt tool can then populate any unused vectors with diff --git a/arch/x86/include/kernel_arch_func.h b/arch/x86/include/kernel_arch_func.h index 57ba77aa1e5..cd0e52e8727 100644 --- a/arch/x86/include/kernel_arch_func.h +++ b/arch/x86/include/kernel_arch_func.h @@ -32,33 +32,10 @@ extern "C" { */ static inline void kernel_arch_init(void) { - extern void *__isr___SpuriousIntHandler; - extern void *_dummy_spurious_interrupt; - extern void *_dummy_exception_vector_stub; extern char _interrupt_stack[CONFIG_ISR_STACK_SIZE]; - extern void _exception_enter(void); - _kernel.nested = 0; - _kernel.irq_stack = _interrupt_stack + CONFIG_ISR_STACK_SIZE; - /* - * Forces the inclusion of the spurious interrupt handlers. If a - * reference isn't made then intconnect.o is never pulled in by the - * linker. - */ - - _dummy_spurious_interrupt = &__isr___SpuriousIntHandler; - - /* - * Forces the inclusion of the exception vector stub code. If a - * reference isn't made then excstubs.o is never pulled in by the - * linker. - */ - - _dummy_exception_vector_stub = &_exception_enter; - - } /**