<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In function relocateone() in lld/ELF/Arch/XXX.cpp, I need to compute the difference between the PC and the 'Val' function argument so that I can increment the PC by that difference. Is there a relationship between the PC and 'Loc'? Thanks.<br>
</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Tim Northover <t.p.northover@gmail.com><br>
<b>Sent:</b> Wednesday, March 13, 2019 8:49 AM<br>
<b>To:</b> Josh Sharp<br>
<b>Cc:</b> via llvm-dev<br>
<b>Subject:</b> Re: [llvm-dev] Need help implementing relocations</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">On Wed, 13 Mar 2019 at 15:14, Josh Sharp <mm92126@hotmail.com> wrote:<br>
> "it tells the linker to insert the address of<br>
> date when converting this .o file into a final executable."<br>
><br>
> Which utility do you use to convert .o to .elf and insert the address of 'date'? llvm-objcopy?<br>
<br>
The linker in the LLVM project is called "lld". It's pretty good for<br>
ELF, but you'll have to implement the parts for your target<br>
(specifically exactly how R_XXX_MOVI does its job in this case).<br>
Alternatively, if your platform already has GCC support you can use ld<br>
from GNU binutils, but you'll probably have to cross-compile it<br>
yourself.<br>
<br>
Cheers.<br>
<br>
Tim.<br>
</div>
</span></font></div>
</body>
</html>