__libc_init_array STM32L0 失败
__libc_init_array failure on STM32L0
我从 linux 上的 STM32L053 开始,使用 Eclipse IDE,使用 gcc-arm-none-eabi-7-2017-q4 进行交叉编译,并使用 openocd 进行调试.
在进入 main() 之前,我进入了 WWDG_IRQHandler()。
在调试器堆栈上,我可以看到:
↓ Reset_Handler() at 0x8002812
↓ __libc_init_array() at 0x8002836
↓ <signal handler called>() at 0xfffffff9
WWDG_IRQHandler() at 0x8002830
来自 Reset_Handler() 的几行,顺便说一句,我认为箭头显示错误的行,因为堆栈显示 __libc_init_array().
Reset_Handler:
...
08002806: cmp r2, r3
08002808: bcc.n 0x80027fe <Reset_Handler+30>
0800280a: bl 0x8000128 <SystemInit>
0800280e: bl 0x8002834 <__libc_init_array>
-> 08002812: bl 0x80027d8 <main>
...
对于 __libc_init_array(),我希望箭头显示的是正确的行,而不是显示错误的下一行。
__libc_init_array:
08002834: eors r0, r6
-> 08002836: stmdb sp!, {r2, r3, r5, r6, sp, lr}
0800283a: b.n 0x800237c <SPIx_Write+8>
0800283c: str r4, [r5, r1]
...
对于WWDG_IRQHandler(),这并不重要,但post无论如何
WWDG_IRQHandler:
-> 08002830: b.n 0x8002830 <WWDG_IRQHandler>
08002832: movs r0, r0
我的“c”代码只包含include(未达到主要功能):
#include <stm32l0538_discovery.h>
#include <sys/types.h>
eclipse上的配置,我没有使用任何插件,我设置为:
C/C++ Build
|
|_Cross Settings
| |_Prefix : arm-none-eabi-
| \_Path : /.../gcc-arm-none-eabi-7-2017-q4-major/bin
|
|_Cross Gcc Compiler
| |_Command : gcc
| |_All Options : -nostdinc
| | -I/.../gcc-arm-none-eabi-7-2017-q4-major/lib/gcc/arm-none-eabi/7.2.1/include
| | -I/.../gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include
| | -I/.../STM32Cube_FW_L0_V1.10.0/Drivers/BSP/STM32L0538-Discovery
| | -I/.../STM32Cube_FW_L0_V1.10.0/Drivers/CMSIS/Include
| | -I/.../STM32Cube_FW_L0_V1.10.0/Drivers/STM32L0xx_HAL_Driver/Inc
| | -I/.../STM32Cube_FW_L0_V1.10.0/Drivers/CMSIS/Device/ST/STM32L0xx/Include
| | -Os
| | -g3
| | -Wall
| | -Wextra
| | -mcpu=cortex-m0plus
| | -march=armv6s-m
| | -mlittle-endian
| | -mthumb
| | -DSTM32L053xx
| | -c
| | -v
| \_Command line pattern : ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
|
|_Cross Gcc Linker
| |_command : gcc
| |_All Options : -static
| | -L/.../gcc-arm-none-eabi-7-2017-q4-major/
| | -L/.../gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/lib
| | -L/.../gcc-arm-none-eabi-7-2017-q4-major/lib
| | -L/.../gcc-arm-none-eabi-7-2017-q4-major/lib/gcc/arm-none-eabi/7.2.1
| | -mcpu=cortex-m0plus
| | -march=armv6s-m
| | -mlittle-endian
| | -mthumb
| | -DSTM32L053xx
| | -T/.../STM32Cube_FW_L0_V1.10.0/Projects/STM32L053C8-Discovery/Templates/TrueSTUDIO/STM32L053C8_Discovery/STM32L053C8_FLASH.ld
| | -Wl,--gc-sections
| | -Os
| \_Command line pattern: ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
|
\_Cross GCC Assembler
|_command : as
|_all options: /*blank*/
\_Command line pattern : ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
在 LD 文件中,我只看到两件事可能很有趣,我没有对整个文件进行 CP :
/* Entry Point */
ENTRY(Reset_Handler)
...
/* Remove information from the standard libraries */
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
...
启动是ST提供的,在gogole上很容易恢复,像这个文件:
https://github.com/AndiceLabs/STM32L053R8-Nucleo/blob/master/Drivers/CMSIS/Device/ST/STM32L0xx/Source/Templates/gcc/startup_stm32l053xx.s
除了第 151 行被我设置为 0,当然第 205/206 行不在我的文件中。
我不是 libc 和设置环境的高手,我尝试了很多东西,比如(不)检查“nostdlibs”、“nostartfiles”或“nodefaultlibs”。但它总是导致编译失败。
我真的不知道尝试什么,请为我指明道路!
谢谢!
吉布兹
经过一些研究,我确定这不是与堆栈指针 SP 相关的问题。
回到代码:
__libc_init_array:
08002834: eors r0, r6
-> 08002836: stmdb sp!, {r2, r3, r5, r6, sp, lr}
0800283a: b.n 0x800237c <SPIx_Write+8>
0800283c: str r4, [r5, r1]
...
Regarding the instruction set from different cortex (M0 to M4F)cortex-M0的指令集中不包含STMDB指令,cortex-M0+只有STM指令(白色第三列,第10行为STM,蓝色第一列, STMDB 的第 17 行)。
GNU Arm Embedded Toolchain (https://developer.arm.com/open-source/gnu-toolchain/gnu-rm) 的页面上写着支持 Cortex-M0(+),所以我猜是 C 库。在其他网站上,他们建议测试 gcc 多库,我试了一下:
[jibz@Jazptop bin]$ ./arm-none-eabi-gcc --print-multi-lib
.;
thumb;@mthumb
hard;@mfloat-abi=hard
thumb/v6-m;@mthumb@march=armv6s-m
thumb/v7-m;@mthumb@march=armv7-m
thumb/v7e-m;@mthumb@march=armv7e-m
thumb/v7-ar;@mthumb@march=armv7
thumb/v8-m.base;@mthumb@march=armv8-m.base
thumb/v8-m.main;@mthumb@march=armv8-m.main
thumb/v7e-m/fpv4-sp/softfp;@mthumb@march=armv7e-m@mfpu=fpv4-sp-d16@mfloat-abi=softfp
thumb/v7e-m/fpv4-sp/hard;@mthumb@march=armv7e-m@mfpu=fpv4-sp-d16@mfloat-abi=hard
thumb/v7e-m/fpv5/softfp;@mthumb@march=armv7e-m@mfpu=fpv5-d16@mfloat-abi=softfp
thumb/v7e-m/fpv5/hard;@mthumb@march=armv7e-m@mfpu=fpv5-d16@mfloat-abi=hard
thumb/v7-ar/fpv3/softfp;@mthumb@march=armv7@mfpu=vfpv3-d16@mfloat-abi=softfp
thumb/v7-ar/fpv3/hard;@mthumb@march=armv7@mfpu=vfpv3-d16@mfloat-abi=hard
thumb/v8-m.main/fpv5-sp/softfp;@mthumb@march=armv8-m.main@mfpu=fpv5-sp-d16@mfloat-abi=softfp
thumb/v8-m.main/fpv5-sp/hard;@mthumb@march=armv8-m.main@mfpu=fpv5-sp-d16@mfloat-abi=hard
thumb/v8-m.main/fpv5/softfp;@mthumb@march=armv8-m.main@mfpu=fpv5-d16@mfloat-abi=softfp
thumb/v8-m.main/fpv5/hard;@mthumb@march=armv8-m.main@mfpu=fpv5-d16@mfloat-abi=hard
我相信它已安装,因为 Cortex-M0+ 在架构 ARMv6-M 上。但是结果显示ARMv6s-M,它改变了什么吗?
不管怎样,我还是不知道如何获得正确的libc。
08002836: stmdb sp!, {r2, r3, r5, r6, sp, lr}
这可能是您第一次实际上在您的代码中使用堆栈。一些链接器脚本没有正确对齐堆栈,因此您可能会在该指令中遇到(硬)错误。检查调试器中的 SP
寄存器值。
除非您在源代码中设置自己的故障处理程序,否则将设置一些默认处理程序,看起来完全 类似于您的WWDG_IRQHandler
。
compiler/linker 对 all undefiend IRQ 和错误处理程序使用相同的函数 - 这会阻止您正确识别发生的实际错误。
已解决!!
我找到了 armv6 的 libc.a,更改了一些链接器选项并添加了路径,这里是我的链接器配置:
C/C++ Build
|
|_Cross Settings
|
|_Cross Gcc Compiler
|
|_Cross Gcc Linker
| |_command : gcc
| |_All Options : -static
| | => -L/.../gcc-arm-none-eabi-7-2017-q4-major/lib/gcc/arm-none-eabi/7.2.1/thumb/v6-m/
| | => -L/.../gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/lib/thumb/v6-m/
| | -L/.../gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/lib
| | -L/.../gcc-arm-none-eabi-7-2017-q4-major/lib
| | -L/.../gcc-arm-none-eabi-7-2017-q4-major/lib/gcc/arm-none-eabi/7.2.1
| | -mcpu=cortex-m0plus
| | -march=armv6s-m
| | -mlittle-endian
| | -mthumb
| | -T/.../STM32Cube_FW_L0_V1.10.0/Projects/STM32L053C8-Discovery/Templates/TrueSTUDIO/STM32L053C8_Discovery/STM32L053C8_FLASH.ld
| | -Wl,--gc-sections
| | -Os
| \_Command line pattern: ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
|
\_Cross GCC Assembler
感谢 Turbo J 的到来和帮助,
吉布兹
在与某人写完之后,他向我展示了我在配置中犯的错误,所以我 post 这里(再次)配置 :
|_Cross Settings : Prefix : arm-none-eabi-
| Path : ${GccPath}/bin
|
|_Cross Gcc Compiler : command : gcc
| |_Preprocessor : uncheck "Do not search system directories(-nostdinc)",
| | I believed that I will search in the native system x64
| | machin, but no, it just means that it will search in
| | the GCC folder.
| | -D STM32L053xx :needed to use some code provided by ST
| |_Includes : removing all references of path to /gcc/*/include because
| | now they are included without the -nostdinc option.
| | -I ${DriversPath}/BSP/STM32L0538-Discovery
| | -I ${DriversPath}/CMSIS/Include
| | -I ${DriversPath}/STM32L0xx_HAL_Driver/Inc
| | -I ${DriversPath}/CMSIS/Device/ST/STM32L053xx/Include
| |_Optimization : Optimization level : Optimization for size (-Os)
| |_Debugging : Debug Level : Maximum (-g3)
| |_Warnings : All Warnings (-Wall)
| | Extra warnings (-Wextra)
| \_Miscellaneous : -mcpu=cortex-m0plus : with march, GCC will know which lib it should use, and not using the first found in the paths provided previously with the linker option -L.
| -march=armv6s-m
| -mlittle-endian
| -mthumb
| -c
| -ffunction-sections : it permits to remove not necessary code
| -fdata-sections : it permits to remove not necessary data.
| -v (Verbose)
|
\_Cross GCC Linker : command : gcc
|_general : No shared libraries (-static)
|_Libraries : it should stay blank, I removed all -L options.
\_Miscellaneous : -mcpu=cortex-m0plus
-mtune=cortex-m0plus :Actually, I believe it is just an optimization for **that** cpu.
-march=armv6s-m
-mlittle-endian
-mthumb
-T${ProjDirPath}/LinkerScripts/STM32L053C8_FLASH.ld
-Wl,-Map=${ProjDirPath}/Logs/Pluviographe.map : The map file is a kind of log, showing links between elements.
-Wl,-gc-sections : It removes some unused code, provided by the -ffunctions-sections and -fdata-sections from the compiler.
代码中可能还有 "small" 个错误,但更干净了。
我从 linux 上的 STM32L053 开始,使用 Eclipse IDE,使用 gcc-arm-none-eabi-7-2017-q4 进行交叉编译,并使用 openocd 进行调试.
在进入 main() 之前,我进入了 WWDG_IRQHandler()。 在调试器堆栈上,我可以看到:
↓ Reset_Handler() at 0x8002812
↓ __libc_init_array() at 0x8002836
↓ <signal handler called>() at 0xfffffff9
WWDG_IRQHandler() at 0x8002830
来自 Reset_Handler() 的几行,顺便说一句,我认为箭头显示错误的行,因为堆栈显示 __libc_init_array().
Reset_Handler:
...
08002806: cmp r2, r3
08002808: bcc.n 0x80027fe <Reset_Handler+30>
0800280a: bl 0x8000128 <SystemInit>
0800280e: bl 0x8002834 <__libc_init_array>
-> 08002812: bl 0x80027d8 <main>
...
对于 __libc_init_array(),我希望箭头显示的是正确的行,而不是显示错误的下一行。
__libc_init_array:
08002834: eors r0, r6
-> 08002836: stmdb sp!, {r2, r3, r5, r6, sp, lr}
0800283a: b.n 0x800237c <SPIx_Write+8>
0800283c: str r4, [r5, r1]
...
对于WWDG_IRQHandler(),这并不重要,但post无论如何
WWDG_IRQHandler:
-> 08002830: b.n 0x8002830 <WWDG_IRQHandler>
08002832: movs r0, r0
我的“c”代码只包含include(未达到主要功能):
#include <stm32l0538_discovery.h>
#include <sys/types.h>
eclipse上的配置,我没有使用任何插件,我设置为:
C/C++ Build
|
|_Cross Settings
| |_Prefix : arm-none-eabi-
| \_Path : /.../gcc-arm-none-eabi-7-2017-q4-major/bin
|
|_Cross Gcc Compiler
| |_Command : gcc
| |_All Options : -nostdinc
| | -I/.../gcc-arm-none-eabi-7-2017-q4-major/lib/gcc/arm-none-eabi/7.2.1/include
| | -I/.../gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include
| | -I/.../STM32Cube_FW_L0_V1.10.0/Drivers/BSP/STM32L0538-Discovery
| | -I/.../STM32Cube_FW_L0_V1.10.0/Drivers/CMSIS/Include
| | -I/.../STM32Cube_FW_L0_V1.10.0/Drivers/STM32L0xx_HAL_Driver/Inc
| | -I/.../STM32Cube_FW_L0_V1.10.0/Drivers/CMSIS/Device/ST/STM32L0xx/Include
| | -Os
| | -g3
| | -Wall
| | -Wextra
| | -mcpu=cortex-m0plus
| | -march=armv6s-m
| | -mlittle-endian
| | -mthumb
| | -DSTM32L053xx
| | -c
| | -v
| \_Command line pattern : ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
|
|_Cross Gcc Linker
| |_command : gcc
| |_All Options : -static
| | -L/.../gcc-arm-none-eabi-7-2017-q4-major/
| | -L/.../gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/lib
| | -L/.../gcc-arm-none-eabi-7-2017-q4-major/lib
| | -L/.../gcc-arm-none-eabi-7-2017-q4-major/lib/gcc/arm-none-eabi/7.2.1
| | -mcpu=cortex-m0plus
| | -march=armv6s-m
| | -mlittle-endian
| | -mthumb
| | -DSTM32L053xx
| | -T/.../STM32Cube_FW_L0_V1.10.0/Projects/STM32L053C8-Discovery/Templates/TrueSTUDIO/STM32L053C8_Discovery/STM32L053C8_FLASH.ld
| | -Wl,--gc-sections
| | -Os
| \_Command line pattern: ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
|
\_Cross GCC Assembler
|_command : as
|_all options: /*blank*/
\_Command line pattern : ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
在 LD 文件中,我只看到两件事可能很有趣,我没有对整个文件进行 CP :
/* Entry Point */
ENTRY(Reset_Handler)
...
/* Remove information from the standard libraries */
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
...
启动是ST提供的,在gogole上很容易恢复,像这个文件:
https://github.com/AndiceLabs/STM32L053R8-Nucleo/blob/master/Drivers/CMSIS/Device/ST/STM32L0xx/Source/Templates/gcc/startup_stm32l053xx.s
除了第 151 行被我设置为 0,当然第 205/206 行不在我的文件中。
我不是 libc 和设置环境的高手,我尝试了很多东西,比如(不)检查“nostdlibs”、“nostartfiles”或“nodefaultlibs”。但它总是导致编译失败。
我真的不知道尝试什么,请为我指明道路! 谢谢!
吉布兹
经过一些研究,我确定这不是与堆栈指针 SP 相关的问题。
回到代码:
__libc_init_array:
08002834: eors r0, r6
-> 08002836: stmdb sp!, {r2, r3, r5, r6, sp, lr}
0800283a: b.n 0x800237c <SPIx_Write+8>
0800283c: str r4, [r5, r1]
...
Regarding the instruction set from different cortex (M0 to M4F)cortex-M0的指令集中不包含STMDB指令,cortex-M0+只有STM指令(白色第三列,第10行为STM,蓝色第一列, STMDB 的第 17 行)。
GNU Arm Embedded Toolchain (https://developer.arm.com/open-source/gnu-toolchain/gnu-rm) 的页面上写着支持 Cortex-M0(+),所以我猜是 C 库。在其他网站上,他们建议测试 gcc 多库,我试了一下:
[jibz@Jazptop bin]$ ./arm-none-eabi-gcc --print-multi-lib
.;
thumb;@mthumb
hard;@mfloat-abi=hard
thumb/v6-m;@mthumb@march=armv6s-m
thumb/v7-m;@mthumb@march=armv7-m
thumb/v7e-m;@mthumb@march=armv7e-m
thumb/v7-ar;@mthumb@march=armv7
thumb/v8-m.base;@mthumb@march=armv8-m.base
thumb/v8-m.main;@mthumb@march=armv8-m.main
thumb/v7e-m/fpv4-sp/softfp;@mthumb@march=armv7e-m@mfpu=fpv4-sp-d16@mfloat-abi=softfp
thumb/v7e-m/fpv4-sp/hard;@mthumb@march=armv7e-m@mfpu=fpv4-sp-d16@mfloat-abi=hard
thumb/v7e-m/fpv5/softfp;@mthumb@march=armv7e-m@mfpu=fpv5-d16@mfloat-abi=softfp
thumb/v7e-m/fpv5/hard;@mthumb@march=armv7e-m@mfpu=fpv5-d16@mfloat-abi=hard
thumb/v7-ar/fpv3/softfp;@mthumb@march=armv7@mfpu=vfpv3-d16@mfloat-abi=softfp
thumb/v7-ar/fpv3/hard;@mthumb@march=armv7@mfpu=vfpv3-d16@mfloat-abi=hard
thumb/v8-m.main/fpv5-sp/softfp;@mthumb@march=armv8-m.main@mfpu=fpv5-sp-d16@mfloat-abi=softfp
thumb/v8-m.main/fpv5-sp/hard;@mthumb@march=armv8-m.main@mfpu=fpv5-sp-d16@mfloat-abi=hard
thumb/v8-m.main/fpv5/softfp;@mthumb@march=armv8-m.main@mfpu=fpv5-d16@mfloat-abi=softfp
thumb/v8-m.main/fpv5/hard;@mthumb@march=armv8-m.main@mfpu=fpv5-d16@mfloat-abi=hard
我相信它已安装,因为 Cortex-M0+ 在架构 ARMv6-M 上。但是结果显示ARMv6s-M,它改变了什么吗?
不管怎样,我还是不知道如何获得正确的libc。
08002836: stmdb sp!, {r2, r3, r5, r6, sp, lr}
这可能是您第一次实际上在您的代码中使用堆栈。一些链接器脚本没有正确对齐堆栈,因此您可能会在该指令中遇到(硬)错误。检查调试器中的 SP
寄存器值。
除非您在源代码中设置自己的故障处理程序,否则将设置一些默认处理程序,看起来完全 类似于您的WWDG_IRQHandler
。
compiler/linker 对 all undefiend IRQ 和错误处理程序使用相同的函数 - 这会阻止您正确识别发生的实际错误。
已解决!!
我找到了 armv6 的 libc.a,更改了一些链接器选项并添加了路径,这里是我的链接器配置:
C/C++ Build
|
|_Cross Settings
|
|_Cross Gcc Compiler
|
|_Cross Gcc Linker
| |_command : gcc
| |_All Options : -static
| | => -L/.../gcc-arm-none-eabi-7-2017-q4-major/lib/gcc/arm-none-eabi/7.2.1/thumb/v6-m/
| | => -L/.../gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/lib/thumb/v6-m/
| | -L/.../gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/lib
| | -L/.../gcc-arm-none-eabi-7-2017-q4-major/lib
| | -L/.../gcc-arm-none-eabi-7-2017-q4-major/lib/gcc/arm-none-eabi/7.2.1
| | -mcpu=cortex-m0plus
| | -march=armv6s-m
| | -mlittle-endian
| | -mthumb
| | -T/.../STM32Cube_FW_L0_V1.10.0/Projects/STM32L053C8-Discovery/Templates/TrueSTUDIO/STM32L053C8_Discovery/STM32L053C8_FLASH.ld
| | -Wl,--gc-sections
| | -Os
| \_Command line pattern: ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
|
\_Cross GCC Assembler
感谢 Turbo J 的到来和帮助,
吉布兹
在与某人写完之后,他向我展示了我在配置中犯的错误,所以我 post 这里(再次)配置 :
|_Cross Settings : Prefix : arm-none-eabi-
| Path : ${GccPath}/bin
|
|_Cross Gcc Compiler : command : gcc
| |_Preprocessor : uncheck "Do not search system directories(-nostdinc)",
| | I believed that I will search in the native system x64
| | machin, but no, it just means that it will search in
| | the GCC folder.
| | -D STM32L053xx :needed to use some code provided by ST
| |_Includes : removing all references of path to /gcc/*/include because
| | now they are included without the -nostdinc option.
| | -I ${DriversPath}/BSP/STM32L0538-Discovery
| | -I ${DriversPath}/CMSIS/Include
| | -I ${DriversPath}/STM32L0xx_HAL_Driver/Inc
| | -I ${DriversPath}/CMSIS/Device/ST/STM32L053xx/Include
| |_Optimization : Optimization level : Optimization for size (-Os)
| |_Debugging : Debug Level : Maximum (-g3)
| |_Warnings : All Warnings (-Wall)
| | Extra warnings (-Wextra)
| \_Miscellaneous : -mcpu=cortex-m0plus : with march, GCC will know which lib it should use, and not using the first found in the paths provided previously with the linker option -L.
| -march=armv6s-m
| -mlittle-endian
| -mthumb
| -c
| -ffunction-sections : it permits to remove not necessary code
| -fdata-sections : it permits to remove not necessary data.
| -v (Verbose)
|
\_Cross GCC Linker : command : gcc
|_general : No shared libraries (-static)
|_Libraries : it should stay blank, I removed all -L options.
\_Miscellaneous : -mcpu=cortex-m0plus
-mtune=cortex-m0plus :Actually, I believe it is just an optimization for **that** cpu.
-march=armv6s-m
-mlittle-endian
-mthumb
-T${ProjDirPath}/LinkerScripts/STM32L053C8_FLASH.ld
-Wl,-Map=${ProjDirPath}/Logs/Pluviographe.map : The map file is a kind of log, showing links between elements.
-Wl,-gc-sections : It removes some unused code, provided by the -ffunctions-sections and -fdata-sections from the compiler.
代码中可能还有 "small" 个错误,但更干净了。