anchao commented on PR #12624:
URL: https://github.com/apache/nuttx/pull/12624#issuecomment-2209688351
> Please include a usage example or documentation explaining how 3rd party
applications will use it, it could be obvious for you, but maybe not of other
developers. :-)
@acassis comment message has been updated
> Imagine a 3rd_party library wants to put its "data_img" at nuttx data
memory, is it just need to define CONFIG_SIM_CUSTOM_DATA_SECTION as "data_img"?
@acassis we need to follow the syntax of linker script. In 3rd-party
applications, some data will be labeled as section:
```
| a.c:
| struct task_s a __attribute__((section(".data.custom.taska")));
| b.c:
| struct task_s b __attribute__((section(".data.custom.taskb")));
```
Data of the same type struct can be placed in a fixed location to reduce the
overhead caused by searching:
```
| .data :
| {
| _custom_data_table_start = .;
| KEEP(*(.data.custom.*))
| _custom_data_table_end = .;
| }
```
Such section declare can be configured via Kconfig in the PR:
```
| CONFIG_SIM_CUSTOM_DATA_SECTION=" .data : { _custom_data_table_start = .;
KEEP(*(.data.custom.*)) _custom_data_table_end = .; } "
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]