Everything
3.4 #pragma section

#pragma section requires the section name to be converted because the section names differ between the CA78K0 and CC-RL. However, some sections cannot be converted because there are no corresponding sections on the CC-RL side. Though conversion is possible, some sections have slightly different facilities. The CcnvCA78K0 outputs a message to the standard error output upon conversion of some sections. For details, see "Correspondence Table of Section Names".

 

The format of the CA78K0 is as follows.

#pragma section section-name changed-section-name [AT-start-address]

The format of the CC-RL is as follows.

#pragma section [{text|const|data|bss}] [changed-section-name]

 

-

Since the CC-RL does not have a facility equivalent to "AT-start-address", if there is "AT-start-address", the CcnvCA78K0 deletes it and outputs a message. Use the -start option to specify the location of the section in the CC-RL. For details on the -start option, see the user's manual of the CC-RL.

-

"changed-section-name" is directly output without being converted. If a character unusable in the CC-RL (e.g., ?) is used in the changed section name, a compile error will occur in the CC-RL. Change the string after conversion.

-

In #pragma section of the CC-RL, the section name is "changed section name + _n" or "changed section name + _f", and the section name for the saddr area is "changed section name + _s". For details, see the user's manual of the CC-RL.

-

If conversion is not possible because there is no corresponding section in the CC-RL, the CcnvCA78K0 outputs a message and does not perform conversion. Then the CC-RL outputs a message and ignores the #pragma directive. Modify the C source program in accordance with the Correspondence Table of Section Names described later.

 

[Examples]

Pattern 1

(Replaced successfully)

Before conversion

#pragma section @@CODE MY_CODE

After conversion

#pragma section text MY_CODE

Pattern 2

(Deletion of AT)

Before conversion

#pragma section @@CODE MY_CODE AT 0x2000

After conversion

#pragma section text MY_CODE

Pattern 3

(Compile error after replacement)

Before conversion

#pragma section @@CODE ??CODE AT 0x2000

After conversion

#pragma section text ??CODE

Corrective action

Though conversion is performed, an error will occur at compilation.

Change the section name.

Pattern 4

(Replacement is not possible)

Before conversion

#pragma section @@CALF MY_BASE

After conversion

#pragma section @@CALF MY_BASE

Corrective action

Since there is no corresponding section in the CC-RL, the program is output without being converted.

Correct the program according to the Correspondence Table of Section Names.

 

Table 3.3

Correspondence Table of Section Names

CA78K0

Section Name

Description

CC-RL

Section Type

CcnvCA78K0 Operation

Corrective Action after Conversion

@@CODE

@ECODE

Segment for code portion

text

The section is changed to the corresponding section type.

No action is required.

The section name in the CC-RL is "changed section name + _n" or "changed section name + _f".

@@LCODE

@LECODE

Segment for library code

text

Conversion is not performed.

Delete #pragma.

Specify the location of the library in the CC-RL with the link option -ROm.

@@CNST

@ECNST

Segment for ROM data

const

The section is changed to the corresponding section type.

No action is required.

The section name in the CC-RL is "changed section name + _n".

@@R_INIT

@ER_INIT

Segment for initialized data

data

The section is changed to the corresponding section type.

No action is required.

The section name in the CC-RL is "changed section name + _n".

@@R_INIS

@ER_INIS

Segment for initialized data (sreg variable)

data

The section is changed to the corresponding section type.

No action is required.

The section name in the CC-RL is "changed section name + _s".

@@CALF

Segment for callf function

None

A message is output and conversion is not performed.

Delete #pragma.

There is no corresponding facility in the CC-RL. Processing needs to be reviewed.

@@CALT

Segment for callt function table

None

A message is output and conversion is not performed.

Delete #pragma.

The section name cannot be changed in the CC-RL.

@@VECTnn

@EVECTnn

Segment for vector table

None

Conversion is not performed.

Delete #pragma.

The section name cannot be changed in the CC-RL.

@EXTxx

Segment for flash area branch table

None

Conversion is not performed.

Delete #pragma.

There is no corresponding facility in the CC-RL. Processing needs to be reviewed.

@@INIT

@EINIT

Segment for data area (initialized)

None

A message is output and conversion is not performed.

Delete #pragma.

Specify the section for mapping ROM to RAM with the link option -ROm.

@@INIS

@EINIS

Segment for data area (sreg variable, initialized)

None

A message is output and conversion is not performed.

Delete #pragma.

Specify the section for mapping ROM to RAM with the link option -ROm.

@@DATA

@EDATA

Segment for data area (uninitialized)

bss

The section is changed to the corresponding section type.

No action is required.

The section name in the CC-RL is "changed section name + _n".

@@DATS

@EDATS

Segment for data area (sreg variable, uninitialized)

bss

The section is changed to the corresponding section type.

No action is required.

The section name in the CC-RL is "changed section name + _s".

@@BITS

@EBITS

Segment for boolean type and bit type variables

None

A message is output and conversion is not performed.

Delete #pragma.

The section is allocated to the same section as other data as the _Bool type in the CC-RL.

@@BANK0, ...,

@@BANK15

Segment for bank function

None

A message is output and conversion is not performed.

Delete #pragma.

There is no corresponding facility in the CC-RL. Processing needs to be reviewed.