/* This collects all other stuff, which gets loaded into FLASH */
.code_constants_etc :
{
*(EXCLUDE_FILE(*b_loader.o) .text .text* .rodata .rodata* .data .data* )
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
_e_code_constants_etc = .; /* define a global symbol at end of code */
} >FLASH_APP.b_loader_all :
{
. = ALIGN(4);
_loader_ram_start = .;
KEEP(*(.b_loader))
*b_loader.o (.text .text* .rodata .rodata* .data .data*)
. = ALIGN(4);
_loader_ram_end = .;
} >RAM AT>FLASH_BOOT
_loader_flash_start = LOADADDR(.b_loader_all);
This includes .text*, .rodata*, and .data* from all files except *b_loader.o, and then aligns to a 32-byte boundary. Then,Code: [Select]/* This collects all other stuff, which gets loaded into FLASH */
.code_constants_etc :
{
*(EXCLUDE_FILE(*b_loader.o) .text .text* .rodata .rodata* .data .data* )
. = ALIGN(4);
includes the same from the excluded *b_loader.o.Code: [Select]*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
Right; I get that, but I tried the exclude after the other stuff too.Thing is, you only need the exclude. For example (https://sourceware.org/binutils/docs/ld/Input-Section-Basics.html#index-EXCLUDE_005fFILE),
This LD thing was written for real men, and probably the reason for the totally crap usability is because most people set it up once and never touch it again. And avoid touching it at all costs.
Some of that is just bizarre but I guess it has its uses.Domain-specific languages with a tiny set of users do tend to be, yeah.
My project has been as simple as I could get it:I can't parse your description well enough to arrive to an actual memory map. You need that spreadsheet or a diagram!
| Memory region | Output section | Overlay | Linker symbol | Address | Description |
| FLASH | __flash_start | 0x08000000 | |||
| .boot_init | Executable in place, VMA=LMA | ||||
| .boot_loader_src | LMA, VMA=.boot_loader | ||||
| .fastrun_src | LMA, VMA=.fastrun, for RAM code | ||||
| .text | Executable in place, VMA=LMA | ||||
| RAM | __ram_start | 0x02000000 | |||
| .fastrun | RAM1 | LMA, VMA=.fastrun_src, copied by foo() in .boot_init | |||
| .boot_loader | RAM1 | VMA, LMA=.boot_loader_src, copied by bar() in .boot_init | |||
| CCM | __ccm_start | 0x01000000 |
Back to basics, why do C compilers generate sensible error messages? Real men need just "syntax error" and possibly, at a stretch, a line number. They go down with the ship while saluting the queen. This LD thing was written for real men, and probably the reason for the totally crap usability is because most people set it up once and never touch it again. And avoid touching it at all costs.It's not that bad.
my personal opinion is that the GNU linker script is not very friendly because it is not well designed for the common user as it requires a lot of specific knowledge and competence, and I address the defect to the fact that designing things that look easy to be used requires more effort, which is not a GNU priority.Yes, but it's not just GNU, it is in all free/open source software, because designing things for others to use is much harder than designing things for oneself to use. In general, user-friendly design takes a lot of effort.