Dwarf Support - Early Bird Edition

Chris asked me to write up "LLVM Developer's Guide to Dwarf Support" for LLVM maintainers. We are still in early stages, but we thought we'd get it out there for the "need to bleeders." At some point this information will be formalized and added to the LLVM documentation.

The enclosed document gives specific instructions for adding source line number support to a target. This support is reasonably stable. The AsmPrinter/DwarfWriter infrastructure is pretty close to it's final form, so as new features are added, you should get them for free (we hope.)

For the adventurous, a very rough form of global variable support is present. This is not in it's final form. Just a proof of concept.

If you have any questions, post them back to this mailing list. Not that I don't like direct mail, but chances are that your issues are also someone else's.

Adding Dwarf Support To Targets.rtf (10.7 KB)


The LLVM Bytecode File Format specifies an optional SectionID attribute
for globals. I didn't find a matching attribute in the LLVM source code.
Code such as:

   int a __attribute__ ((section ("A_SECTION")));

compiles with llvm-gcc, but apparently the section information is
stripped (the object file doesn't contain "A_SECTION").

Is the SectionID feature implemented or just defined?


The old/traditional llvm-gcc C front-end doesn't honor section attributes. The new one does, but it is not "stable" on all targets. If you'd like to try it out, let me know and I can give you instructions for use.