Skip to content

Commit 1faa123

Browse files
npigginmpe
authored andcommitted
powerpc/32/build: move got1/got2 sections out of text
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 <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7082f8e commit 1faa123

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

arch/powerpc/kernel/vmlinux.lds.S

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,6 @@ SECTIONS
126126
*(.sfpr);
127127
MEM_KEEP(init.text)
128128
MEM_KEEP(exit.text)
129-
130-
#ifdef CONFIG_PPC32
131-
*(.got1)
132-
__got2_start = .;
133-
*(.got2)
134-
__got2_end = .;
135-
#endif /* CONFIG_PPC32 */
136-
137129
} :text
138130

139131
. = ALIGN(PAGE_SIZE);
@@ -143,7 +135,16 @@ SECTIONS
143135
/* Read-only data */
144136
RO_DATA(PAGE_SIZE)
145137

146-
#ifdef CONFIG_PPC64
138+
#ifdef CONFIG_PPC32
139+
.got1 : AT(ADDR(.got1) - LOAD_OFFSET) {
140+
*(.got1)
141+
}
142+
.got2 : AT(ADDR(.got2) - LOAD_OFFSET) {
143+
__got2_start = .;
144+
*(.got2)
145+
__got2_end = .;
146+
}
147+
#else /* CONFIG_PPC32 */
147148
SOFT_MASK_TABLE(8)
148149
RESTART_TABLE(8)
149150

@@ -194,7 +195,7 @@ SECTIONS
194195
*(__rfi_flush_fixup)
195196
__stop___rfi_flush_fixup = .;
196197
}
197-
#endif /* CONFIG_PPC64 */
198+
#endif /* CONFIG_PPC32 */
198199

199200
#ifdef CONFIG_PPC_BARRIER_NOSPEC
200201
. = ALIGN(8);

0 commit comments

Comments
 (0)