How to access variable define in linker script in c?
<p>In the linker script, I defined <code>PROVIDE(__KERNEL_BEGIN__ = .);</code>.</p>

<p>The address can be accessed from:</p>

<pre><code>extern uint32_t __KERNEL_BEGIN__[];
</code></pre>

<p>But, the following does not work (gives an incorrect address):</p>

<pre><code>extern uint32_t * __KERNEL_BEGIN__;
</code></pre>

<p>I looked at the assembly. The first method, <code>__KERNEL_BEGIN__</code>, provides the exact address. The second one, <code>__KERNEL_BEGIN__ = [address]</code>, looks up a value at the address.</p>

<p>So, must it be this way? I cannot tell the difference.</p>