From ddff722d2e75ec5923cd197c7e6043c7a74e977c Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 27 Mar 2018 10:07:11 +0200 Subject: [PATCH] make DEFAULT_HANDLER an undefined symbol --- link.x | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/link.x b/link.x index 6f39655f..bc89db45 100644 --- a/link.x +++ b/link.x @@ -3,10 +3,14 @@ INCLUDE memory.x /* With multiple codegen units the rlib produced for this crate has several object files in it. */ /* Because the linker is Smart it may not look into all the object files and not pick up the */ /* .vector_table.exceptions section. But we want it to! To workaround the problem we create an */ -/* undefined reference to the EXCEPTIONS symbol (located in .vector_table.exceptions); this way the */ -/* linker will look at all the object of the rlib and pick up our EXCEPTIONS symbol */ +/* undefined reference to the EXCEPTIONS symbol (located in .vector_table.exceptions); this way +/* the linker will look at all the object of the rlib and pick up our EXCEPTIONS symbol */ EXTERN(EXCEPTIONS); +/* Without this if the top (binary) crate defines the DEFAULT_HANDLER symbol (e.g. via */ +/* default_handler!) then it will be ignored / dropped */ +EXTERN(DEFAULT_HANDLER); + /* Create an undefined reference to the INTERRUPTS symbol. This is required to force the linker to *not* drop the INTERRUPTS symbol if it comes from an object file that's passed to the linker *before* this crate */