public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "howarth at nitro dot med.uc.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/53453] darwin linker expects both AT_name and AT_comp_dir debug notes
Date: Tue, 22 May 2012 23:32:00 -0000	[thread overview]
Message-ID: <bug-53453-4-Oiu9RONEVI@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53453-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53453

--- Comment #4 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-05-22 23:10:03 UTC ---
(In reply to comment #3)
> There is no point to emit DW_AT_comp_dir if all filenames in the file/directory
> table referenced by DW_AT_stmt_list are absolute.  Seems to be a request to
> work around broken vendor tools again.

Below is the explanation from the darwin linker developer on the current
requirement of the DW_AT_comp_dir for each object file...

If you run:
   nm -ap
on the final executable, you'll see the "debug  notes" which are stabs:

[/tmp/xcode44_bugv2/good_binary]> nm -map 20010124-1.x4

0000000000000000 - 00 0000    SO /Users/howarth/xcode44_bug/good_binary/
0000000000000000 - 00 0000    SO 20010124-1.c
000000004fb8299f - 03 0001   OSO
/private/tmp/xcode44_bugv2/good_binary/20010124-1.o

For some historical reason, stabs like to have two SO entries, one for the dir
and one for the leaf file.  That happened to line up exactly with how dwarf
compilation info was emitted.  So the linker just transformed the AT_name into
one SO and the AT_comp_dir into the other, but only if both attributes existed.

Now gcc has changed the dwarf emitted and the fallback for the linker is to not
emit any debug notes for that object file.

Yes, we could enhance a future linker to be more robust and if there is not
AT_comp_dir to split up the AT_name in to it directory and name.  But existing
darwin linkers will create binaries without debug information.


  parent reply	other threads:[~2012-05-22 23:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-22 13:27 [Bug debug/53453] New: " howarth at nitro dot med.uc.edu
2012-05-22 14:30 ` [Bug debug/53453] " howarth at nitro dot med.uc.edu
2012-05-22 14:40 ` howarth at nitro dot med.uc.edu
2012-05-22 14:41 ` jakub at gcc dot gnu.org
2012-05-22 23:32 ` howarth at nitro dot med.uc.edu [this message]
2012-05-22 23:55 ` jakub at gcc dot gnu.org
2012-05-24 13:54 ` howarth at nitro dot med.uc.edu
2012-05-24 19:41 ` howarth at nitro dot med.uc.edu
2012-05-24 19:55 ` howarth at nitro dot med.uc.edu
2012-05-24 20:20 ` jakub at gcc dot gnu.org
2012-05-24 23:27 ` howarth at nitro dot med.uc.edu
2012-05-25  5:54 ` howarth at nitro dot med.uc.edu
2012-05-25  6:04 ` mrs at gcc dot gnu.org
2012-05-25 13:03 ` howarth at nitro dot med.uc.edu
2012-05-25 13:41 ` howarth at nitro dot med.uc.edu
2012-05-30  0:08 ` mrs at gcc dot gnu.org
2012-05-30  1:37 ` mrs at gcc dot gnu.org
2013-04-17  7:17 ` ebotcazou at gcc dot gnu.org
2013-04-17 15:55 ` mrs at gcc dot gnu.org
2013-04-17 16:21 ` mrs at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-53453-4-Oiu9RONEVI@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).