[Dwarf-discuss] gfortran / gcc on Mac puts control characters in N_SO STABS

Jakub Jelinek jakub@redhat.com
Fri Mar 15 17:43:57 GMT 2024


On Fri, Mar 15, 2024 at 01:25:26PM -0400, John DelSignore wrote:
> FWIW, when TotalView reads the DWARF, there are no control characters in the strings.

GCC uses DW_FORM_strp (with the exception of too short strings where
DW_FORM_string is always beneficial) if it detects assembler which supports
mergeable sections or if a string is used more than once in the debug info
and user has not requested otherwise (-fno-merge-debug-strings).
I bet Darwin doesn't have ELF style SHF_MERGE | SHF_STRINGS support, and
looking on godbolt at clang --target=x86_64-darwin -S -gdwarf-4 output
I don't see that it would be trying to mark the __debug_str section
in some special way.
So, does Darwin linker merge the __debug_str strings anyway even when the section
isn't specially marked for it?
In any case, DW_FORM_string is a valid DWARF form...

	Jakub



More information about the Dwarf-discuss mailing list