<div dir="ltr">Hello Everyone,<div><br></div><div>Consider this asm snippet for a moment --</div><div><br></div><div>section .debug_info.dwo</div><div>...</div><div>.long   .Ldebug_macinfo0        # DW_AT_macros<br></div><div>...</div><div><br></div><div>.section        .debug_macinfo.dwo,"e",@progbits<br></div><div> .Ldebug_macinfo0:<br>     .byte   0x1     # Define macro<br></div><div>....</div><div>When compiling this with clang, produces</div><div>fatal error: error in backend: A dwo section may not contain relocations -- seems fair,</div><div>Since we don't want relocations in DWO file. Please note here GCC{trunk}  has no problem with this /Okay with relocations in DWO/ Why??<br></div><div><br></div><div>Now the real problem -- Since DW_AT_macros/macinfo can appear in both split/non-split case.{Only in one or another}. Pointing to macro/macro.dwo section.</div><div>Now clang won't allow me to use above approach. So only option left to avoid relocations, emitting DW_AT_macros attribute as a difference of labels.</div><div>i.e</div><div>.long   .Lcu_macro_begin1-.debug_macro.dwo       # DW_AT_macro_info</div><div><br></div><div>This worked great, clang is fine, GDB also happy. But that was manual assembly hack I opted. I didn't find any API in /MCStreamer/ that can provide me a difference of 2 labels as label.</div><div>This is needed here --</div><div>TheCU.addSectionLabel(TheCU.getUnitDie(),dwarf::DW_AT_macros,<br>              /*Label here?*/, TLOF.getDwarfMacroDWOSection()->getBeginSymbol()); -- requires a label to add in.<br></div><div>Theirs analogous EmitLabelDifference(Sym, Sym, Size) API -- but that's for emitting + return type is void, So can't plug it in in here.</div><div><br></div><div>Any hints, how to overcome this ?</div><div><br></div><div>Thanks in anticipation!<br>Sourabh.</div><div><br></div></div>