Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 May 2013 13:10:29 -0700
From:      Yuri <yuri@rawbw.com>
To:        FreeBSD Hackers <hackers@freebsd.org>
Subject:   What is the correct way to declare assembler global variable ?
Message-ID:  <518419B5.4000602@rawbw.com>

next in thread | raw e-mail | index | archive | help
I am trying to compile this code fragment into my program (taken from 
lib/libc/amd64/sys/sbrk.S):
void my_func() {
  ...
   __asm__ __volatile__(
       "movq .curbrk(%%rip), %%rax;"
       "lea  .curbrk(%%rip), %%rdx;"
       "movq %%rax, %0;"
       "movq %%rdx, %1;"
       : "=r" (my_curbrk),
         "=r" (my_curbrk_ptr)
       :: "%rax", "%rdx");
   ...
}

I get a warning:
/usr/bin/ld: warning: type and size of dynamic symbol 
`.curbrk@@FBSDprivate_1.0' are not defined

What is the correct way to declare .curbrk in in-place assembly?

Yuri



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?518419B5.4000602>