mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
Use DW_AT_high_pc and DW_AT_low_pc for the high and low pc for a
compile unit. Make these relocations on the platforms that need relocations and add a routine to ensure that we don't put the addresses in an offset table for split dwarf. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199990 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -266,21 +266,32 @@ void DwarfUnit::addSectionOffset(DIE *Die, dwarf::Attribute Attribute,
|
||||
///
|
||||
void DwarfCompileUnit::addLabelAddress(DIE *Die, dwarf::Attribute Attribute,
|
||||
MCSymbol *Label) {
|
||||
if (!DD->useSplitDwarf())
|
||||
return addLocalLabelAddress(Die, Attribute, Label);
|
||||
|
||||
if (Label)
|
||||
DD->addArangeLabel(SymbolCU(this, Label));
|
||||
|
||||
if (!DD->useSplitDwarf()) {
|
||||
if (Label) {
|
||||
DIEValue *Value = new (DIEValueAllocator) DIELabel(Label);
|
||||
Die->addValue(Attribute, dwarf::DW_FORM_addr, Value);
|
||||
} else {
|
||||
DIEValue *Value = new (DIEValueAllocator) DIEInteger(0);
|
||||
Die->addValue(Attribute, dwarf::DW_FORM_addr, Value);
|
||||
}
|
||||
unsigned idx = DU->getAddrPoolIndex(Label);
|
||||
DIEValue *Value = new (DIEValueAllocator) DIEInteger(idx);
|
||||
Die->addValue(Attribute, dwarf::DW_FORM_GNU_addr_index, Value);
|
||||
}
|
||||
|
||||
/// addLocalLabelAddress - Add a dwarf label attribute data and value using
|
||||
/// DW_FORM_addr only.
|
||||
///
|
||||
void DwarfCompileUnit::addLocalLabelAddress(DIE *Die,
|
||||
dwarf::Attribute Attribute,
|
||||
MCSymbol *Label) {
|
||||
if (Label)
|
||||
DD->addArangeLabel(SymbolCU(this, Label));
|
||||
|
||||
if (Label) {
|
||||
DIEValue *Value = new (DIEValueAllocator) DIELabel(Label);
|
||||
Die->addValue(Attribute, dwarf::DW_FORM_addr, Value);
|
||||
} else {
|
||||
unsigned idx = DU->getAddrPoolIndex(Label);
|
||||
DIEValue *Value = new (DIEValueAllocator) DIEInteger(idx);
|
||||
Die->addValue(Attribute, dwarf::DW_FORM_GNU_addr_index, Value);
|
||||
DIEValue *Value = new (DIEValueAllocator) DIEInteger(0);
|
||||
Die->addValue(Attribute, dwarf::DW_FORM_addr, Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user