0

If I write a code in my program.c as a global declaration :

#pragma DATA_SECTION (measurements, ".myvarloc");
uint8 measurements[30];

i write the below code and save it as a.ld:

MEMORY
{
        MYMEMORY(rw)   : ORIGIN = 0x0041c620 ,  LENGTH = 30
}

.myvars (NOLOAD) :
{
  *(. myvarloc)

} > MYMEMORY

Later I will specify the path of the a.ld in linker section. If i do like above, the address of the memory will be fixed ?? Is it the right way to do ?? Could anyone tell me how to do the linker setting in Eclipse OR visual studio C++ ide ??

I am creating a fixed memory address and later using this address for storing in a file on the master. Is there any other alternative solution ??

1 Answers1

0

So if I understand your question correctly, you're using Eclipse CDT to manage that VS-2008 project, and selected MSVC toolchain?

I don't have that much experience with setting properties for this kind of toolchain, but I'm pretty sure there should be some option for the MSVC linker that allows to specify a linker script and that can be set using the C/C++ Build.>Settings->Linker->General project properties.

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190