<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 10/12/2018 4:32 PM, Hassan ELMADI
via llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:SN6PR10MB2493B31237352AA9F38AAA82C1E20@SN6PR10MB2493.namprd10.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
<div style="font-family: Calibri, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
Hi,</div>
<div style="font-family: Calibri, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
In the include/llvm/Support/ELFRelocs directory, there is a
bunch of .def files defining enums that are to be included in
ELF.h. For example, in ARM.def, there is this record:</div>
<div style="font-family: Calibri, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: "Courier New", monospace;"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: "Courier New", monospace;">ELF_RELOC(R_ARM_PC24,
0x01)</span><br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
What does '<span style="font-family: "Courier New",
monospace;">R_ARM_PC24</span>' mean and where does the value
0x01 come from?</div>
</blockquote>
<br>
See <a class="moz-txt-link-freetext" href="http://refspecs.linuxbase.org/elf/gabi4+/ch4.reloc.html">http://refspecs.linuxbase.org/elf/gabi4+/ch4.reloc.html</a> for a
general description of ELF relocations. The names, values, and
meanings are all CPU-specific because it depends on the instruction
encoding. For commonly used CPUs, there are standard ELF
relocations, so different compilers and linkers for a given CPU are
compatible. For example, the ARM ELF relocations are defined in
<a class="moz-txt-link-freetext" href="http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044f/IHI0044F_aaelf.pdf">http://infocenter.arm.com/help/topic/com.arm.doc.ihi0044f/IHI0044F_aaelf.pdf</a>
.<br>
<br>
If you're defining your own CPU architecture, it doesn't really
matter what the names or values are, as long as the compiler and
linker agree what they mean.<br>
<br>
-Eli<br>
<pre class="moz-signature" cols="72">--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
</body>
</html>