From: Julian Seward Date: Fri, 18 Nov 2005 23:50:43 +0000 (+0000) Subject: Hmm. Perhaps all those top-level pieces of assembly weren't such a X-Git-Tag: svn/VALGRIND_3_1_0~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=418aae5c97ddbf86f4673dd16fd2ba8ad55890e9;p=thirdparty%2Fvalgrind.git 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 --- diff --git a/coregrind/m_main.c b/coregrind/m_main.c index 94345ec6a6..71bd0e2e24 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -2785,6 +2785,7 @@ void* memset(void *s, int c, size_t n) { 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 @@ asm("\n" ); #elif defined(VGP_amd64_linux) asm("\n" + ".text\n" "\t.globl _start\n" "\t.type _start,@function\n" "_start:\n" @@ -2819,6 +2821,7 @@ asm("\n" ); #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 438262dde7..272887f6a5 100644 --- a/coregrind/m_signals.c +++ b/coregrind/m_signals.c @@ -397,16 +397,19 @@ extern void my_sigreturn(void); #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 58b031229e..084604c997 100644 --- a/coregrind/m_syscall.c +++ b/coregrind/m_syscall.c @@ -111,6 +111,7 @@ extern UWord do_syscall_WRK ( UWord a4, UWord a5, UWord a6 ); asm( +".text\n" "do_syscall_WRK:\n" " push %esi\n" " push %edi\n" @@ -149,6 +150,7 @@ extern UWord do_syscall_WRK ( UWord a4, UWord a5, UWord a6 ); asm( +".text\n" "do_syscall_WRK:\n" /* Convert function calling convention --> syscall calling convention */ @@ -179,6 +181,7 @@ extern ULong do_syscall_WRK ( 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 42fccbd323..dd64dedfb4 100644 --- a/coregrind/m_syswrap/syswrap-amd64-linux.c +++ b/coregrind/m_syswrap/syswrap-amd64-linux.c @@ -70,6 +70,7 @@ void ML_(call_on_new_stack_0_1) ( Addr stack, // %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 do_syscall_clone_amd64_linux ( Word (*fn)(void *), 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 d95836abb4..a6160f088f 100644 --- a/coregrind/m_syswrap/syswrap-ppc32-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c @@ -70,6 +70,7 @@ void ML_(call_on_new_stack_0_1) ( Addr stack, // 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 @@ ULong do_syscall_clone_ppc32_linux ( Word (*fn)(void *), 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 d9b0583944..d65ece209e 100644 --- a/coregrind/m_syswrap/syswrap-x86-linux.c +++ b/coregrind/m_syswrap/syswrap-x86-linux.c @@ -78,6 +78,7 @@ void ML_(call_on_new_stack_0_1) ( Addr stack, // 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 do_syscall_clone_x86_linux ( Word (*fn)(void *), Int* parent_tid, vki_modify_ldt_t * ); asm( -"\n" +".text\n" "do_syscall_clone_x86_linux:\n" " push %ebx\n" " push %edi\n"