diff options
author | Peter Zijlstra <peterz@infradead.org> | 2017-03-30 11:49:27 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-04-03 04:22:40 -0400 |
commit | b5effd3815ccbe3df1a015a6d67d8a24a27813d5 (patch) | |
tree | 297de309e13268cd225e688b1a0d35e97869ae74 | |
parent | 19d436268dde95389c616bb3819da73f0a8b28a8 (diff) |
debug: Fix __bug_table[] in arch linker scripts
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>
-rw-r--r-- | arch/arm/kernel/vmlinux-xip.lds.S | 2 | ||||
-rw-r--r-- | arch/arm/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/avr32/kernel/vmlinux.lds.S | 1 | ||||
-rw-r--r-- | arch/blackfin/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/c6x/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/cris/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/frv/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/mips/kernel/vmlinux.lds.S | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/x86/kernel/vmlinux.lds.S | 1 |
11 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S index 37b2a11af345..8265b116218d 100644 --- a/arch/arm/kernel/vmlinux-xip.lds.S +++ b/arch/arm/kernel/vmlinux-xip.lds.S | |||
@@ -242,6 +242,8 @@ SECTIONS | |||
242 | } | 242 | } |
243 | _edata_loc = __data_loc + SIZEOF(.data); | 243 | _edata_loc = __data_loc + SIZEOF(.data); |
244 | 244 | ||
245 | BUG_TABLE | ||
246 | |||
245 | #ifdef CONFIG_HAVE_TCM | 247 | #ifdef CONFIG_HAVE_TCM |
246 | /* | 248 | /* |
247 | * We align everything to a page boundary so we can | 249 | * We align everything to a page boundary so we can |
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index ce18007f9e4e..c83a7ba737d6 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S | |||
@@ -262,6 +262,8 @@ SECTIONS | |||
262 | } | 262 | } |
263 | _edata_loc = __data_loc + SIZEOF(.data); | 263 | _edata_loc = __data_loc + SIZEOF(.data); |
264 | 264 | ||
265 | BUG_TABLE | ||
266 | |||
265 | #ifdef CONFIG_HAVE_TCM | 267 | #ifdef CONFIG_HAVE_TCM |
266 | /* | 268 | /* |
267 | * We align everything to a page boundary so we can | 269 | * We align everything to a page boundary so we can |
diff --git a/arch/avr32/kernel/vmlinux.lds.S b/arch/avr32/kernel/vmlinux.lds.S index 17f2730eb497..623d18db0466 100644 --- a/arch/avr32/kernel/vmlinux.lds.S +++ b/arch/avr32/kernel/vmlinux.lds.S | |||
@@ -75,6 +75,7 @@ SECTIONS | |||
75 | 75 | ||
76 | _edata = .; | 76 | _edata = .; |
77 | } | 77 | } |
78 | BUG_TABLE | ||
78 | 79 | ||
79 | BSS_SECTION(0, 8, 8) | 80 | BSS_SECTION(0, 8, 8) |
80 | _end = .; | 81 | _end = .; |
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S index 68069a120055..334ef8139b35 100644 --- a/arch/blackfin/kernel/vmlinux.lds.S +++ b/arch/blackfin/kernel/vmlinux.lds.S | |||
@@ -115,6 +115,8 @@ SECTIONS | |||
115 | __data_lma = LOADADDR(.data); | 115 | __data_lma = LOADADDR(.data); |
116 | __data_len = SIZEOF(.data); | 116 | __data_len = SIZEOF(.data); |
117 | 117 | ||
118 | BUG_TABLE | ||
119 | |||
118 | /* The init section should be last, so when we free it, it goes into | 120 | /* The init section should be last, so when we free it, it goes into |
119 | * the general memory pool, and (hopefully) will decrease fragmentation | 121 | * the general memory pool, and (hopefully) will decrease fragmentation |
120 | * a tiny bit. The init section has a _requirement_ that it be | 122 | * a tiny bit. The init section has a _requirement_ that it be |
diff --git a/arch/c6x/kernel/vmlinux.lds.S b/arch/c6x/kernel/vmlinux.lds.S index a1a5c166bc9b..29ebea49ddd5 100644 --- a/arch/c6x/kernel/vmlinux.lds.S +++ b/arch/c6x/kernel/vmlinux.lds.S | |||
@@ -128,6 +128,8 @@ SECTIONS | |||
128 | . = ALIGN(8); | 128 | . = ALIGN(8); |
129 | } | 129 | } |
130 | 130 | ||
131 | BUG_TABLE | ||
132 | |||
131 | _edata = .; | 133 | _edata = .; |
132 | 134 | ||
133 | __bss_start = .; | 135 | __bss_start = .; |
diff --git a/arch/cris/kernel/vmlinux.lds.S b/arch/cris/kernel/vmlinux.lds.S index 979586261520..867f237d7c5c 100644 --- a/arch/cris/kernel/vmlinux.lds.S +++ b/arch/cris/kernel/vmlinux.lds.S | |||
@@ -68,6 +68,8 @@ SECTIONS | |||
68 | __edata = . ; /* End of data section. */ | 68 | __edata = . ; /* End of data section. */ |
69 | _edata = . ; | 69 | _edata = . ; |
70 | 70 | ||
71 | BUG_TABLE | ||
72 | |||
71 | INIT_TASK_DATA_SECTION(PAGE_SIZE) | 73 | INIT_TASK_DATA_SECTION(PAGE_SIZE) |
72 | 74 | ||
73 | . = ALIGN(PAGE_SIZE); /* Init code and data. */ | 75 | . = ALIGN(PAGE_SIZE); /* Init code and data. */ |
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S index aa6e573d57da..3f44dcbbad4d 100644 --- a/arch/frv/kernel/vmlinux.lds.S +++ b/arch/frv/kernel/vmlinux.lds.S | |||
@@ -102,6 +102,8 @@ SECTIONS | |||
102 | 102 | ||
103 | _edata = .; /* End of data section */ | 103 | _edata = .; /* End of data section */ |
104 | 104 | ||
105 | BUG_TABLE | ||
106 | |||
105 | /* GP section */ | 107 | /* GP section */ |
106 | . = ALIGN(L1_CACHE_BYTES); | 108 | . = ALIGN(L1_CACHE_BYTES); |
107 | _gp = . + 2048; | 109 | _gp = . + 2048; |
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index f89d20c97412..798026dde52e 100644 --- a/arch/ia64/kernel/vmlinux.lds.S +++ b/arch/ia64/kernel/vmlinux.lds.S | |||
@@ -192,6 +192,8 @@ SECTIONS { | |||
192 | CONSTRUCTORS | 192 | CONSTRUCTORS |
193 | } | 193 | } |
194 | 194 | ||
195 | BUG_TABLE | ||
196 | |||
195 | . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */ | 197 | . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */ |
196 | .got : AT(ADDR(.got) - LOAD_OFFSET) { | 198 | .got : AT(ADDR(.got) - LOAD_OFFSET) { |
197 | *(.got.plt) | 199 | *(.got.plt) |
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index f0a0e6d62be3..8ca2371aa684 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S | |||
@@ -97,6 +97,7 @@ SECTIONS | |||
97 | DATA_DATA | 97 | DATA_DATA |
98 | CONSTRUCTORS | 98 | CONSTRUCTORS |
99 | } | 99 | } |
100 | BUG_TABLE | ||
100 | _gp = . + 0x8000; | 101 | _gp = . + 0x8000; |
101 | .lit8 : { | 102 | .lit8 : { |
102 | *(.lit8) | 103 | *(.lit8) |
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 7394b770ae1f..1c24c894c908 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S | |||
@@ -312,6 +312,8 @@ SECTIONS | |||
312 | NOSAVE_DATA | 312 | NOSAVE_DATA |
313 | } | 313 | } |
314 | 314 | ||
315 | BUG_TABLE | ||
316 | |||
315 | . = ALIGN(PAGE_SIZE); | 317 | . = ALIGN(PAGE_SIZE); |
316 | _edata = .; | 318 | _edata = .; |
317 | PROVIDE32 (edata = .); | 319 | PROVIDE32 (edata = .); |
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index c74ae9ce8dc4..c8a3b61be0aa 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S | |||
@@ -146,6 +146,7 @@ SECTIONS | |||
146 | _edata = .; | 146 | _edata = .; |
147 | } :data | 147 | } :data |
148 | 148 | ||
149 | BUG_TABLE | ||
149 | 150 | ||
150 | . = ALIGN(PAGE_SIZE); | 151 | . = ALIGN(PAGE_SIZE); |
151 | __vvar_page = .; | 152 | __vvar_page = .; |