diff --git a/llvm/test/tools/dsymutil/Inputs/private/tmp/baseaddr/loc1.o b/llvm/test/tools/dsymutil/Inputs/private/tmp/baseaddr/loc1.o new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@SwitchSection(MC->getObjectFileInfo()->getDwarfLocSection()); unsigned AddressSize = Unit.getOrigUnit().getAddressByteSize(); + uint64_t BaseAddressMarker = (AddressSize == 8) + ? std::numeric_limits::max() + : std::numeric_limits::max(); const DWARFSection &InputSec = Dwarf.getDWARFObj().getLocSection(); DataExtractor Data(InputSec.Data, Dwarf.isLittleEndian(), AddressSize); DWARFUnit &OrigUnit = Unit.getOrigUnit(); @@ -418,11 +421,20 @@ uint64_t Low = Data.getUnsigned(&Offset, AddressSize); uint64_t High = Data.getUnsigned(&Offset, AddressSize); LocSectionSize += 2 * AddressSize; + // End of list entry. if (Low == 0 && High == 0) { Asm->OutStreamer->EmitIntValue(0, AddressSize); Asm->OutStreamer->EmitIntValue(0, AddressSize); break; } + // Base address selection entry. + if (Low == BaseAddressMarker) { + Asm->OutStreamer->EmitIntValue(BaseAddressMarker, AddressSize); + Asm->OutStreamer->EmitIntValue(High + Attr.second, AddressSize); + LocPcOffset = 0; + continue; + } + // Location list entry. Asm->OutStreamer->EmitIntValue(Low + LocPcOffset, AddressSize); Asm->OutStreamer->EmitIntValue(High + LocPcOffset, AddressSize); uint64_t Length = Data.getU16(&Offset);