Skip to content

Commit

Permalink
Do not generate relocations within .debug_info for DW_AT_type
Browse files Browse the repository at this point in the history
  • Loading branch information
filipnavara committed Feb 17, 2024
1 parent 05c51fa commit 6c54c80
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Buffers;
using System.Buffers.Binary;
using System.Collections.Generic;
using System.Diagnostics;
using ILCompiler.DependencyAnalysis;
Expand Down Expand Up @@ -122,7 +123,7 @@ public void WriteInfoReference(uint typeIndex)
}
else
{
_infoSectionWriter.EmitSymbolReference(RelocType.IMAGE_REL_BASED_HIGHLOW, ".debug_info", offset);
WriteUInt32(offset);
}
}

Expand Down Expand Up @@ -195,17 +196,10 @@ public void Dispose()
// Debug.Assert(_dieStack.Count == 0);

// Flush late bound forward references
int streamOffset = (int)_infoSectionWriter.Position;
foreach (var lateBoundReference in _lateBoundReferences)
{
uint offset = _builder.ResolveOffset(lateBoundReference.TypeIndex);

_infoSectionWriter.EmitRelocation(
- streamOffset + lateBoundReference.Position,
lateBoundReference.Data,
RelocType.IMAGE_REL_BASED_HIGHLOW,
".debug_info",
(int)offset);
BinaryPrimitives.WriteUInt32LittleEndian(lateBoundReference.Data, offset);
}

// Write abbreviation section
Expand Down

0 comments on commit 6c54c80

Please sign in to comment.