 |
|
 |
RENESAS TOOL NEWS on March 16, 2006: RSO-M3T-CC32R-060316D
A Note on Using the C/C++ Compiler Package
M3T-CC32R V.5.00 Release 00 |
Please take note of the following problem in using the C/C++ compiler package M3T-CC32R V.5.00 Release 00, which is used for the M32R MCU family:
- On re-linking a relocatable load module file
- Description
If a relocatable load module file is created using the lnk32R linker or the cc32R compile driver of the M3T-CC32R V.5.00 Release 00 with the -r option being selected, and then this file is re-linked using the compiler, an error arises, resulting in linking being not completed. At this time, the following error message appears:
lnk32R: error: already exist COMMON section.
Note that when the compiler is managed by the High-performance Embedded Workshop, the same problem occurs.
| 1.1 |
|
Examples
Symbol % denotes a prompt in the examples below.
Example 1. Command lines for directly invoking the lnk32R
to link files
--------------------------------------------------------------------
% cc32R -c sample11.c
% cc32R -c -o sample12.mo sample12.c
% as32R -o sample13.mo sample13.ms
% lnk32R -r -o group1.rel -l m32RcR.lib sample11.mo : -r used
sample12.mo sample13.mo
% as32R -o start.mo start.ms
% lnk32R -o sample.abs -SEC P=10000,C,D,B group1.rel : Re-linked
start.mo
lnk32R: error: already exist COMMON section.
--------------------------------------------------------------------
Example 2. Command lines for invoking the cc32R to link files
--------------------------------------------------------------------
% cc32R -c sample11.c
% cc32R -c -o sample12.mo sample12.c
% as32R -o sample13.mo sample13.ms
% cc32R -r -o group1.rel -l m32RcR.lib sample11.mo : -r used
sample12.mo sample13.mo
% as32R -o start.mo start.ms
% cc32R -o sample.abs -SEC P=10000,C,D,B group1.rel : Re-linked
start.mo
lnk32R: error: already exist COMMON section.
-------------------------------------------------------------------- |
- Workaround
Create a library file (.lib) in place of a relocatable load module file;
then use the library file as an input file for re-linking
| 2.1 |
|
Modification of Example 1 Above
Create a library file using the lib32R command as follows:
Original: lnk32R -r -o Output file Input file . . .
Modified: lib32R -c Output file Input file . . .
-----------------------------------------------------------------
% cc32R -c sample11.c
% cc32R -c -o sample12.mo sample12.c
% as32R -o sample13.mo sample13.ms
% lib32R -c group1.lib sample11.mo sample12.mo sample13.mo
: Create a .lib file using lib32R -c (*)
% as32R -o start.mo start.ms
% lnk32R -o sample.abs -l m32RcR.lib -SEC P=10000,C,D,B
group1.lib start.mo : a .lib file re-linked
-----------------------------------------------------------------
| *: |
|
It is not necessary, but you are encouraged to change the extension of the output file to .lib (in the above example, group1.rel changed to group1.lib) |
|
| 2.2 |
|
Modification of Example 2 Above
Create a library file using the cc32R command with the -mklib=c option as follows:
Original: cc32R -r -o Output file Input file . . .
Modified: cc32R -mklib=c -o Output file Input file . . .
Or, if input files are created using the cc32R command with the -c option, use the -c option after the above modification has been made.
If output files are named using the cc32R or as32R command with the -o option, change the filename extension to .ml.
-----------------------------------------------------------------
% cc32R -mklib -c sample11.c
% cc32R -mklib -c -o sample12.ml sample12.c
% as32R -o sample13.ml sample13.ms : Extension changed to .ml
% cc32R -mklib=c -o group1.lib sample11.ml : -mklib=C used (*)
sample12.ml sample13.ml : Extension changed to .ml
% as32R -o start.mo start.ms
% lnk32R -o sample.abs -l m32RcR.lib -SEC P=10000,C,D,B
group1.lib start.mo : a .lib file re-linked
-----------------------------------------------------------------
| *: |
|
It is not necessary, but you are encouraged to change the extension of the output file to .lib (in the above example, group1.rel changed to group1.lib) |
|
| 2.3 |
|
Modification When the High-performance Embedded Workshop Used
If a relocatable load module file is going to be created with linker option -r being selected, create a library file instead by performing the following steps:
| (1) |
|
Open the project for which a relocatable load module file is to be created. |
| (2) |
|
In the High-performance Embedded Workshop, open the Build menu and select the Renesas M32R Standard Toolchain command. You see the Renesas M32R Standard Toolchain Options dialog box. |
| (3) |
|
In this dialog box, click the Link tab. |
| (4) |
|
Select Input in the Category list box, and make a memo of the name of the standard library file under the [-L][-l] line (this file name will be used for the file to be re-linked). |
| (5) |
|
Select Section in the Category list box. |
| (6) |
|
Uncheck the -r option. |
| (7) |
|
Select Message in the Category list box. |
| (8) |
|
Enter the following character string into the User defined options text box in the middle section:
-.ml=.mo -mklib=c |
| (9) |
|
Click the OK button to start a build. |
Notices:
- If the -e, -l, or -L option is selected with the lnk32R or cc32R command, use it at re-linking after modification is made.
- If no library file is used in any of the linked object files, some of the object module files in the library may not be linked.
So, if it is necessary to link any files created as library files as a measure to prevent the problem, be sure to designate them as input files before re-linking.
|
- Schedule of Fixing the Problem
We plan to fix this problem in the next release of the product.
|
 |