DSPRelated.com
Forums

RUN_ADRESS and other linker command

Started by bdnremi September 29, 2004
DSP Discussion Groups High Performance Digital Signal Processing -
C6000

RUN_ADRESS and other linker command

myTI_0391262 - 03:08am Sep 29, 2004 CST

hi,

I would like to use the linker command command run adress. So I've
defined my text sections and my new .cmd file as below:

SECTIONS
{
UNION: run = ISRAM, LOAD_START(_union_load_adresse),
LOAD_SIZE(_size_totale_union), RUN_SIZE(_size_max_union), RUN_START
(_adresse_run)
{
.section1: load = SDRAM
.section2: load = SDRAM
}
}

When I look at my .map file generated at compilation, I can check
that .section1 and .section2 are not overlayed in SDRAM and have the
same run adress in the "Attibutes/input sections " column.

My idea was to move one function dynamically during the program
execution by a memcpy:

memcpy(adresse_run, <function>,(int)size_max_union);

The issue is that both sections are placed together at the run
adress in ISRAM when I execute the program, and this before any
memcpy.

So I can diffrentiate them. Can somebody help me ?

thanks



bdnremi-

What is your target? Where is the MEMORY directive in your linker command
file?
C6000 has many different memory architectures, unless you are specific about
your problem there is a scope for misleading answers from us because we
would be only guessing. Anyways here are some clues:

1] The assembly language users guide has a good example on memory overlay
techniques along with a complete linker command file. Did you try that?

2] Memory diective:

When you are loading and running from the same location, there are no
issues- the linker/loader will bind all the sections very well even in a
single named memory region one section after another based on a default
algorithm.

When you are trying to do run time relocation you need to make sure that the
sections *inside* the union do not get *loaded* into the same named memory
region. Remember the overlay is only at run-time and not at load time. At
load time you need to make sure one section doesnt overwrite another, Does
that make sense?

Anyways, Iam kind of guessing that your probleme here is with your memory
directive. My guess is that in your case section2 is overwriting section1
during load time.

>.section1: load = SDRAM
>.section2: load = SDRAM

This shd be probably changed to:

>.section1: load = SDRAM1
>.section2: load = SDRAM2

Assume, SDRAM1 starts at 8000 0000 and SDRAM2 starts at 8000 FFFF.

Now Section2 doesnt overwrite Section1.

let me know if it helps.

--Bhooshan
----Original Message Follows----
From: "bdnremi" <>
To:
Subject: [c6x] RUN_ADRESS and other linker command
Date: Wed, 29 Sep 2004 09:52:06 -0000

DSP Discussion Groups High Performance Digital Signal Processing -
C6000

RUN_ADRESS and other linker command

myTI_0391262 - 03:08am Sep 29, 2004 CST

hi,

I would like to use the linker command command run adress. So I've
defined my text sections and my new .cmd file as below:

SECTIONS
{
UNION: run = ISRAM, LOAD_START(_union_load_adresse),
LOAD_SIZE(_size_totale_union), RUN_SIZE(_size_max_union), RUN_START
(_adresse_run)
{
.section1: load = SDRAM
.section2: load = SDRAM
}
}

When I look at my .map file generated at compilation, I can check
that .section1 and .section2 are not overlayed in SDRAM and have the
same run adress in the "Attibutes/input sections " column.

My idea was to move one function dynamically during the program
execution by a memcpy:

memcpy(adresse_run, <function>,(int)size_max_union);

The issue is that both sections are placed together at the run
adress in ISRAM when I execute the program, and this before any
memcpy.

So I can diffrentiate them. Can somebody help me ?

thanks
_____________________________________
Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you
want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join: Send an email to

To Post: Send an email to

To Leave: Send an email to

Archives: http://www.yahoogroups.com/group/c6x

Other Groups: http://www.dsprelated.com

Yahoo! Groups Links

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid963



Sorry for the details I've forgotten:

- my target is DM642.
- I read the Assembly Language User uide to write the modified .cmd
file, but I couldn't find any details about my issue

I think it's not a problem in the load time, but rather I think I do
a misuse of the RUN_START linker command. Let me explain:

I'm sure that the sections are not overlayed during the load time,
because I check the .map file, before the program execution. Each
sections has its own adress in the SDRAM (nevertheless I tried youe
solution with 2 SDRAMs, but I didn't have better result)

Here is the part of the .map file (in this exmaple each section is
just one function which returns recpectively 1 end 2): output attributes/
section page origin length input sections
-------- ---- ---------- ---------- ----------------

.section1
* 0 81006a00 00000020 RUN ADDR = 000003e0
81006a00 00000020 essai_MBAFF.obj(.section1)

.section2
* 0 81006a20 00000020 RUN ADDR = 000003e0
81006a20 00000020 essai_MBAFF.obj(.section2)

In the column "attributes" you can see that the run adress is the
same as I specified by the Union statement in the .cmd file

Here is my problem: I would like that this run adress would be a
adress where I can move dynamically one of the two functions during
the execution.
Actually, when I run the program and stop it by a break point before
the call of one of the two functions, I see that the adress of
function in section1 is the same as the one of function in section1
and botha are equal to RUN_ADDR.

I don't want that the relocation in the run-time adress becomes
automatically. Do you see what I mean ?

Thanks a lot --- In , "Bhooshan iyer" <bhooshaniyer@h...>
wrote:
> bdnremi-
>
> What is your target? Where is the MEMORY directive in your linker
command
> file?
> C6000 has many different memory architectures, unless you are
specific about
> your problem there is a scope for misleading answers from us
because we
> would be only guessing. Anyways here are some clues:
>
> 1] The assembly language users guide has a good example on memory
overlay
> techniques along with a complete linker command file. Did you try
that?
>
> 2] Memory diective:
>
> When you are loading and running from the same location, there are
no
> issues- the linker/loader will bind all the sections very well
even in a
> single named memory region one section after another based on a
default
> algorithm.
>
> When you are trying to do run time relocation you need to make
sure that the
> sections *inside* the union do not get *loaded* into the same
named memory
> region. Remember the overlay is only at run-time and not at load
time. At
> load time you need to make sure one section doesnt overwrite
another, Does
> that make sense?
>
> Anyways, Iam kind of guessing that your probleme here is with your
memory
> directive. My guess is that in your case section2 is overwriting
section1
> during load time.
>
> >.section1: load = SDRAM
> >.section2: load = SDRAM
>
> This shd be probably changed to:
>
> >.section1: load = SDRAM1
> >.section2: load = SDRAM2
>
> Assume, SDRAM1 starts at 8000 0000 and SDRAM2 starts at 8000 FFFF.
>
> Now Section2 doesnt overwrite Section1.
>
> let me know if it helps.
>
> --Bhooshan >
> ----Original Message Follows----
> From: "bdnremi" <bdnremi@y...>
> To:
> Subject: [c6x] RUN_ADRESS and other linker command
> Date: Wed, 29 Sep 2004 09:52:06 -0000
>
> DSP Discussion Groups High Performance Digital Signal
Processing -
> C6000
>
> RUN_ADRESS and other linker command
>
> myTI_0391262 - 03:08am Sep 29, 2004 CST
>
> hi,
>
> I would like to use the linker command command run adress. So I've
> defined my text sections and my new .cmd file as below:
>
> SECTIONS
> {
> UNION: run = ISRAM, LOAD_START(_union_load_adresse),
> LOAD_SIZE(_size_totale_union), RUN_SIZE(_size_max_union), RUN_START
> (_adresse_run)
> {
> .section1: load = SDRAM
> .section2: load = SDRAM
> }
> }
>
> When I look at my .map file generated at compilation, I can check
> that .section1 and .section2 are not overlayed in SDRAM and have
the
> same run adress in the "Attibutes/input sections " column.
>
> My idea was to move one function dynamically during the program
> execution by a memcpy:
>
> memcpy(adresse_run, <function>,(int)size_max_union);
>
> The issue is that both sections are placed together at the run
> adress in ISRAM when I execute the program, and this before any
> memcpy.
>
> So I can diffrentiate them. Can somebody help me ?
>
> thanks >
> _____________________________________
> Note: If you do a simple "reply" with your email client, only the
author of
> this message will receive your answer. You need to do a "reply
all" if you
> want your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to
>
> To Post: Send an email to
>
> To Leave: Send an email to
>
> Archives: http://www.yahoogroups.com/group/c6x
>
> Other Groups: http://www.dsprelated.com
>
> Yahoo! Groups Links >
>
> _________________________________________________________________
> Is your PC infected? Get a FREE online computer virus scan from
McAfee
> Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?
cid963