Two global objects can't have the same address in C. Clang uses this fact to omit the check on the first iteration of the loop in check_exception_table. Signed-off-by: Bill Wendling <morbo@xxxxxxxxxx> --- lib/x86/desc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/x86/desc.c b/lib/x86/desc.c index 451f504..bfe8651 100644 --- a/lib/x86/desc.c +++ b/lib/x86/desc.c @@ -41,7 +41,7 @@ struct ex_record { unsigned long handler; }; -extern struct ex_record exception_table_start, exception_table_end; +extern struct ex_record exception_table_start, *exception_table_end; static const char* exception_mnemonic(int vector) { @@ -113,7 +113,7 @@ static void check_exception_table(struct ex_regs *regs) (((regs->rflags >> 16) & 1) << 8); asm("mov %0, %%gs:4" : : "r"(ex_val)); - for (ex = &exception_table_start; ex != &exception_table_end; ++ex) { + for (ex = &exception_table_start; ex != exception_table_end; ++ex) { if (ex->rip == regs->rip) { regs->rip = ex->handler; return; -- 2.23.0.700.g56cf767bdb-goog