@@ -319,22 +319,18 @@ void DwarfUnit::addPoolOpAddress(DIEValueList &Die, const MCSymbol *Label) {
319
319
const MCSymbol *Base = nullptr ;
320
320
if (Label->isInSection () && DD->useAddrOffsetExpressions ())
321
321
Base = DD->getSectionLabel (&Label->getSection ());
322
- if (!Base) {
323
- uint32_t Index = DD->getAddressPool ().getIndex (Label);
324
- if (DD->getDwarfVersion () >= 5 ) {
325
- addUInt (Die, dwarf::DW_FORM_data1, dwarf::DW_OP_addrx);
326
- addUInt (Die, dwarf::DW_FORM_addrx, Index);
327
- } else {
328
- addUInt (Die, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_addr_index);
329
- addUInt (Die, dwarf::DW_FORM_GNU_addr_index, Index);
330
- }
331
- return ;
322
+
323
+ uint32_t Index = DD->getAddressPool ().getIndex (Base ? Base : Label);
324
+
325
+ if (DD->getDwarfVersion () >= 5 ) {
326
+ addUInt (Die, dwarf::DW_FORM_data1, dwarf::DW_OP_addrx);
327
+ addUInt (Die, dwarf::DW_FORM_addrx, Index);
328
+ } else {
329
+ addUInt (Die, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_addr_index);
330
+ addUInt (Die, dwarf::DW_FORM_GNU_addr_index, Index);
332
331
}
333
332
334
- addUInt (Die, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_addr_index);
335
- addUInt (Die, dwarf::DW_FORM_GNU_addr_index,
336
- DD->getAddressPool ().getIndex (Base));
337
- if (Base != Label) {
333
+ if (Base && Base != Label) {
338
334
addUInt (Die, dwarf::DW_FORM_data1, dwarf::DW_OP_const4u);
339
335
addLabelDelta (Die, (dwarf::Attribute)0 , Label, Base);
340
336
addUInt (Die, dwarf::DW_FORM_data1, dwarf::DW_OP_plus);
0 commit comments