Discussion:
how to solve this linker input file unused and linkiing not done in Eclipse ide?
(too old to reply)
Hemanth Venkatappa
2014-01-27 11:18:10 UTC
Permalink
I created a memory linker script and saved it as memory.ld in the eclipse ide : Project : properties : gcc linker : miscellaneous : I added -M -T memory.ld

memory.ld :

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

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

} > MYMEMORY

In my c program : I made a global declaration as:

__attribute__ ((section(".myvarloc")))
uint8 measurements[30];

After running my project, it is displaying as: linker input file unused because linking not done

how to solve the above problem ??
Nicolas
2014-01-28 12:57:16 UTC
Permalink
Post by Hemanth Venkatappa
I created a memory linker script and saved it as memory.ld in the eclipse ide : Project : properties : gcc linker : miscellaneous : I added -M -T memory.ld
MEMORY
{
MYMEMORY(rw) : ORIGIN = 0x40000000 , LENGTH = 30
}
{
*(.myvarloc)
} > MYMEMORY
__attribute__ ((section(".myvarloc")))
uint8 measurements[30];
After running my project, it is displaying as: linker input file unused because linking not done
how to solve the above problem ??
So your problem is that you are writing a control application which must
be instrumented by another one. For the instrumentation, you need to
know the addresses of various variables inside your controlling application.
Right ?
Hemanth Venkatappa
2014-02-03 11:03:12 UTC
Permalink
Post by Nicolas
Post by Hemanth Venkatappa
I created a memory linker script and saved it as memory.ld in the eclipse ide : Project : properties : gcc linker : miscellaneous : I added -M -T memory.ld
MEMORY
{
MYMEMORY(rw) : ORIGIN = 0x40000000 , LENGTH = 30
}
{
*(.myvarloc)
} > MYMEMORY
__attribute__ ((section(".myvarloc")))
uint8 measurements[30];
After running my project, it is displaying as: linker input file unused because linking not done
how to solve the above problem ??
So your problem is that you are writing a control application which must
be instrumented by another one. For the instrumentation, you need to
know the addresses of various variables inside your controlling application.
Right ?
exactly right.
Nicolas
2014-02-04 10:50:01 UTC
Permalink
Post by Hemanth Venkatappa
Post by Nicolas
Post by Hemanth Venkatappa
I created a memory linker script and saved it as memory.ld in the eclipse ide : Project : properties : gcc linker : miscellaneous : I added -M -T memory.ld
MEMORY
{
MYMEMORY(rw) : ORIGIN = 0x40000000 , LENGTH = 30
}
{
*(.myvarloc)
} > MYMEMORY
__attribute__ ((section(".myvarloc")))
uint8 measurements[30];
After running my project, it is displaying as: linker input file unused because linking not done
how to solve the above problem ??
So your problem is that you are writing a control application which must
be instrumented by another one. For the instrumentation, you need to
know the addresses of various variables inside your controlling application.
Right ?
exactly right.
So, the problem is complex.
The linker output file gives you "linked" addresses. When the
application is launched, the system launcher modifies these "linked"
addresses to "logical" addresses relative to the "logical" start address
of the application. The "logical" start address is not related to its
physical address.
Imagine you compile an application with a variable called "my_var". This
variable is at "linked" address 0x10.
The system launcher must create a "logical" (or "virtual") environment
for applications when they are launched. The "logical" start address of
the application is not necessarily 0. It is often 64kB or more to let
detect null pointers accesses. Let say this is 64kB. So the "my_var"
variable is at "logical" address 0x10000 + 0x10 = 0x10010.
Now, you launch the application twice. Each application uses the same
"logical" address layout. So the "my_var" variable is at "logical"
address 0x10010 for both applications. Obviously, if the "physical"
addresses are the same for both applications, data corruptions will
arise. For this, the system launcher affects different "physical"
addresses for both applications. So, for example, application 1 will
have "my_var" at "physical" address 0x10010010 and application 2 at
"physical" address 0x20010010.
All addresses are just examples.
Because of data protection mechanisms, an application can't access the
memory space of another one. So the calibrating application can't access
the controlling application data directly.
One way to share data between applications is to use shared memory.
Hemanth Venkatappa
2014-02-04 11:32:04 UTC
Permalink
Post by Nicolas
Post by Hemanth Venkatappa
Post by Nicolas
Post by Hemanth Venkatappa
I created a memory linker script and saved it as memory.ld in the eclipse ide : Project : properties : gcc linker : miscellaneous : I added -M -T memory.ld
MEMORY
{
MYMEMORY(rw) : ORIGIN = 0x40000000 , LENGTH = 30
}
{
*(.myvarloc)
} > MYMEMORY
__attribute__ ((section(".myvarloc")))
uint8 measurements[30];
After running my project, it is displaying as: linker input file unused because linking not done
how to solve the above problem ??
So your problem is that you are writing a control application which must
be instrumented by another one. For the instrumentation, you need to
know the addresses of various variables inside your controlling application.
Right ?
exactly right.
So, the problem is complex.
The linker output file gives you "linked" addresses. When the
application is launched, the system launcher modifies these "linked"
addresses to "logical" addresses relative to the "logical" start address
of the application. The "logical" start address is not related to its
physical address.
Imagine you compile an application with a variable called "my_var". This
variable is at "linked" address 0x10.
The system launcher must create a "logical" (or "virtual") environment
for applications when they are launched. The "logical" start address of
the application is not necessarily 0. It is often 64kB or more to let
detect null pointers accesses. Let say this is 64kB. So the "my_var"
variable is at "logical" address 0x10000 + 0x10 = 0x10010.
Now, you launch the application twice. Each application uses the same
"logical" address layout. So the "my_var" variable is at "logical"
address 0x10010 for both applications. Obviously, if the "physical"
addresses are the same for both applications, data corruptions will
arise. For this, the system launcher affects different "physical"
addresses for both applications. So, for example, application 1 will
have "my_var" at "physical" address 0x10010010 and application 2 at
"physical" address 0x20010010.
All addresses are just examples.
Because of data protection mechanisms, an application can't access the
memory space of another one. So the calibrating application can't access
the controlling application data directly.
One way to share data between applications is to use shared memory.
I have created a memory.ld :
It contains -
MEMORY
{
MYMEMORY(rw) : ORIGIN = 0x0041c620 , LENGTH = 30
}

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

} > MYMEMORY

In my main.c program -
__attribute__((section(".myvarloc")))
uint8 measurements[30];

Is it the right way to create a memory of specific address and length ??
Loading...