Technical information

Operating Precautions for CPDW9X/NT-CDR-V85X, Y-GHS-MULTI-V800
TM
Customer Notification r20tu0003ed1812 20
No. a9
Two-pass inlining and section renaming causes incorrect linker behavior
Version Information
V3.3
Details
Two-pass inlining and section renaming causes incorrect linker behavior. By inlining function
"wait" the linker places “foo” into the ".data" section, unnoticed of the pragma directive.
Example:
v011012a.c:
#pragma ghs section data=".myseg"
static short foo[10000] ={0};
#pragma ghs section data=default
int a=0;
void wait(void)
{
int i=0;
while(i!=100)i=i+1;
}
void main(void)
{
while(a!=10000)
{
foo[a] = a;
wait();
a++;
}
}
Command Sequence
ccv850e noobj -compat -c -list -passsource -g -OI=wait test.c
ccv850e map test.ld test.o -o test
[elxr] (error) section .data (0xffffc000-0xe3f) doesn't fit in memory
block Default (0-0xffffffff)
Workaround
Use the “__inline” keyword in C code, instead of inlining option OI.
Example:
__inline void wait(void)
{
int i=0;
while(i!=100)i=i+1;
}