How to assign a data segment of a c file to a specific location in an l3k file

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to assign a data segment of a c file to a specific location in an l3k file

Jump to solution
7,548 Views
yeyuan1
Contributor III

hello everyone

            The platform I use is B4860。

 

            My requirements are as follows:

            I want to define the data segment in the alloc.c file to a fixed section of memory that is unique to alloc.c.

 

             The normal data segment is defined as follows:

              descriptor__ddr__cacheable_wb__sys__private__data {
                             .struct_start
                             .ddr__cacheable_wb__sys__private__data
                             .bsstab
                             ".c?_bss_sections_table"
                             .init_table
                             .rom_init
                             .rom_init_tables
                             .exception
                             .exception_index
                             .staticinit
                             .zdata
                             reserved_crt_tls
                            .data

                            .mydata
                            .ddr__cacheable_wb__sys__private__rom
                            //LNK_SECTION(heap, "rw", _HeapSize, 0x8, "heap");
                            .bss
                            .ddr__cacheable_wb__sys__private__bss
                  } > ddr_private_data_c_wb;

                A lot of data from c files will be output to this data segment

 

               This is not what I want

 

              I want the data section of the alloc.c file to be exported to mydata,the data segment of any other file cannot be exported to mydata.

 

               What should I do, please?    Or is there a reference document?

 

Thank you all

0 Kudos
1 Solution
7,490 Views
yeyuan1
Contributor III

My requirement can be achieved with the following method

RENAME "*rtlib_be_x.elb(alloc.eln)", ".text", ".lib_text"

This sentence means Define the code segment of alloc.c to the section's .lib_text

View solution in original post

0 Kudos
6 Replies
7,491 Views
yeyuan1
Contributor III

My requirement can be achieved with the following method

RENAME "*rtlib_be_x.elb(alloc.eln)", ".text", ".lib_text"

This sentence means Define the code segment of alloc.c to the section's .lib_text

0 Kudos
7,506 Views
yeyuan1
Contributor III

 

Can you give me some more advice?

 

thank you

0 Kudos
7,500 Views
yipingwang
NXP TechSupport
NXP TechSupport

In CodeWarrior for PA 10.5, please create a bareboard project for B4860QDS from File->New->CodeWarrior Bareboard Project Wizard, then build this project from Project->Build Project.

Please refer to __CTOR_LIST__ and __CTOR_END__ definition in section ".ctors" in file __start_e6500_32bit_crt0.c.

Please refer to section ".ctors" definition in LCF file B4860QDS_gcc-aeabi_SMP_ROM.lcf.

0 Kudos
7,532 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the section "Additional Small Data Sections" in the attached document.

0 Kudos
7,528 Views
yeyuan1
Contributor III

 

Thank you for your answer, but this may not meet my needs

 

The documentation describes it as follows.

1.PNG

As you can see from the documentation, this way is defining the x variable to the .red piece of memory, which is not the problem I need to solve.

 

I need to define the data in the C standard library file alloc.c to a specific memory. The c standard library file cannot be modified, so it can only be modified by the l3k file.

 

Other platforms are implemented as follows:

outsection {

     alloc.obj(.data)

 } > mydata

 

Other platforms are implemented in such a way that the data in alloc.c is defined to mydata.

 

So please ask the B4860 if it can achieve such a function?

 

Thanks again for your answer

 

Please help me to solve this problem

0 Kudos
7,534 Views
yeyuan1
Contributor III

 

                Please help me to resolve this issue.

thank you

0 Kudos