<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>><span style="color: rgb(33, 33, 33); font-size: 12pt;">Seems we have a few choices:</span></p>
<div style="color: rgb(33, 33, 33);">
<div>
<div dir="ltr">><br>
>Say that getSectionLoadAddress should return 0 for all debug info sections<br>
>Change libDebugInfo/DWARF to not query getSectionLoadAddress for debug info sections (so they're effectively zero)<br>
>Change DWARFDebugAbbrev::extract to take into account the base address of the section when parsing/building the table.<br>
><br>
>I suspect 1 or 2 is better, and probably 2. But that's also a bit inconvenient having to do more special case logic about how we >apply/create relocations - an already pretty complicated part of the DWARF parsing code, I think.<br>
><br>
>(+ Lang, Keno, and Eric - involved in adding this getSectionLoadAddress support in the first place. I'm guessing for the JIT use >case it wouldn't have ever had a load address for a debug info section - just for the code sections?)<br>
<br>
And we also have one more choice - extend collectAddressRange API to return section id. That was initial reason why I had to use<br>
</div>
<div dir="ltr">current way in LLD.<br>
</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">But actually that probably be overcomplication and I believe we can fix it in something like (1) you mentioned on LLD side.<br>
</div>
<div dir="ltr">The difference - I think since interface method is called getSectionLoadAddress, it is just reasonable to make<br>
</div>
<div dir="ltr">it return offset only for allocatable sections.<br>
</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">I prepared a patch: <a href="https://reviews.llvm.org/D28045">https://reviews.llvm.org/D28045</a>, that solves the problem we have here, what do you think ?<br>
</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">George.<br>
</div>
</div>
</div>
</body>
</html>