Commit b6adc6d6 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

powerpc/build: move .data.rel.ro, .sdata2 to read-only

.sdata2 is a readonly small data section for ppc32, and .data.rel.ro
is data that needs relocating but is read-only after that so these
can both be moved to the read only memory region.
Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220916040755.2398112-5-npiggin@gmail.com
parent f21ba449
...@@ -135,6 +135,16 @@ SECTIONS ...@@ -135,6 +135,16 @@ SECTIONS
/* Read-only data */ /* Read-only data */
RO_DATA(PAGE_SIZE) RO_DATA(PAGE_SIZE)
#ifdef CONFIG_PPC32
.sdata2 : AT(ADDR(.sdata2) - LOAD_OFFSET) {
*(.sdata2)
}
#endif
.data.rel.ro : AT(ADDR(.data.rel.ro) - LOAD_OFFSET) {
*(.data.rel.ro*)
}
.branch_lt : AT(ADDR(.branch_lt) - LOAD_OFFSET) { .branch_lt : AT(ADDR(.branch_lt) - LOAD_OFFSET) {
*(.branch_lt) *(.branch_lt)
} }
...@@ -349,19 +359,13 @@ SECTIONS ...@@ -349,19 +359,13 @@ SECTIONS
. = ALIGN(PAGE_SIZE); . = ALIGN(PAGE_SIZE);
_sdata = .; _sdata = .;
#ifdef CONFIG_PPC32
.data : AT(ADDR(.data) - LOAD_OFFSET) { .data : AT(ADDR(.data) - LOAD_OFFSET) {
DATA_DATA DATA_DATA
*(.data.rel*) *(.data.rel*)
#ifdef CONFIG_PPC32
*(SDATA_MAIN) *(SDATA_MAIN)
*(.sdata2)
}
#else
.data : AT(ADDR(.data) - LOAD_OFFSET) {
DATA_DATA
*(.data.rel*)
}
#endif #endif
}
/* The initial task and kernel stack */ /* The initial task and kernel stack */
INIT_TASK_DATA_SECTION(THREAD_ALIGN) INIT_TASK_DATA_SECTION(THREAD_ALIGN)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment