DW_MACRO_define_strx forms are supported now in llvm-dwarfdump and these forms can be used in both debug_macro[.dwo] sections. An added advantage for using strx forms over strp forms is that it uses indices approach instead of a relocation to debug_str section.
This patch unify the emission for debug_macro section.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I think having one form in both cases (split and non-split) simplifies the emission logic greatly. Otherwise we may have to carve out conditional emission that would be hard to maintain and extend.
Please share your opinion on this.
One more big win in non-DWO case is that switching to strx form will save a relocation per macro entry compared to the counter part strp form which uses relocation.
Sounds good to me - thanks!
One more big win in non-DWO case is that switching to strx form will save a relocation per macro entry compared to the counter part strp form which uses relocation.
Unfortunately I don't think it will provide this benefit - since the str_offsets section will require a relocation for the string anyway. (& though if a macro string is used more than once (probably relatively rare, but not unheard of - def/undef around .def files more than once in the same .cpp file, etc) then strx will at least allow that string to only need one relocation rather than one per use)
But I think the greater benefit of consistency is worthwhile in any case.