Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8691599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:09:06+00:00 2026-06-13T00:09:06+00:00

Where/how does Apples GCC store DWARF inside an executable? I compiled a binary via

  • 0

Where/how does Apples GCC store DWARF inside an executable?

I compiled a binary via gcc -gdwarf-2 (Apples GCC). However, neither objdump -g nor objdump -h does show me any debug information.

Also libbfd does not find any debug information. (I asked on the binutils-mailinglist about it here.)

I am able however to extract the debugging information via dsymutil (into a dSYM). libbfd is also able to read those debug info then.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:09:06+00:00Added an answer on June 13, 2026 at 12:09 am

    On Mac OS X there was a decision to have the linker ld not process all of the debug information when you link your program. The debug information is often 10xthe size of the program executable so having the linker process all of the debug info and include it in the executable binary was a serious detriment to link times. For iterative development – compile, link, compile, link, debug, compile link – this was a real hit.

    Instead:

    • The compiler generates the DWARF debug information in the .s files, the assembler outputs it in the .o files
    • The linker includes a "debug map" in the executable binary which tells debug info users where all of the symbols were relocated during the link.

    A consumer (doing .o-file debugging) loads the debug map from the executable and processes all of the DWARF in the .o files as-needed, remapping the symbols as per the debug map’s instructions.

    dsymutil can be thought of as a debug info linker. It does this same process — read the debug map, load the DWARF from the .o files, relocate all the addresses — and then outputs a single binary of all the DWARF at their final, linked addresses. This is the dSYM bundle.

    Once you have a dSYM bundle, you’ve got plain old standard DWARF that any dwarf reading tool (which can deal with Mach-O binary files) can process.

    There is an additional refinement that makes all of this work, the UUIDs included in Mach-O binaries. Every time the linker creates a binary, it emits a 128-bit UUID in the LC_UUID load command (v. otool -hlv or dwarfdump --uuid). This uniquely identifies that binary file. When dsymutil creates the dSYM, it includes that UUID. The debuggers will only associate a dSYM and an executable if they have matching UUIDs — no dodgy file mod timestamps or anything like that.

    We can also use the UUIDs to locate the dSYMs for binaries. They show up in crash reports, we include a Spotlight importer that you can use to search for them, e.g.
    mdfind "com_apple_xcode_dsym_uuids == E21A4165-29D5-35DC-D08D-368476F85EE1"
    if the dSYM is located in a Spotlight indexed location. You can even have a repository of dSYMs for your company and a program that can retrieve the correct dSYM given a UUID – maybe a little mysql database or something like that – so you run the debugger on a random executable and you instantly have all the debug info for that executable. There are some pretty neat things you can do with the UUIDs.

    But anyway, to answer your original question: The unstripped binary has the debug map, the .o files have the DWARF, and when dsymutil is ran these are combined to create the dSYM bundle.

    If you want to see the debug map entries, do nm -pa executable and they’re all there. They are in the form of the old stabs nlist records – the linker already knew how to process stabs so it was easiest to use them – but you’ll see how it works without much trouble, maybe refer to some stabs documentation if you’re uncertain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just wondering how does apple approve the iPhone app that communicates via
Does clang++ do threadsafe initialisation of local static variables? GCC does, unless you turn
Why does this code fail to display the category name Apples using the current
Does Apple push use TCP or UDP to deliver messages from their servers to
How does apple feel about blocking tabs from being clickable until for example when
I want to know that does apple's Push Notification Server generate new device token
For example, does Apple provide NSString * const kCFBundleDisplayName somewhere? Or do I have
Does anyone know of a simple HTML5/CSS3 framework which applies a minimum of formatting
Does anyone have any experience with this sort of thing? I'm talking about applets
I have this method which does certain checks and applies a color code on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.