This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Address assignment


Thanks for taking my question. My intention is the earlier that is to
assign addresses to variables, like you have shown with my_struct. But
currently I see my assembly file  containing .comm directives for all
the global variables or .bss for static variable. So In this case is
there a directive that I can add to the assembly file which will
additionally specify the address of each variable. My addresses  are
generated insider the compiler, so I would like something which works
automatically -perhaps just additions to the assembler file or
modifications in the assembler.

thanks again
Shrey 

On 9/14/05, DJ Delorie <dj@redhat.com> wrote:
> 
> If what you mean is something like "I have this structure, but it exists
> at a specific address" you can easily do this in the assembler like this:
> 
>         .global _my_struct
> _my_struct = 0xa0001028
> 
> The linker doesn't care *what* a symbol is, just *where* it is.  The
> above gives it an absolute address (it shows up in the "*ABS*"
> section) but doesn't allocate any space for it (sorry, no overlap
> protection).
> 
> 
> If what you mean is "I want code in this block of flash, and data in
> this block of RAM" then you want to look up the MEMORY directive for
> link scripts in the linker manual ("info ld").  If you download the
> latest newlib from CVS and look at libgloss/m32c you'll see a number
> of examples of how to manage all that.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]