• 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: What is the meaning of "missing indirect symbols for section (__TEXT, __symbol_stub)"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the meaning of "missing indirect symbols for section (__TEXT, __symbol_stub)"?


  • Subject: Re: What is the meaning of "missing indirect symbols for section (__TEXT, __symbol_stub)"?
  • From: Eric Albert <email@hidden>
  • Date: Sat, 28 Oct 2006 23:01:08 -0700

On Oct 28, 2006, at 10:32 PM, John Reppy wrote:

I'm trying to help someone port a compiler (http://mlton.org) that generates
x86 assembly code, but we are having difficulty with calls to external C functions.
If we are calling a function _foo directly, we get a error from ld:


external relocation entries in non- writable section (__TEXT,__text) symbols:
_foo


but if we put in a stub as suggested by the "Mac OS X Assembler Reference"

	.symbol_stub
	L_foo_stub:
	.indirect_symbol _foo
		hlt ; hlt ; hlt ; hlt ; hlt

we get the following error from the assembler:

	missing indirect symbols for section (__TEXT,__symbol_stub)

Can someone explain what the root cause of this error message might be?

That Mac OS X Assembler Reference page is out of date. Please file a bug report at <http://bugreport.apple.com/>.


If you look at the assembly output for a simple C file (using gcc - S), you'll see that instead of .symbol_stub the compiler emits this:
.section __IMPORT,__jump_table,symbol_stubs,self_modifying_code +pure_instructions,5
Use that instead and your stub will work.


In other words, when in doubt with your own compiler, look at what a known working compiler does. :)

Hope this helps,
Eric

_______________________________________________
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: What is the meaning of "missing indirect symbols for section (__TEXT, __symbol_stub)"?
      • From: John Reppy <email@hidden>
References: 
 >What is the meaning of "missing indirect symbols for section (__TEXT, __symbol_stub)"? (From: John Reppy <email@hidden>)

  • Prev by Date: Re: Apple's Tools Strategy [was: Accessing function definitions Radar]
  • Next by Date: Re: Apple's Tools Strategy [was: Accessing function definitions Radar]
  • Previous by thread: What is the meaning of "missing indirect symbols for section (__TEXT, __symbol_stub)"?
  • Next by thread: Re: What is the meaning of "missing indirect symbols for section (__TEXT, __symbol_stub)"?
  • Index(es):
    • Date
    • Thread