powerpc/64: Handle linker stubs in low .text code
Very large kernels may require linker stubs for branches from HEAD text code. The linker may place these stubs before the HEAD text sections, which breaks the assumption that HEAD text is located at 0 (or the .text section being located at 0x7000/0x8000 on Book3S kernels). Provide an option to create a small section just before the .text section with an empty 256 - 4 bytes, and adjust the start of the .text section to match. The linker will tend to put stubs in that section and not break our relative-to-absolute offset assumptions. This causes a small waste of space on common kernels, but allows large kernels to build and boot. For now, it is an EXPERT config option, defaulting to =n, but a reference is provided for it in the build-time check for such breakage. This is good enough for allyesconfig and custom users / hackers. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
4ea80652dc
commit
951eedebcd
@@ -103,6 +103,11 @@ SECTIONS
|
||||
* section placement to work.
|
||||
*/
|
||||
.text BLOCK(0) : AT(ADDR(.text) - LOAD_OFFSET) {
|
||||
#ifdef CONFIG_LD_HEAD_STUB_CATCH
|
||||
*(.linker_stub_catch);
|
||||
. = . ;
|
||||
#endif
|
||||
|
||||
#else
|
||||
.text : AT(ADDR(.text) - LOAD_OFFSET) {
|
||||
ALIGN_FUNCTION();
|
||||
|
Reference in New Issue
Block a user