Commit bea2dccc authored by Michael Ellerman's avatar Michael Ellerman

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: default avatarMichael Ellerman <mpe@ellerman.id.au>
Reviewed-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 6f698df1
...@@ -201,14 +201,12 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) ...@@ -201,14 +201,12 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
#ifdef PPC64_ELF_ABI_v2 #ifdef PPC64_ELF_ABI_v2
#define _GLOBAL(name) \ #define _GLOBAL(name) \
.section ".text"; \
.align 2 ; \ .align 2 ; \
.type name,@function; \ .type name,@function; \
.globl name; \ .globl name; \
name: name:
#define _GLOBAL_TOC(name) \ #define _GLOBAL_TOC(name) \
.section ".text"; \
.align 2 ; \ .align 2 ; \
.type name,@function; \ .type name,@function; \
.globl name; \ .globl name; \
...@@ -225,16 +223,15 @@ name: \ ...@@ -225,16 +223,15 @@ name: \
#define GLUE(a,b) XGLUE(a,b) #define GLUE(a,b) XGLUE(a,b)
#define _GLOBAL(name) \ #define _GLOBAL(name) \
.section ".text"; \
.align 2 ; \ .align 2 ; \
.globl name; \ .globl name; \
.globl GLUE(.,name); \ .globl GLUE(.,name); \
.section ".opd","aw"; \ .pushsection ".opd","aw"; \
name: \ name: \
.quad GLUE(.,name); \ .quad GLUE(.,name); \
.quad .TOC.@tocbase; \ .quad .TOC.@tocbase; \
.quad 0; \ .quad 0; \
.previous; \ .popsection; \
.type GLUE(.,name),@function; \ .type GLUE(.,name),@function; \
GLUE(.,name): GLUE(.,name):
...@@ -251,7 +248,6 @@ GLUE(.,name): ...@@ -251,7 +248,6 @@ GLUE(.,name):
n: n:
#define _GLOBAL(n) \ #define _GLOBAL(n) \
.text; \
.stabs __stringify(n:F-1),N_FUN,0,0,n;\ .stabs __stringify(n:F-1),N_FUN,0,0,n;\
.globl n; \ .globl n; \
n: n:
......
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