From: Alexey Lapshin Date: Wed, 17 May 2023 08:27:56 +0000 (+0200) Subject: Fix test bot breakage from bd0dd27bb5be0fbf60c1b2a4ce15188812388574 X-Git-Tag: upstream/17.0.6~8189 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ddf5bfd6e6e2fc5b94718a29e718b4f821a3b853;p=platform%2Fupstream%2Fllvm.git Fix test bot breakage from bd0dd27bb5be0fbf60c1b2a4ce15188812388574 This addresses the issue found by: https://lab.llvm.org/buildbot/#/builders/93/builds/14929 --- diff --git a/llvm/include/llvm/DWARFLinker/DWARFLinker.h b/llvm/include/llvm/DWARFLinker/DWARFLinker.h index d94e31d5..8090bfd 100644 --- a/llvm/include/llvm/DWARFLinker/DWARFLinker.h +++ b/llvm/include/llvm/DWARFLinker/DWARFLinker.h @@ -713,7 +713,7 @@ private: void cloneExpression(DataExtractor &Data, DWARFExpression Expression, const DWARFFile &File, CompileUnit &Unit, SmallVectorImpl &OutputBuffer, - int64_t AddrRelocAdjustment); + int64_t AddrRelocAdjustment, bool IsLittleEndian); /// Clone an attribute referencing another DIE and add /// it to \p Die. diff --git a/llvm/lib/DWARFLinker/DWARFLinker.cpp b/llvm/lib/DWARFLinker/DWARFLinker.cpp index 93c03a1..b87fb98 100644 --- a/llvm/lib/DWARFLinker/DWARFLinker.cpp +++ b/llvm/lib/DWARFLinker/DWARFLinker.cpp @@ -1142,7 +1142,7 @@ unsigned DWARFLinker::DIECloner::cloneDieReferenceAttribute( void DWARFLinker::DIECloner::cloneExpression( DataExtractor &Data, DWARFExpression Expression, const DWARFFile &File, CompileUnit &Unit, SmallVectorImpl &OutputBuffer, - int64_t AddrRelocAdjustment) { + int64_t AddrRelocAdjustment, bool IsLittleEndian) { using Encoding = DWARFExpression::Operation::Encoding; uint8_t OrigAddressByteSize = Unit.getOrigUnit().getAddressByteSize(); @@ -1208,6 +1208,8 @@ void DWARFLinker::DIECloner::cloneExpression( // processed by applyValidRelocs. OutputBuffer.push_back(dwarf::DW_OP_addr); uint64_t LinkedAddress = SA->Address + AddrRelocAdjustment; + if (!IsLittleEndian) + sys::swapByteOrder(LinkedAddress); ArrayRef AddressBytes( reinterpret_cast(&LinkedAddress), OrigAddressByteSize); @@ -1240,6 +1242,8 @@ void DWARFLinker::DIECloner::cloneExpression( if (OutOperandKind) { OutputBuffer.push_back(*OutOperandKind); uint64_t LinkedAddress = SA->Address + AddrRelocAdjustment; + if (!IsLittleEndian) + sys::swapByteOrder(LinkedAddress); ArrayRef AddressBytes( reinterpret_cast(&LinkedAddress), OrigAddressByteSize); @@ -1294,7 +1298,7 @@ unsigned DWARFLinker::DIECloner::cloneBlockAttribute( DWARFExpression Expr(Data, OrigUnit.getAddressByteSize(), OrigUnit.getFormParams().Format); cloneExpression(Data, Expr, File, Unit, Buffer, - Unit.getInfo(InputDIE).AddrAdjust); + Unit.getInfo(InputDIE).AddrAdjust, IsLittleEndian); Bytes = Buffer; } for (auto Byte : Bytes) @@ -2553,7 +2557,8 @@ uint64_t DWARFLinker::DIECloner::cloneAllCompileUnits( cloneExpression(Data, DWARFExpression(Data, OrigUnit.getAddressByteSize(), OrigUnit.getFormParams().Format), - File, *CurrentUnit, OutBytes, RelocAdjustment); + File, *CurrentUnit, OutBytes, RelocAdjustment, + IsLittleEndian); }; Linker.generateUnitLocations(*CurrentUnit, File, ProcessExpr); }