]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
debug: Fix __bug_table[] in arch linker scripts
authorPeter Zijlstra <peterz@infradead.org>
Thu, 30 Mar 2017 15:49:27 +0000 (17:49 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 3 Apr 2017 08:22:40 +0000 (10:22 +0200)
The kbuild test robot reported this build failure on a number
of architectures:

 >         make.cross ARCH=arm
 >    lib/lib.a(bug.o): In function `find_bug':
 > >> lib/bug.c:135: undefined reference to `__start___bug_table'
 > >> lib/bug.c:135: undefined reference to `__stop___bug_table'

Caused by:

  19d436268dde ("debug: Add _ONCE() logic to report_bug()")

Which moved the BUG_TABLE from RO_DATA_SECTION() to RW_DATA_SECTION(),
but a number of architectures don't use RW_DATA_SECTION(), so they
ended up with no __bug_table[] ...

Ideally all those would use RW_DATA_SECTION() in their linker scripts,
but that's for another day.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kbuild test robot <fengguang.wu@intel.com>
Cc: kbuild-all@01.org
Cc: tipbuild@zytor.com
Link: http://lkml.kernel.org/r/20170330154927.o6qmgfp4bdhrajbm@hirez.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/arm/kernel/vmlinux-xip.lds.S
arch/arm/kernel/vmlinux.lds.S
arch/avr32/kernel/vmlinux.lds.S
arch/blackfin/kernel/vmlinux.lds.S
arch/c6x/kernel/vmlinux.lds.S
arch/cris/kernel/vmlinux.lds.S
arch/frv/kernel/vmlinux.lds.S
arch/ia64/kernel/vmlinux.lds.S
arch/mips/kernel/vmlinux.lds.S
arch/powerpc/kernel/vmlinux.lds.S
arch/x86/kernel/vmlinux.lds.S

index 37b2a11af34592b5f60f0db77ce014588f9327f4..8265b116218de4f44314b16d7795acae2492b12d 100644 (file)
@@ -242,6 +242,8 @@ SECTIONS
        }
        _edata_loc = __data_loc + SIZEOF(.data);
 
+       BUG_TABLE
+
 #ifdef CONFIG_HAVE_TCM
         /*
         * We align everything to a page boundary so we can
index ce18007f9e4eb08d1b36ad7103f15e7adadaae9e..c83a7ba737d6a96dedfe1dec88967d824309e538 100644 (file)
@@ -262,6 +262,8 @@ SECTIONS
        }
        _edata_loc = __data_loc + SIZEOF(.data);
 
+       BUG_TABLE
+
 #ifdef CONFIG_HAVE_TCM
         /*
         * We align everything to a page boundary so we can
index 17f2730eb4978de7660933cbe04c233f6df78f14..623d18db04665f3f560774b851ef0a0424fe37b7 100644 (file)
@@ -75,6 +75,7 @@ SECTIONS
 
                _edata = .;
        }
+       BUG_TABLE
 
        BSS_SECTION(0, 8, 8)
        _end = .;
index 68069a120055b359b671b5890d2797f63027c007..334ef8139b35b7752eef6593bdb26314cf8d8b96 100644 (file)
@@ -115,6 +115,8 @@ SECTIONS
        __data_lma = LOADADDR(.data);
        __data_len = SIZEOF(.data);
 
+       BUG_TABLE
+
        /* The init section should be last, so when we free it, it goes into
         * the general memory pool, and (hopefully) will decrease fragmentation
         * a tiny bit. The init section has a _requirement_ that it be
index a1a5c166bc9b8b125bfd4e515ab7a16afad0bc65..29ebea49ddd5ae2b957c9fb8c4d60f674750989a 100644 (file)
@@ -128,6 +128,8 @@ SECTIONS
                . = ALIGN(8);
        }
 
+       BUG_TABLE
+
        _edata = .;
 
        __bss_start = .;
index 97958626152000cd24d171ea0fa0c3326f77ffe7..867f237d7c5c361a8bd02c2cb28d9f35794532a9 100644 (file)
@@ -68,6 +68,8 @@ SECTIONS
        __edata = . ;                   /* End of data section. */
        _edata = . ;
 
+       BUG_TABLE
+
        INIT_TASK_DATA_SECTION(PAGE_SIZE)
 
        . = ALIGN(PAGE_SIZE);           /* Init code and data. */
index aa6e573d57da46d1cb05bec37cb9dfcc7bfac13f..3f44dcbbad4d5b3605d2b088c154d36db531cf00 100644 (file)
@@ -102,6 +102,8 @@ SECTIONS
 
   _edata = .;                  /* End of data section */
 
+  BUG_TABLE
+
   /* GP section */
   . = ALIGN(L1_CACHE_BYTES);
   _gp = . + 2048;
index f89d20c9741225e4d416713fd32819e6937c00e9..798026dde52e42b81455bcd4547778a2f3369616 100644 (file)
@@ -192,6 +192,8 @@ SECTIONS {
                CONSTRUCTORS
        }
 
+       BUG_TABLE
+
        . = ALIGN(16);  /* gp must be 16-byte aligned for exc. table */
        .got : AT(ADDR(.got) - LOAD_OFFSET) {
                *(.got.plt)
index f0a0e6d62be38e5bcdb6f8c044f4b026ca940851..8ca2371aa684bb7ddcc6b83b0de8b93c87e93db3 100644 (file)
@@ -97,6 +97,7 @@ SECTIONS
                DATA_DATA
                CONSTRUCTORS
        }
+       BUG_TABLE
        _gp = . + 0x8000;
        .lit8 : {
                *(.lit8)
index 7394b770ae1f6b2402ef2b04fe23e92eae2c7ee2..1c24c894c9082249c0cc32dc078cd1905b62a548 100644 (file)
@@ -312,6 +312,8 @@ SECTIONS
                NOSAVE_DATA
        }
 
+       BUG_TABLE
+
        . = ALIGN(PAGE_SIZE);
        _edata  =  .;
        PROVIDE32 (edata = .);
index c74ae9ce8dc40307e870b0dbabd2031cf5c116a4..c8a3b61be0aa0b48605396a4dd24af233e3475a4 100644 (file)
@@ -146,6 +146,7 @@ SECTIONS
                _edata = .;
        } :data
 
+       BUG_TABLE
 
        . = ALIGN(PAGE_SIZE);
        __vvar_page = .;