Loading an address, as a symbol, into a general register
<p>I have some RISC V assembly in a <code>crt.S</code> file.</p>

<p>If I use the name of the C function <code>_init</code> like this:</p>

<pre><code>j _init
</code></pre>

<p>(i.e. execute an unconditional jump to <code>_init</code>), the code compiles fine and runs.</p>

<p>But if I use it like this:</p>

<pre><code>li a3, _init
</code></pre>

<p>(ie, load general register <code>A3</code> with the integer value <code>_init</code>) the code will not compile. If I substitute a literal integer value (e.g., <code>0x80001958</code>, which all other things being equal, is value of <code>_init</code> currently) the code compiles.</p>

<p>What am I doing wrong here? (This is using GNU GCC/AS)</p>