Segger embedded Studio linker

command line options

Extracted from UM0005_LINKER aka UM20005_Linker.pdf

 Found the Segger documentaion very disappoointing since it does not offer any descriptions.
For example: SEGGER Linker A linker for Arm and RISC-V microcontrollers User Guide & Reference Manual Document: UM20005 Software Version: 4.24.1 Revision: 0 Date: January 19, 2022 I have provided these notes mostly for my own use so I could better understand hwat the options mean.

The original document is included in the download of the Segger system. These notes are totally uinintelagable without the UM20005 document.

Only the long name option is given here since it is unreasonable to expect to enter a linker script which be made easier by having short options.

Either all hyphens between words (e.g. --no-unwind- tables) or with all underscores between words (e.g. --no_unwind_tables).\\ Option in the keyword=value not keyword value format. Deprecated options are not included --script=filename multiple occurances will be combined --via=filename additional options and input files --bare --no-sections eliminates all debug information, the symbol table, and the string table from the ELF file, and also removes the section table. === --no-debug and --no-symbols. --block-section-headers ELF file containing minimal section information --nodebug include debug input sections from the input and includes the symbol table and string table --entry=name Sets the entry point --force-output even if errors --full-section-headers --minimal-section-headers --output filename.elf --strip remove debug info === --no-debug and --no-symbols. --symbols include symbol table map options --map-file filename --map-compact --map-modules -symbols -summary --no-map-script -placement, -module-detail, -section-detail, -init-table, -unused, -veneers -exceptions, -listing, -optimization-report --map-standard --map-modules, -section-detail, -symbols, -summary --no-map-script, -placement, -module-detail, -unused, -init-table, -veneers, -exceptions, -listing, -optimization-report --map-detailed (sic) --map-compact --map-placement, -modules, -module-detail, -section-detail, -init-table -exceptions, -symbols, -optimization-report, -summary, -no-map-script, -veneers, -listing, -optimization-report --map-full --map-all --map-placement, -modules, -module-detail, -section-detail, -summary, -script, -init-table, -exceptions, -veneers, -symbols, -listing, -optimization-report, --map-html (neat?) --map-narrow --map-wide, ---no-map-wrap When text within a column exceeds the column width, the linker wraps following columns to a new line and maintains column alignment. no : the text is truncated --map-addr-format=n (lc|uc) (|0x|0) (|0…) (nobreak|') 0x0000001a 0x00001a2b 0x001a2b3c 0x1a2b3c4d 4 x 4 0 1a lc 1a2b nobreak 1a2b3c 1a2b3c4d 1 1A UC 1A2B 1A2B3C 1A2B3C4D with break 2 1a 1a2b 1a'2b3c 1a2b'3c4d 3 1A 1A2B 1A'2B3C 1A2B'3C4D UC, noprefix,no … ' (break) 0x prefix no break 4 0x1a 0x1a2b 0x1a2b3c 0x1a2b3c4d 5 0x1A 0x1A2B 0x1A2B3C 0x1A2B3C4D with break 6 0x1a 0x1a2b 0x1a'2b3c 0x1a2b'3c4d 7 0x1A 0x1A2B 0x1A'2B3C 0x1A2B'3C4D 0prefix 0 fill 8 0000001a 9 0000001A with break 10 0000'001a 11 0000'001A 12 0x0000001a 13 0x0000001A default UC,0x, 0…, nobresak 14 0x0000'001a 15 0x0000'001A The default setting is 13. --map-size-format=value (lc|UC) (hex|Dec) (|thousands space|4digit') Format 90 23148 5926013 1517058956 really big how often is this gping to occur 0 0x5a 0x5a6c 0x5a6c7d 0x5a6c7b8c 1 0x5a 0x5a6c 0x5a'6c7d 0x5a6c'7b8c 2 0x5A 0x5A6C 0x5A6C7D 0x5A6C7B8c 3 0x5A 0x5A6C 0x5A'6C7D 0x5A6'C7B8C 4 90 23148 5926013 1517058956 5 90 23 148 5 926 013 1 517 058 956 dec split The default setting is 5. --map-exception-table Sections with section optimization ordering imposed: (see UM) --map-init-table INITALIZATION TABLE Zero (__SEGGER_init_zero) 1 destination range, total size 0xa5 [0x1fff0444 to 0x1fff04e8] Copy packing=copy (__SEGGER_init_copy) 1 source range, total size 0x44 (100% of destination) [0x00000fd0 to 0x00001013] 1 destination range, total size 0x44 [0x1fff0400 to 0x1fff0443] Copy packing=copy (__SEGGER_init_copy) 1 source range, total size 0x10 (100% of destination) [0x00001014 to 0x00001023] 1 destination range, total size 0x10 [0x1fff04ea to 0x1fff04f9] Totals Table size: 0x30 bytes Image size: 0x54 bytes --map-listing (traditional assembly listing) ABSOLUTE LISTING ; Section .init from thumb_crt0.o, alignment 4 ; _start: 0x0000051C 4924 LDR R1, [PC, #0x90] 0x0000051E 4825 LDR R0, [PC, #0x94] --map-listing-with-comments target address of a branch, effective address and any data loaded by the instruction --map-listing-with-data with ABSOLUTE LISTING ; Section .rodata.MainTask.str1.4 from Start_Zynq7007s_emPower.o, size=16, align=4 .LC1: 0xFC019BF0 4C DCB 0x4C ; Section .rodata.OS_L2CACHE_XilinxZynq7000 from Start_Zynq7007s_emPower.o, size=24, align=4 ; OS_L2CACHE_XilinxZynq7000: 0xFC019BF8 6D8601FC DC32 0xFC01866D --map-listing-use-adr-pseudo ADD Rd, PC, #imm shown using pseudo-instruction ADR Rd, addr. --map-listing-use-ldr-pseudo LDR Rd, [PC, #offs] shown using pseudo-instruction LDR Rd, =data --map-listing-xref with ABSOLUTE LISTINg --map-modules Memory use by input file: Object File RX Code RO Data RW Data ZI Data --------------------------------------------- ---------- ---------- ---------- ---------- Cortex_M_Startup.o SEGGER_Linker_Support.o SEGGER_THUMB_Startup.o bench-fp-math-speed-accuracy.o --------------------------------------------- ---------- ---------- ---------- ---------- Subtotal (objects): 1 482 354 759 96 --------------------------------------------- ---------- ---------- ---------- ---------- x-libc_v7m_t_le_eabi_small_swc_ienum.a 6 880 176 x-libio_v7m_t_le_eabi_small_swc_ienum.a 80 9 --------------------------------------------- ---------- ---------- ---------- ---------- Subtotal (archives): 6 960 185 --------------------------------------------- ---------- ---------- ---------- ---------- Linker created (init + veneers + exceptions): 36 4 096 ============================================= ========== ========== ========== ========== Grand total: 8 442 354 980 4 192 ============================================= ========== ========== ========== ========== Detailed memory use by individual object file: Object File RX Code RO Data RW Data ZI Data --------------------------------------------- ---------- ---------- ---------- ---------- [ Linker created ] ============================================= ========== ========== ========== ========== Total: 8 442 354 980 4 192 ============================================= ========== ========== ========== ========== --map-module-detail Module BSP.o: Section Code RO Data RW Data ZI Data --------------------------------------------- -------- -------- -------- -------- .text.BSP_Init .text.BSP_SetLED .BootHeader .bss._LEDState ============================================= ======== ======== ======== ======== Total: 232 2240 4 ============================================= ======== ======== ======== ======== Module BSP_FPGA.o: Section Code RO Data RW Data ZI Data --------------------------------------------- -------- -------- -------- -------- .text.BSP_FPGA_Init .text._SendFPGAConfigData .rodata._aFPGAData .bss._PLCfgByteCnt .bss._FPGAConfigNumBytesInBuf .bss._acPLCfgBuff ============================================= ======== ======== ======== ======== Total: 692 94978 72 ============================================= ======== ======== ======== ======== ...more modules... All modules: Code RO Data RW Data ZI Data ============================================= ======== ======== ======== ======== Grand total: 9292 99181 4 21523 ============================================= ======== ======== ======== ======== --map-optimization-report Transformation Bytes saved ----------------------- ------------ Dedupe code Dedupe data Function inlining Jump threading Tail-call merging ======================= ============ Total: 22 410 --map-placement place at 0x00000000 Section ------- .vectors Type Address ---- ------- Code 00000000 Size Object ---- ------ 0x410 MK66F18_Vectors.o *** PLACEMENT SUMMARY *** *** "RAM": place in [0x1fff0000 to 0x1fffffff] | [0x20000000 to 0x2002ffff] Section Type Address ------- ---- ------- .data.OS_Global Init 1fff0400 .data.x Init 1fff0440 .bss..L_MergedGlobals Zero 1fff0444 .bss.OS_pTickHookRoot Zero 1fff0450 .bss.OS_pMainContext Zero 1fff0454 ...more sections... "FLASH": place in [0x00000000 to 0x001fffff] Section Type Address ------- ---- ------- .init Code 00000410 .init Code 00000454 .init Code 0000051c .rodata.OS_JLINKMEM_BufferSize Cnst 000005e8 .text Code 000005ec .text.libc._execute_at_exit_fns Code 000007b4 .text.libc.memcpy Code 000007dc .text.main Code 00000830 ...more sections... Size Object ---- ------ 0x40 OS_Global.o (OS.a) 0x4 Main.o 0xc BSP_IP.o 0x4 OS_Global.o (OS.a) 0x4 OS_Global.o (OS.a) Size Object ---- ------ 0x44 Kinetis_K60_Startup.o 0xc8 MK66F18_Vectors.o 0xcc thumb_crt0.o 0x4 RTOSInit_K66F_CMSIS.o 0x198 RTOS.o (OS.a) 0x28 libc2.o (libc_v7em_fpv4_sp... 0x54 libc2_asm.o (libc_v7em_fpv... 0x1c Main.o --map-script listing of input script