Skip to main content



      Home
Home » Newcomers » Newcomers » How to set the linking parameter to put data in a special section
How to set the linking parameter to put data in a special section [message #1871883] Tue, 15 October 2024 02:24 Go to next message
Eclipse UserFriend
Hi,

My eclipse version is Version: 2023-09 (4.29.0) and Build id: 20230907-1323.
I define a section in link file and try to put some data in it, But i can't find it in Map file and get an unreasonable result. The address of the data is weird.
The same code and link file work well in another Makefile build system , so i think the problem is in the GCC linking or building parameter.
I really appreciate it if someone can give me a hand.

Code:
uint8_t g_azifft_buf[3][DDMA_STAGEB_AZIFFT_BUF_SIZE] __attribute__((aligned(16), section(".L3DATA")));

Linker file:
.L3DATA (NOLOAD):
{
*(.L3DATA)
} > L3DATA

Map file:
I can't find it in map file:

Build log(I remove some redundant info, like *.o and -I*):
Building file: D:/ARCO/B2/b2_sdk/component/ARCO/datapath/ddmastageB/test/ddma_stageB_test.c
Invoking: GNU Arm Cross C Compiler
arm-none-eabi-gcc -mcpu=cortex-a7 -marm -mlittle-endian -mfloat-abi=hard -mfpu=neon-fp16 -mno-unaligned-access -O3 -ffunction-sections -fdata-sections -fno-common -ffreestanding -flto -fno-strict-aliasing -Wall -g3 -DARCO_ASS_CHIP -DCONFIG_CORTEX_A -I"D:\ARCO\B2\b2_sdk\component\CMSIS\Core_A\incl" -std=gnu11 -MMD -MP -MF"component/ARCO/datapath/ddmastageB/test/ddma_stageB_test.d" -MT"component/ARCO/datapath/ddmastageB/test/ddma_stageB_test.o" -c -o "component/ARCO/datapath/ddmastageB/test/ddma_stageB_test.o" "D:/ARCO/B2/b2_sdk/component/ARCO/datapath/ddmastageB/test/ddma_stageB_test.c"
Finished building: D:/ARCO/B2/b2_sdk/component/ARCO/datapath/ddmastageB/test/ddma_stageB_test.c

Building target: ass_firmware.elf
Invoking: GNU Arm Cross C Linker
arm-none-eabi-gcc -mcpu=cortex-a7 -marm -mlittle-endian -mfloat-abi=hard -mfpu=neon-fp16 -mno-unaligned-access -O3 -ffunction-sections -fdata-sections -fno-common -ffreestanding -flto -fno-strict-aliasing -Wall -g3 -T "D:\ARCO\B2\b2_sdk\project\ASS_DEMO\link.lds" -nostartfiles -Wl,-Map,"ass_firmware.map" --specs=nano.specs -u _printf_float --specs=nosys.specs -Wl,--wrap,_malloc_r -Wl,--wrap,_calloc_r -Wl,--wrap,_free_r -fno-strict-aliasing -o "ass_firmware.elf" ./user/src/ass_radar_demo.o -lm
Finished building target: ass_firmware.elf
Re: How to set the linking parameter to put data in a special section [message #1871895 is a reply to message #1871883] Tue, 15 October 2024 09:58 Go to previous messageGo to next message
Eclipse UserFriend
Ask here:

https://github.com/eclipse-cdt/cdt/discussions
Re: How to set the linking parameter to put data in a special section [message #1871908 is a reply to message #1871895] Tue, 15 October 2024 14:50 Go to previous messageGo to next message
Eclipse UserFriend
1. The linker may think that the section is not used, and discard it. It should be seen in the 'discarded input sections' part of the map. The section can be forced to stay by KEEP(*(.L3DATA))

2. The compiler may think that the section is not used, and discard it. Check for the global symbol from the assembly listing or get the object file symbol list with arm-none-eabi-nm.
The compiler can be forced to keep with __attribute__((used))

--

-TV
Re: How to set the linking parameter to put data in a special section [message #1872015 is a reply to message #1871908] Thu, 17 October 2024 20:42 Go to previous message
Eclipse UserFriend
I follow your advice and find it in Map file. I have fixed my issue, Thanks.
Previous Topic:parallel computing
Next Topic:4k high resultion Symbols
Goto Forum:
  


Current Time: Mon Apr 21 08:50:34 EDT 2025

Powered by FUDForum. Page generated in 0.08769 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top