User`s manual

M3T-PD32R V.5.01 Release 00 Release Notes
Rev.1.00 10.01.2006 page 13 of 34
REJ10J1495-0100
5.7. Precautions when using TW32R (V.1.00 Release 1 to V.3.00 Release 1)
When you are using TW32R version from V.1.00 Release 1 to V.3.00 Release 1, the program header
information of the load module created by the linker may not be correctly generated. This may cause
a problem that a part of the section cannot be correctly downloaded by the emulator debugger.
[Condition which triggers this problem]
It has been proved that the problem occurs when a linker script is described where the
relationship between the section execution address (VMA) and the load address (LMA) meets the
two conditions given below. In the following example, section .secB is not downloaded correctly.
(1) Any three sections are allocated to the continuous load addresses (LMA) (Figure A).
(2) Only the execution address (VMA) of the section allocated in the middle (.secB) is allocated to
the low address (Figure B).
LMA VMA
Low address
.secB
.secA .secA
.secB
.secC .secC
High address
Figure A
Figure B
[Corrective action]
Try one of the following methods:
(1) Changing the section allocation sequence
When allocating the load address (LMA) of each section, change the linker script description so
that a section whose execution address (VMA) is allocated to low address (.secB) will not be
placed between the sections whose execution address is the same as the load address
(.secA, .secC).
For example, change the section allocation sequence as shown in Figure C and Figure D.
LMA VMA
Low address
.secB
.secA .secA
.secC .secC
.secB
High address
Figure C
Figure D
(2) Creating a program header using the PHDRS instruction
As shown in the following example, change the linker script.
Then, the system will create the program header for each section.
[1] In each section definition, define the name to be referenced in the PHDRS instruction. Be
sure to select the different name for each section. The defined name is used to be identified in
the PHDRS instruction. You can specify any name. (It could be the same as the symbol name,