Skip to content

Commit

Permalink
powerpc/32/build: move got1/got2 sections out of text
Browse files Browse the repository at this point in the history
Following the example from the binutils default linker script, move
.got1 and .got2 out of .text, to just after RO_DATA.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220916040755.2398112-3-npiggin@gmail.com
  • Loading branch information
Nicholas Piggin authored and Michael Ellerman committed Sep 26, 2022
1 parent 7082f8e commit 1faa123
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions arch/powerpc/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,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);
Expand All @@ -143,7 +135,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)

Expand Down Expand Up @@ -194,7 +195,7 @@ SECTIONS
*(__rfi_flush_fixup)
__stop___rfi_flush_fixup = .;
}
#endif /* CONFIG_PPC64 */
#endif /* CONFIG_PPC32 */

#ifdef CONFIG_PPC_BARRIER_NOSPEC
. = ALIGN(8);
Expand Down

0 comments on commit 1faa123

Please sign in to comment.