Hmm. Perhaps all those top-level pieces of assembly weren't such a
clever idea. There's no reason to assume the assembler is in
.text-mode when it encounters them, and as gcc 2.96 rudely
demonstrates, sometimes it isn't. So put .text in front of all of
them.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5202 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_main.c b/coregrind/m_main.c
index 94345ec..71bd0e2 100644
--- a/coregrind/m_main.c
+++ b/coregrind/m_main.c
@@ -2785,6 +2785,7 @@
the new stack. */
#if defined(VGP_x86_linux)
asm("\n"
+ ".text\n"
"\t.globl _start\n"
"\t.type _start,@function\n"
"_start:\n"
@@ -2803,6 +2804,7 @@
);
#elif defined(VGP_amd64_linux)
asm("\n"
+ ".text\n"
"\t.globl _start\n"
"\t.type _start,@function\n"
"_start:\n"
@@ -2819,6 +2821,7 @@
);
#elif defined(VGP_ppc32_linux)
asm("\n"
+ ".text\n"
"\t.globl _start\n"
"\t.type _start,@function\n"
"_start:\n"
diff --git a/coregrind/m_signals.c b/coregrind/m_signals.c
index 438262d..272887f 100644
--- a/coregrind/m_signals.c
+++ b/coregrind/m_signals.c
@@ -397,16 +397,19 @@
#if defined(VGP_x86_linux)
# define _MYSIG(name) \
+ ".text\n" \
"my_sigreturn:\n" \
" movl $" #name ", %eax\n" \
" int $0x80\n"
#elif defined(VGP_amd64_linux)
# define _MYSIG(name) \
+ ".text\n" \
"my_sigreturn:\n" \
" movq $" #name ", %rax\n" \
" syscall\n"
#elif defined(VGP_ppc32_linux)
# define _MYSIG(name) \
+ ".text\n" \
"my_sigreturn:\n" \
" li 0, " #name "\n" \
" sc\n"
diff --git a/coregrind/m_syscall.c b/coregrind/m_syscall.c
index 58b0312..084604c 100644
--- a/coregrind/m_syscall.c
+++ b/coregrind/m_syscall.c
@@ -111,6 +111,7 @@
UWord a4, UWord a5, UWord a6
);
asm(
+".text\n"
"do_syscall_WRK:\n"
" push %esi\n"
" push %edi\n"
@@ -149,6 +150,7 @@
UWord a4, UWord a5, UWord a6
);
asm(
+".text\n"
"do_syscall_WRK:\n"
/* Convert function calling convention --> syscall calling
convention */
@@ -179,6 +181,7 @@
UWord a4, UWord a5, UWord a6
);
asm(
+".text\n"
"do_syscall_WRK:\n"
" mr 0,3\n"
" mr 3,4\n"
diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
index 42fccbd..dd64ded 100644
--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
@@ -70,6 +70,7 @@
// %rdx == f
// %rcx == arg1
asm(
+".text\n"
".globl vgModuleLocal_call_on_new_stack_0_1\n"
"vgModuleLocal_call_on_new_stack_0_1:\n"
" movq %rdi, %rsp\n" // set stack
@@ -134,7 +135,7 @@
Long* parent_tid,
vki_modify_ldt_t * );
asm(
-"\n"
+".text\n"
"do_syscall_clone_amd64_linux:\n"
// set up child stack, temporarily preserving fn and arg
" subq $16, %rsi\n" // make space on stack
diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c
index d95836a..a6160f0 100644
--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c
@@ -70,6 +70,7 @@
// r5 = f
// r6 = arg1
asm(
+".text\n"
".globl vgModuleLocal_call_on_new_stack_0_1\n"
"vgModuleLocal_call_on_new_stack_0_1:\n"
" mr %r1,%r3\n\t" // stack to %sp
@@ -151,7 +152,7 @@
Int* parent_tid,
vki_modify_ldt_t * );
asm(
-"\n"
+".text\n"
"do_syscall_clone_ppc32_linux:\n"
" stwu 1,-32(1)\n"
" stw 29,20(1)\n"
diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
index d9b0583..d65ece2 100644
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
@@ -78,6 +78,7 @@
// 12(%esp) == f
// 16(%esp) == arg1
asm(
+".text\n"
".globl vgModuleLocal_call_on_new_stack_0_1\n"
"vgModuleLocal_call_on_new_stack_0_1:\n"
" movl %esp, %esi\n" // remember old stack pointer
@@ -136,7 +137,7 @@
Int* parent_tid,
vki_modify_ldt_t * );
asm(
-"\n"
+".text\n"
"do_syscall_clone_x86_linux:\n"
" push %ebx\n"
" push %edi\n"