• 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: Finding the selector used in calls objc_msgSend in otool output...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding the selector used in calls objc_msgSend in otool output...


  • Subject: Re: Finding the selector used in calls objc_msgSend in otool output...
  • From: Bob Ippolito <email@hidden>
  • Date: Mon, 10 Jan 2005 17:52:27 -0500


On Jan 10, 2005, at 17:45, Shawn Erickson wrote:


On Jan 10, 2005, at 2:36 PM, Bob Ippolito wrote:

On Jan 10, 2005, at 17:18, Kevin Ballard wrote:

On Jan 10, 2005, at 5:08 PM, Shawn Erickson wrote:

Not sure that works for todays code... because of PIC / none-PIC, etc.

Still trying to connect the dots.

What's PIC / none-PIC?

He meant PIC / non-PIC. PIC means Position Independent Code, and it describes what the load/store opcodes are going to look like coming out of the compiler (the opcodes to load $r4 will look different in this case). Using -fast will turn off PIC unless explicitly turned on by -fPIC, otherwise -fPIC is on by default. PIC must be on for dylibs and bundles, but may be off for an executable.

Yeah, sorry for the typo.

The following is an example. The code generated by GCC 3.3 doesn't do it the same way that the "better" otool scripts expect from what I can see. Currently the offset isn't directly related to the load of r4 but happens before it. Luckily the PIC / non-PIC case doesn't affect things greatly. Also who knows how the optimizer would play around with things (the following is not optimized)... likely why otool doesn't list this information.

...
Using PIC...

-[PGAppDelegate changeState:]:
0000a85c mfspr r0,lr
0000a860 stmw r30,0xfff8(r1)
0000a864 or r31,r12,r12 << I guess target in terms of indirect addressing? what is this offset/pointer?
...

From <http://developer.apple.com/documentation/DeveloperTools/Conceptual/ MachORuntime/PowerPCConventions/chapter_3_section_5.html>:

GPR12
Set to the address of the branch target before an indirect call for dynamic code generation.
This register is not set for a routine that has been called directly, so routines that may be called directly should not depend on this register being set up correctly.
See “Indirect Addressing” for more information.


-bob

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Finding the selector used in calls objc_msgSend in otool output...
      • From: Shawn Erickson <email@hidden>
References: 
 >Finding the selector used in calls objc_msgSend in otool output... (From: Shawn Erickson <email@hidden>)
 >Re: Finding the selector used in calls objc_msgSend in otool output... (From: Kevin Ballard <email@hidden>)
 >Re: Finding the selector used in calls objc_msgSend in otool output... (From: Shawn Erickson <email@hidden>)
 >Re: Finding the selector used in calls objc_msgSend in otool output... (From: Kevin Ballard <email@hidden>)
 >Re: Finding the selector used in calls objc_msgSend in otool output... (From: Bob Ippolito <email@hidden>)
 >Re: Finding the selector used in calls objc_msgSend in otool output... (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: Finding the selector used in calls objc_msgSend in otool output...
  • Next by Date: Re: Authorization - Perl as helper tool vs. SUID
  • Previous by thread: Re: Finding the selector used in calls objc_msgSend in otool output...
  • Next by thread: Re: Finding the selector used in calls objc_msgSend in otool output...
  • Index(es):
    • Date
    • Thread