@@ -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;
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@google.com> --- lib/x86/desc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)