Symbol Aliasing
Erik Christiansen
erik@dd.nec.com.au
Tue Nov 25 00:28:00 GMT 2003
On Mon, Nov 24, 2003 at 07:27:32PM +0530, Raghunath L- CTD, Chennai. wrote:
> Symbol1:
> .long 4 ;Creates a symbol
>
> I want to create an alias 'Symbol2' for the original symbol 'Symbol1' .
> With this I want to refer the memory location '0x4'
> either with the name 'Symbol1' or with the name 'Symbol2'.
For the restricted case of aliasing a code or data address, you can use:
Symbol2:
Symbol1:
.long 4
Both symbols can be used, and both appear in the map file (if declared
global), but only the first appears in an objdump of the elf file. (So
don't be alarmed by this.)
Erik
More information about the Gcc-help
mailing list