powerpc: build / linker improvements
Nicholas Piggin
reviewerv2 cover powerpc: build / linker improvements
This series is mainly about moving more things out of writable and executable memory, and slightly moving the linker script in the direction of the binutils ld internal linker script as we do.
Thanks,
Nick
Since v1:
- Move sys_call_table data.rel.ro patch to the end.
- And fix the changelog in that patch, the relocations were a red herring.
- Update the changelog in the __end_rodata patch.
- Align __end_rodata to strict align size.
Nicholas Piggin (7):
powerpc: move __end_rodata to cover arch read-only sections powerpc/32/build: move got1/got2 sections out of text powerpc/build: move got, toc, plt, branch_lt sections to read-only powerpc/build: move .data.rel.ro, .sdata2 to read-only powerpc/64/build: only include .opd with ELFv1 powerpc/64/build: merge .got and .toc input sections powerpc/build: put sys_call_table in .data.rel.ro if RELOCATABLE
arch/powerpc/kernel/systbl.S | 4 ++ arch/powerpc/kernel/vmlinux.lds.S | 85 +++++++++++++++--------- arch/powerpc/mm/book3s32/mmu.c | 2 +- arch/powerpc/mm/book3s64/hash_pgtable.c | 2 +- arch/powerpc/mm/book3s64/radix_pgtable.c | 6 +- arch/powerpc/mm/pgtable_32.c | 7 +- 6 files changed, 66 insertions(+), 40 deletions(-)
Signature · 1 line
2.37.2
Nicholas Piggin
reviewerPATCH v2 1/7 powerpc: move __end_rodata to cover arch read-only sections
powerpc has a number of read-only sections and tables that are put after RO_DATA(). Move the __end_rodata symbol to cover these as well.
Setting memory to read-only at boot is done using __init_begin, change that that to use __end_rodata. This removes the requirement for the init section to follow read-only data.
This makes is_kernel_rodata() exactly cover the read-only region, as well as other things using __end_rodata (e.g., kernel/dma/debug.c). Boot dmesg also prints the rodata size more accurately.
--- arch/powerpc/kernel/vmlinux.lds.S | 3 +++ arch/powerpc/mm/book3s32/mmu.c | 2 +- arch/powerpc/mm/book3s64/hash_pgtable.c | 2 +- arch/powerpc/mm/book3s64/radix_pgtable.c | 6 +++--- arch/powerpc/mm/pgtable_32.c | 7 ++++--- 5 files changed, 12 insertions(+), 8 deletions(-)
arch/powerpc/kernel/vmlinux.lds.S +3 -0
@@ -210,6 +210,9 @@ SECTIONS } #endif + . = ALIGN(STRICT_ALIGN_SIZE); + __end_rodata = .; + /* * Init sections discarded at runtime */
arch/powerpc/mm/book3s32/mmu.c +1 -1
@@ -240,7 +240,7 @@ void mmu_mark_rodata_ro(void)for (i =0 ; i < nb; i++) {struct ppc_bat *bat =BATS [i]; -if (bat_addrs[i].start < (unsigned long )__init_begin) +if (bat_addrs[i].start < (unsigned long )__end_rodata) bat[1 ].batl = (bat[1 ].batl & ~BPP_RW ) |BPP_RX ; }
arch/powerpc/mm/book3s64/hash_pgtable.c +1 -1
@@ -541,7 +541,7 @@ void hash__mark_rodata_ro(void)unsigned long start, end, pp; start = (unsigned long )_stext; - end = (unsigned long )__init_begin; + end = (unsigned long )__end_rodata; pp =htab_convert_pte_flags (pgprot_val (PAGE_KERNEL_ROX ),HPTE_USE_KERNEL_KEY );
arch/powerpc/mm/book3s64/radix_pgtable.c +3 -3
@@ -228,7 +228,7 @@ void radix__mark_rodata_ro(void)unsigned long start, end; start = (unsigned long )_stext; - end = (unsigned long )__init_begin; + end = (unsigned long )__end_rodata;radix__change_memory_range (start, end, _PAGE_WRITE); }
@@ -259,8 +259,8 @@ print_mapping(unsigned long start, unsigned long end, unsigned long size, bool estatic unsigned long next_boundary (unsigned long addr,unsigned long end) {#ifdef CONFIG_STRICT_KERNEL_RWX -if (addr <__pa_symbol (__init_begin)) -return __pa_symbol (__init_begin); +if (addr <__pa_symbol (__end_rodata)) +return __pa_symbol (__end_rodata);#endif return end; }
arch/powerpc/mm/pgtable_32.c +4 -3
@@ -158,10 +158,11 @@ void mark_rodata_ro(void) }/* -* mark .text and .rodata as read only. Use __init_begin rather than -* __end_rodata to cover NOTES and EXCEPTION_TABLE. +* mark text and rodata as read only. __end_rodata is set by +* powerpc's linker script and includes tables and data +* requiring relocation which are not put in RO_DATA. */ - numpages =PFN_UP ((unsigned long )__init_begin) - + numpages =PFN_UP ((unsigned long )__end_rodata) -PFN_DOWN ((unsigned long )_stext);set_memory_ro ((unsigned long )_stext, numpages);
Signature · 1 line
2.37.2
Nicholas Piggin
reviewerPATCH v2 2/7 powerpc/32/build: move got1/got2 sections out of text
In reply to Nicholas PigginFollowing the example from the binutils default linker script, move .got1 and .got2 out of .text, to just after RO_DATA.
--- arch/powerpc/kernel/vmlinux.lds.S | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
arch/powerpc/kernel/vmlinux.lds.S +11 -10
@@ -122,14 +122,6 @@ SECTIONS *(.sfpr); MEM_KEEP(init.text) MEM_KEEP(exit.text) - -#ifdef CONFIG_PPC32 - *(.got1) - __got2_start = .; - *(.got2) - __got2_end = .; -#endif /* CONFIG_PPC32 */ - } :text . = ALIGN(PAGE_SIZE);
@@ -139,7 +131,16 @@ SECTIONS /* Read-only data */ RO_DATA(PAGE_SIZE) -#ifdef CONFIG_PPC64 +#ifdef CONFIG_PPC32 + .got1 : AT(ADDR(.got1) - LOAD_OFFSET) { + *(.got1) + } + .got2 : AT(ADDR(.got2) - LOAD_OFFSET) { + __got2_start = .; + *(.got2) + __got2_end = .; + } +#else /* CONFIG_PPC32 */ SOFT_MASK_TABLE(8) RESTART_TABLE(8)
@@ -190,7 +191,7 @@ SECTIONS *(__rfi_flush_fixup) __stop___rfi_flush_fixup = .; } -#endif /* CONFIG_PPC64 */ +#endif /* CONFIG_PPC32 */ #ifdef CONFIG_PPC_BARRIER_NOSPEC . = ALIGN(8);
Signature · 1 line
2.37.2
Nicholas Piggin
reviewerPATCH v2 3/7 powerpc/build: move got, toc, plt, branch_lt sections to read-only
In reply to Nicholas PigginThis moves linker-related tables from .data to read-only area. Relocations are performed at early boot time before memory is protected, after which there should be no modifications required.
--- arch/powerpc/kernel/vmlinux.lds.S | 42 ++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 15 deletions(-)
arch/powerpc/kernel/vmlinux.lds.S +27 -15
@@ -131,6 +131,10 @@ SECTIONS /* Read-only data */ RO_DATA(PAGE_SIZE) + .branch_lt : AT(ADDR(.branch_lt) - LOAD_OFFSET) { + *(.branch_lt) + } + #ifdef CONFIG_PPC32 .got1 : AT(ADDR(.got1) - LOAD_OFFSET) { *(.got1)
@@ -140,7 +144,30 @@ SECTIONS *(.got2) __got2_end = .; } + .got : AT(ADDR(.got) - LOAD_OFFSET) SPECIAL { + *(.got) + *(.got.plt) + } + .plt : AT(ADDR(.plt) - LOAD_OFFSET) SPECIAL { + /* XXX: is .plt (and .got.plt) required? */ + *(.plt) + } + #else /* CONFIG_PPC32 */ + .toc1 : AT(ADDR(.toc1) - LOAD_OFFSET) { + *(.toc1) + } + + .got : AT(ADDR(.got) - LOAD_OFFSET) ALIGN(256) { + *(.got) +#ifndef CONFIG_RELOCATABLE + __prom_init_toc_start = .; + arch/powerpc/kernel/prom_init.o*(.toc) + __prom_init_toc_end = .; +#endif + *(.toc) + } + SOFT_MASK_TABLE(8) RESTART_TABLE(8)
@@ -327,26 +354,11 @@ SECTIONS *(.data.rel*) *(SDATA_MAIN) *(.sdata2) - *(.got.plt) *(.got) - *(.plt) - *(.branch_lt) } #else .data : AT(ADDR(.data) - LOAD_OFFSET) { DATA_DATA *(.data.rel*) - *(.toc1) - *(.branch_lt) - } - - .got : AT(ADDR(.got) - LOAD_OFFSET) ALIGN(256) { - *(.got) -#ifndef CONFIG_RELOCATABLE - __prom_init_toc_start = .; - arch/powerpc/kernel/prom_init.o*(.toc) - __prom_init_toc_end = .; -#endif - *(.toc) } #endif
Signature · 1 line
2.37.2
kernel test robot
build botRe: [PATCH v2 3/7] powerpc/build: move got, toc, plt, branch_lt sections to read-only
I love your patch! Yet something to improve:
Hi Nicholas,
I love your patch! Yet something to improve:
[auto build test ERROR on powerpc/next]
[also build test ERROR on linus/master v6.0-rc5 next-20220916] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Nicholas-Piggin/powerpc-build-linker-improvements/20220916-121310 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc-microwatt_defconfig (https://download.01.org/0day-ci/archive/20220918/[email protected]/config) compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/6c034c08f8d0addb6fecba38c9c428b1c4df7c29
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Nicholas-Piggin/powerpc-build-linker-improvements/20220916-121310 git checkout 6c034c08f8d0addb6fecba38c9c428b1c4df7c29
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
All errors (new ones prefixed by >>):
>> ld.lld: error: ./arch/powerpc/kernel/vmlinux.lds:46: { expected, but got SPECIAL
>>> .got : AT(ADDR(.got) - (0xc0000000 -0x00000000)) SPECIAL {
>>> ^Signature · 2 lines
0-DAY CI Kernel Test Service https://01.org/lkp
Michael Ellerman
reviewerRe: [PATCH v2 3/7] powerpc/build: move got, toc, plt, branch_lt sections to read-only
Quoted 14 lines · kernel test robot
Hi Nicholas,
I love your patch! Yet something to improve:
[auto build test ERROR on powerpc/next]
[also build test ERROR on linus/master v6.0-rc5 next-20220916] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]url: https://github.com/intel-lab-lkp/linux/commits/Nicholas-Piggin/powerpc-build-linker-improvements/20220916-121310 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc-microwatt_defconfig (https://download.01.org/0day-ci/archive/20220918/202209180437.4U3soljK-lkp(a)intel.com/config) compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
Quoted 12 lines
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/6c034c08f8d0addb6fecba38c9c428b1c4df7c29
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Nicholas-Piggin/powerpc-build-linker-improvements/20220916-121310 git checkout6c034c08f8d0addb6fecba38c9c428b1c4df7c29
# save the config file
mkdirbuild_dir&& cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash
^^^^^
Quoted 8 lines
If you fix the issue, kindly add following tag where applicable
Reported-by kernel test robot <[email protected]>All errors (new ones prefixed by >>):
Quoted 3 lines
Quoted 3 lines
ld.lld: error:
./arch/powerpc/kernel/vmlinux.lds:46: { expected, but got SPECIALQuoted 2 lines
.got : AT(ADDR(.got) - (0xc0000000 -0x00000000)) SPECIAL { ^
I guess SPECIAL is a binutils ld ism?
I can't find it documented anywhere.
Presumably we can just not use it, given we never did before?
cheers
Nicholas Piggin
reviewerRe: [PATCH v2 3/7] powerpc/build: move got, toc, plt, branch_lt sections to read-only
Quoted 35 lines · Michael Ellerman
Quoted 14 lines · kernel test robot
Hi Nicholas,
I love your patch! Yet something to improve:
[auto build test ERROR on powerpc/next]
[also build test ERROR on linus/master v6.0-rc5 next-20220916] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]url: https://github.com/intel-lab-lkp/linux/commits/Nicholas-Piggin/powerpc-build-linker-improvements/20220916-121310 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc-microwatt_defconfig (https://download.01.org/0day-ci/archive/20220918/202209180437.4U3soljK-lkp(a)intel.com/config) compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)Quoted 12 lines
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/6c034c08f8d0addb6fecba38c9c428b1c4df7c29
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Nicholas-Piggin/powerpc-build-linker-improvements/20220916-121310 git checkout6c034c08f8d0addb6fecba38c9c428b1c4df7c29
# save the config file
mkdirbuild_dir&& cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash^^^^^Quoted 6 lines
If you fix the issue, kindly add following tag where applicable
Reported-by kernel test robot <[email protected]>All errors (new ones prefixed by >>):
Quoted 1 line
Quoted 1 line
ld.lld: error:
./arch/powerpc/kernel/vmlinux.lds:46: { expected, but got SPECIAL
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
.got : AT(ADDR(.got) - (0xc0000000 -0x00000000)) SPECIAL { ^I guess SPECIAL is a binutils ld ism?
I can't find it documented anywhere.
Presumably we can just not use it, given we never did before?
Yeah that's what it is, oops I just took it from the linker script.
I think we can drop it, I think it selects either old or new plt sections that are created with --secure-plt, I guess depending on some link options and copmatibility concerns. Doesn't look like ppc32 uses --secure-plt.
Thanks,
Nick
Nicholas Piggin
reviewerPATCH v2 4/7 powerpc/build: move .data.rel.ro, .sdata2 to read-only
In reply to Nicholas Piggin.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.
--- arch/powerpc/kernel/vmlinux.lds.S | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
arch/powerpc/kernel/vmlinux.lds.S +12 -8
@@ -131,6 +131,16 @@ SECTIONS /* Read-only data */ 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) }
@@ -348,19 +358,13 @@ SECTIONS . = ALIGN(PAGE_SIZE); _sdata = .; -#ifdef CONFIG_PPC32 .data : AT(ADDR(.data) - LOAD_OFFSET) { DATA_DATA *(.data.rel*) +#ifdef CONFIG_PPC32 *(SDATA_MAIN) - *(.sdata2) - } -#else - .data : AT(ADDR(.data) - LOAD_OFFSET) { - DATA_DATA - *(.data.rel*) - } #endif + } /* The initial task and kernel stack */ INIT_TASK_DATA_SECTION(THREAD_ALIGN)
Signature · 1 line
2.37.2
Nicholas Piggin
reviewerPATCH v2 5/7 powerpc/64/build: only include .opd with ELFv1
In reply to Nicholas PigginELFv2 does not use function descriptors so .opd is not required.
--- arch/powerpc/kernel/vmlinux.lds.S | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/kernel/vmlinux.lds.S +2 -0
@@ -181,11 +181,13 @@ SECTIONS SOFT_MASK_TABLE(8) RESTART_TABLE(8) +#ifdef CONFIG_PPC64_ELF_ABI_V1 .opd : AT(ADDR(.opd) - LOAD_OFFSET) { __start_opd = .; KEEP(*(.opd)) __end_opd = .; } +#endif . = ALIGN(8); __stf_entry_barrier_fixup : AT(ADDR(__stf_entry_barrier_fixup) - LOAD_OFFSET) {
Signature · 1 line
2.37.2
Nicholas Piggin
reviewerPATCH v2 6/7 powerpc/64/build: merge .got and .toc input sections
In reply to Nicholas PigginFollow the binutils ld internal linker script and merge .got and .toc input sections in the .got output section.
--- arch/powerpc/kernel/vmlinux.lds.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/kernel/vmlinux.lds.S +1 -2
@@ -169,13 +169,12 @@ SECTIONS } .got : AT(ADDR(.got) - LOAD_OFFSET) ALIGN(256) { - *(.got) + *(.got .toc) #ifndef CONFIG_RELOCATABLE __prom_init_toc_start = .; arch/powerpc/kernel/prom_init.o*(.toc) __prom_init_toc_end = .; #endif - *(.toc) } SOFT_MASK_TABLE(8)
Signature · 1 line
2.37.2
Re: [PATCH v2 6/7] powerpc/64/build: merge .got and .toc input sections
Le 16/09/2022 à 06:07, Nicholas Piggin a écrit :
Quoted 13 lines
Follow the binutils ld internal linker script and merge .got and .toc input sections in the .got output section.
Signed-off-by Nicholas Piggin <[email protected]>--- arch/powerpc/kernel/vmlinux.lds.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)arch/powerpc/kernel/vmlinux.lds.S +0
-0
arch/powerpc/kernel/vmlinux.lds.S SECTIONS · line 172
Quoted 5 lines
arch/powerpc/kernel/vmlinux.lds.S +1
-1@@ -169,13 +169,12 @@ SECTIONS } .got : AT(ADDR(.got) - LOAD_OFFSET) ALIGN(256) { - *(.got) + *(.got .toc)
At the begining I was thinking that this change would jeopardise the below, but in fact the #ifdef below is pointless, because prom_init.o is built only when CONFIG_PPC_OF_BOOT_TRAMPOLINE is selected but CONFIG_PPC_OF_BOOT_TRAMPOLINE selects CONFIG_RELOCATABLE
So all __prom_init_toc_ stuff can go away :
arch/powerpc/include/asm/sections.h:extern char __prom_init_toc_start[]; arch/powerpc/include/asm/sections.h:extern char __prom_init_toc_end[]; arch/powerpc/kernel/prom_init_check.sh:__prom_init_toc_start __prom_init_toc_end btext_setup_display TOC.arch/powerpc/kernel/vmlinux.lds.S: __prom_init_toc_start = .;arch/powerpc/kernel/vmlinux.lds.S: __prom_init_toc_end = .;
Quoted 9 lines
arch/powerpc/kernel/vmlinux.lds.S +0
-1#ifndef CONFIG_RELOCATABLE __prom_init_toc_start = .; arch/powerpc/kernel/prom_init.o*(.toc) __prom_init_toc_end = .; #endif - *(.toc) } SOFT_MASK_TABLE(8)
Michael Ellerman
reviewerRe: [PATCH v2 6/7] powerpc/64/build: merge .got and .toc input sections
Quoted 25 lines · Christophe Leroy
Le 16/09/2022 à 06:07, Nicholas Piggin a écrit :
Quoted 13 lines
Follow the binutils ld internal linker script and merge .got and .toc input sections in the .got output section.
Signed-off-by Nicholas Piggin <[email protected]>--- arch/powerpc/kernel/vmlinux.lds.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)arch/powerpc/kernel/vmlinux.lds.S +0
-0arch/powerpc/kernel/vmlinux.lds.S SECTIONS · line 172
Quoted 5 lines
arch/powerpc/kernel/vmlinux.lds.S +1
-1@@ -169,13 +169,12 @@ SECTIONS } .got : AT(ADDR(.got) - LOAD_OFFSET) ALIGN(256) { - *(.got) + *(.got .toc)At the begining I was thinking that this change would jeopardise the below, but in fact the #ifdef below is pointless, because prom_init.o is built only when
CONFIG_PPC_OF_BOOT_TRAMPOLINEis selected butCONFIG_PPC_OF_BOOT_TRAMPOLINEselectsCONFIG_RELOCATABLE
Quoted 8 lines
So all
__prom_init_toc_stuff can go away :arch/powerpc/include/asm/sections.h:extern char __prom_init_toc_start[]; arch/powerpc/include/asm/sections.h:extern char __prom_init_toc_end[]; arch/powerpc/kernel/prom_init_check.sh:__prom_init_toc_start
__prom_init_toc_endbtext_setup_displayTOC.arch/powerpc/kernel/vmlinux.lds.S:__prom_init_toc_start= .;arch/powerpc/kernel/vmlinux.lds.S:__prom_init_toc_end= .;
Yes you're right.
Missed cleanup by me in 24d33ac5b8ff ("powerpc/64s: Make prom_init require RELOCATABLE").
I'll send a patch tomorrow.
cheers
Nicholas Piggin
reviewerPATCH v2 7/7 powerpc/build: put sys_call_table in .data.rel.ro if RELOCATABLE
In reply to Nicholas PigginConst function pointers by convention live in .data.rel.ro if they need to be relocated. Now that .data.rel.ro is linked into the read-only region, put them in the right section. This doesn't make much practical difference, but it will make the C conversion of sys_call_table a smaller change as far as linking goes.
--- arch/powerpc/kernel/systbl.S | 4 ++++ 1 file changed, 4 insertions(+)
arch/powerpc/kernel/systbl.S +4 -0
@@ -12,7 +12,11 @@ #include <asm/ppc_asm.h> +#ifdef CONFIG_RELOCATABLE +.section .data.rel.ro,"aw" +#else .section .rodata,"a" +#endif #ifdef CONFIG_PPC64 .p2align 3
Signature · 1 line
2.37.2
Michael Ellerman
AppliedQuoted 8 lines · Nicholas Piggin
This series is mainly about moving more things out of writable and executable memory, and slightly moving the linker script in the direction of the binutils ld internal linker script as we do.
Thanks,
Nick[...]
Applied to powerpc/next.
[1/7] powerpc: move __end_rodata to cover arch read-only sections
https://git.kernel.org/powerpc/c/7082f8e7d2276575a8806370007cbb4a7b9abdce [2/7] powerpc/32/build: move got1/got2 sections out of text https://git.kernel.org/powerpc/c/1faa1235c1a00614bc4849a8dbd0790363c9a22f [3/7] powerpc/build: move got, toc, plt, branch_lt sections to read-only https://git.kernel.org/powerpc/c/f21ba4499a15b76ad6013ca0a60873dbcf164c7b [4/7] powerpc/build: move .data.rel.ro, .sdata2 to read-only https://git.kernel.org/powerpc/c/b6adc6d6d327229d75607a948cde2349d317f366 [5/7] powerpc/64/build: only include .opd with ELFv1 https://git.kernel.org/powerpc/c/c787fed11890babda1e4882cd3b6efaf412e1bde [6/7] powerpc/64/build: merge .got and .toc input sections https://git.kernel.org/powerpc/c/1e9eca485a840985a663080eb049c420272d4bdd [7/7] powerpc/build: put sys_call_table in .data.rel.ro if RELOCATABLE https://git.kernel.org/powerpc/c/fdfdcfd504933ed06eb6b4c9df21eede0e213c3e
cheers