Re: What's the C protype for the variables defined in a linker script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PRC wrote:

> What is the protype for the symbol `_ftext', if I want to refer to it in the C program?
> Is it `extern unsigned char _ftext[];' ?

I think you mean declaration, not prototype.  The manual covers this:
<http://sourceware.org/binutils/docs-2.18/ld/Source-Code-Reference.html>. 
In short, you can only ever refer to the variable's address, never its
value since it has no value.  Whatever type you declare will determine
how the compiler does indexing/addressing, but that's completely
arbitrary since the linker script is simply assigning an address to a
symbol, it's not allocating anything.  Whatever data happens to lie at
that memory location will be accessed by whatever size type you declare
the variable.

Brian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux