From owner-freebsd-hackers@FreeBSD.ORG Fri May 3 20:10:35 2013 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E7B1F26D for ; Fri, 3 May 2013 20:10:35 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id BC6131156 for ; Fri, 3 May 2013 20:10:35 +0000 (UTC) Received: from eagle.yuri.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id r43KAT5j044283 for ; Fri, 3 May 2013 13:10:29 -0700 (PDT) (envelope-from yuri@rawbw.com) Message-ID: <518419B5.4000602@rawbw.com> Date: Fri, 03 May 2013 13:10:29 -0700 From: Yuri User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130327 Thunderbird/17.0.4 MIME-Version: 1.0 To: FreeBSD Hackers Subject: What is the correct way to declare assembler global variable ? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 20:10:36 -0000 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