Re: [tip:x86/asm] debug: Fix __bug_table[] in arch linker scripts

From: Peter Zijlstra
Date: Mon Apr 03 2017 - 08:25:24 EST


On Mon, Apr 03, 2017 at 02:57:48AM -0700, hpa@xxxxxxxxx wrote:
> On April 3, 2017 1:27:49 AM PDT, tip-bot for Peter Zijlstra <tipbot@xxxxxxxxx> wrote:
> >diff --git a/arch/x86/kernel/vmlinux.lds.S
> >b/arch/x86/kernel/vmlinux.lds.S
> >index c74ae9c..c8a3b61 100644
> >--- a/arch/x86/kernel/vmlinux.lds.S
> >+++ b/arch/x86/kernel/vmlinux.lds.S
> >@@ -146,6 +146,7 @@ SECTIONS
> > _edata = .;
> > } :data
> >
> >+ BUG_TABLE
> >
> > . = ALIGN(PAGE_SIZE);
> > __vvar_page = .;
>
> Case in point why we want structured linker tables, btw...

Yes.

Btw, can you explain why x86 builds and works without this patch?
Because as far as I understand this (which isn't very far), we should
fail linking with an unresolved symbol without this.