Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5effd38 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar
Browse files

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:

  19d43626 ("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: default avatarPeter 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: default avatarIngo Molnar <mingo@kernel.org>
parent 19d43626
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ SECTIONS

		_edata = .;
	}
	BUG_TABLE

	BSS_SECTION(0, 8, 8)
	_end = .;
+2 −0
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -128,6 +128,8 @@ SECTIONS
		. = ALIGN(8);
	}

	BUG_TABLE

	_edata = .;

	__bss_start = .;
Loading