[Bug debug/53453] darwin linker expects both AT_name and AT_comp_dir debug notes
howarth at nitro dot med.uc.edu
gcc-bugzilla@gcc.gnu.org
Tue May 22 23:32:00 GMT 2012
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.
More information about the Gcc-bugs
mailing list