x86: fix usage of .section .sched.text in assembler code
PATCH 1/1 x86: fix usage of .section .sched.text in assembler code
Without this patch the linker will generate a section named .sched.text.1 which is unexpected.
This is because the gcc generated section has "ax" but the assembler usage of .sched.text lacks the "ax" specifier.
It would be better to have a definition we could use from assembler code but I did not find a suitable header file for it.
---
build tested on 64 bit only but seems obviously correct.
arch/x86/lib/semaphore_32.S | 2 +- arch/x86/lib/thunk_64.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/lib/semaphore_32.S +1 -1
@@ -29,7 +29,7 @@ * registers (%eax, %edx and %ecx) except %eax whish is either a return * value or just clobbered.. */ - .section .sched.text + .section .sched.text, "ax" ENTRY(__down_failed) CFI_STARTPROC FRAME
arch/x86/lib/thunk_64.S +1 -1
@@ -33,7 +33,7 @@ .endm - .section .sched.text + .section .sched.text, "ax" #ifdef CONFIG_RWSEM_XCHGADD_ALGORITHM thunk rwsem_down_read_failed_thunk,rwsem_down_read_failed thunk rwsem_down_write_failed_thunk,rwsem_down_write_failed
Signature · 1 line
1.5.4.rc3.14.g44397
Ingo Molnar
AppliedQuoted 4 lines · Sam Ravnborg
Without this patch the linker will generate a section named .sched.text.1 which is unexpected. This is because the gcc generated section has "ax" but the assembler usage of .sched.text lacks the "ax" specifier.
thanks, applied.
Quoted 2 lines
It would be better to have a definition we could use from assembler code but I did not find a suitable header file for it.
hm, include/asm-x86/linkage.h?
btw., i guess this in include/linux/linkage.h:
#ifndef __ALIGN
#define __ALIGN .align 4,0x90
#define __ALIGN_STR ".align 4,0x90"
#endif
is an x86-ism (0x90 is the x86 NOP instruction) that should move into include/asm-x86/linkge.h and the default filler should be 0x00 instead?
Ingo
Quoted 5 lines · Ingo Molnar
Quoted 3 lines
It would be better to have a definition we could use from assembler code but I did not find a suitable header file for it.
hm,
include/asm-x86/linkage.h?
No - it is for general use so it should live in include/linux/* Suggestion:
include/linux/linkage.h +9 -0
@@ -48,6 +48,15 @@END (name); \ .popsection +#define SCHED_ENTRY (name) \ + .pushsection .sched.text, "ax", %progbits; \ + ENTRY(name) + +#define SCHED_END (name) \ + END(name); \ + .popsection + +#ifndef END #define END (name) \ .size name, .-name
Note - the use of '%' is due to '@' is a comment identifier on arm and '%' seems to works across all arch's assemblers.
Quoted 10 lines
btw., i guess this in
include/linux/linkage.h:#ifndef
__ALIGN
#define__ALIGN.align 4,0x90
#define__ALIGN_STR".align 4,0x90"
#endifis an x86-ism (
0x90is the x86 NOP instruction) that should move intoinclude/asm-x86/linkge.hand the default filler should be0x00instead?
To specialized for my knowledge..
Sam