Skip to content

Commit bea2dcc

Browse files
committed
powerpc: Don't change the section in _GLOBAL()
Currently the _GLOBAL() macro unilaterally sets the assembler section to ".text" at the start of the macro. This is rude as the caller may be using a different section. So let the caller decide which section to emit the code into. On big endian we do need to switch to the ".opd" section to emit the OPD, but do that with pushsection/popsection, thereby leaving the original section intact. I verified that the order of all entries in System.map is unchanged after this patch. The actual addresses shift around slightly so you can't just diff the System.map. Signed-off-by: Michael Ellerman <[email protected]> Reviewed-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 6f698df commit bea2dcc

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

arch/powerpc/include/asm/ppc_asm.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,12 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
201201
#ifdef PPC64_ELF_ABI_v2
202202

203203
#define _GLOBAL(name) \
204-
.section ".text"; \
205204
.align 2 ; \
206205
.type name,@function; \
207206
.globl name; \
208207
name:
209208

210209
#define _GLOBAL_TOC(name) \
211-
.section ".text"; \
212210
.align 2 ; \
213211
.type name,@function; \
214212
.globl name; \
@@ -225,16 +223,15 @@ name: \
225223
#define GLUE(a,b) XGLUE(a,b)
226224

227225
#define _GLOBAL(name) \
228-
.section ".text"; \
229226
.align 2 ; \
230227
.globl name; \
231228
.globl GLUE(.,name); \
232-
.section ".opd","aw"; \
229+
.pushsection ".opd","aw"; \
233230
name: \
234231
.quad GLUE(.,name); \
235232
.quad .TOC.@tocbase; \
236233
.quad 0; \
237-
.previous; \
234+
.popsection; \
238235
.type GLUE(.,name),@function; \
239236
GLUE(.,name):
240237

@@ -251,7 +248,6 @@ GLUE(.,name):
251248
n:
252249

253250
#define _GLOBAL(n) \
254-
.text; \
255251
.stabs __stringify(n:F-1),N_FUN,0,0,n;\
256252
.globl n; \
257253
n:

0 commit comments

Comments
 (0)