• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: x86-64 asm question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: x86-64 asm question


  • Subject: Re: x86-64 asm question
  • From: Cyrus Harmon <email@hidden>
  • Date: Mon, 4 Sep 2006 17:06:17 -0700


The linux version of gas (with .global, not just .globl) seems to handle this code fine. Is it implicitly doing some sort of IP- relative indexing? Is there something weird about Apple's assembler going on here? I'm willing to believe that I need to do some %rip relative addressing, I'm just not convinced that the way I'm trying to do it is giving me the right results (or, really, what those should look like).


I tried something similar before, and got it to compile, but wasn't sure if that was the right approach. Some docs on 1) if this needs to be done realtive to %rip, and 2) how to properly do so, would be great.

Thank,

Cyrus

On Sep 4, 2006, at 4:56 PM, Scott Lamb wrote:

On Sep 4, 2006, at 3:57 PM, Cyrus Harmon wrote:
So, using gas I'm trying to port some x86 assembly code that refers to an external symbol:

 .text
 .globl _all_threads
...
...
 mov _all_threads,%rax
...

the error  message I get is:

x86-64-assem.S:133:32-bit absolute addressing is not supported for x86-64

That works on x86 (well, with �x, of course), but I can't seem to figure out how to do this on x86-64, or any relevant docs on Apple's x86-64 assembler.

IIRC, x86_64 uses IP-relative addresses. And in a x64_64-linux project of mine, I found this line:


    movl    sigsafe_key_(%rip), �i

--
Scott Lamb <http://www.slamb.org/>



_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: x86-64 asm question
      • From: Eric Albert <email@hidden>
References: 
 >x86-64 asm question (From: Cyrus Harmon <email@hidden>)
 >Re: x86-64 asm question (From: Scott Lamb <email@hidden>)

  • Prev by Date: Re: x86-64 asm question
  • Next by Date: Resolving EXC_BAD_INSTRUCTION (Where do I begin?)
  • Previous by thread: Re: x86-64 asm question
  • Next by thread: Re: x86-64 asm question
  • Index(es):
    • Date
    • Thread