Hallo,
Ich hab gerade die Link Time Optimizations ausprobiert und bekomme zwar
eine Ausgabedatei, die enthält aber scheinbar keinen Code.
Mit -flto:
1 | Section Headers:
|
2 | [Nr] Name Type Addr Off Size ES Flg Lk Inf Al
|
3 | [ 0] NULL 00000000 000000 000000 00 0 0 0
|
4 | [ 1] .text PROGBITS 00000000 010000 000000 00 AX 0 0 4
|
5 | readelf: Warning: [ 2]: Link field (0) should index a symtab section.
|
6 | readelf: Warning: [ 2]: Info field (0) should index a relocatable section.
|
7 | [ 2] .relocate REL 20000000 010000 000000 08 W 0 0 1
|
8 | [ 3] .bss NOBITS 20000000 000000 000000 00 WA 0 0 1
|
9 | [ 4] .symtab SYMTAB 00000000 010000 000140 10 5 4 4
|
10 | [ 5] .strtab STRTAB 00000000 010140 0000c7 00 0 0 1
|
11 | [ 6] .shstrtab STRTAB 00000000 010207 000030 00 0 0 1
|
Ohne -flto:
1 | [Nr] Name Type Addr Off Size ES Flg Lk Inf Al
|
2 | [ 0] NULL 00000000 000000 000000 00 0 0 0
|
3 | [ 1] .text PROGBITS 00000000 010000 00050c 00 AX 0 0 4
|
4 | readelf: Warning: [ 2]: Link field (0) should index a symtab section.
|
5 | readelf: Warning: [ 2]: Info field (0) should index a relocatable section.
|
6 | [ 2] .relocate REL 20000000 01050c 000000 08 W 0 0 1
|
7 | [ 3] .bss NOBITS 20000000 000000 000000 00 WA 0 0 1
|
8 | [ 4] .debug_info PROGBITS 00000000 01050c 009a02 00 0 0 1
|
9 | [ 5] .debug_abbrev PROGBITS 00000000 019f0e 000b69 00 0 0 1
|
10 | [ 6] .debug_loc PROGBITS 00000000 01aa77 000233 00 0 0 1
|
11 | [ 7] .debug_aranges PROGBITS 00000000 01acaa 0000f8 00 0 0 1
|
12 | [ 8] .debug_ranges PROGBITS 00000000 01ada2 000108 00 0 0 1
|
13 | [ 9] .debug_macro PROGBITS 00000000 01aeaa 00bc22 00 0 0 1
|
14 | [10] .debug_line PROGBITS 00000000 026acc 001dbc 00 0 0 1
|
15 | [11] .debug_str PROGBITS 00000000 028888 047244 01 MS 0 0 1
|
16 | [12] .comment PROGBITS 00000000 06facc 00002a 01 MS 0 0 1
|
17 | [13] .ARM.attributes ARM_ATTRIBUTES 00000000 06faf6 00002b 00 0 0 1
|
18 | [14] .debug_frame PROGBITS 00000000 06fb24 000198 00 0 0 4
|
19 | [15] .symtab SYMTAB 00000000 06fcbc 000690 10 16 47 4
|
20 | [16] .strtab STRTAB 00000000 07034c 000341 00 0 0 1
|
21 | [17] .shstrtab STRTAB 00000000 07068d 0000bc 00 0 0 1
|
Der gcc hat die Version 8.1.0
Aufgerufen wird er mit:
1 | arm-cortexm-eabi-gcc -g3 -O2 -ffunction-sections -fdata-sections -Wl,--gc-sections -nostdlib -marm -I./include/cmsis -mlittle-endian -mthumb -I./include/samd20 -mcpu=cortex-m0plus -mfloat-abi=soft -D__SAMD20J14__ -Wl,"-Tsamd20j14a_flash.ld" -Wall -o servo.elf main.c startup_samd20.c clock.c servo.c uart-samd20.c
|
Oder eben mit "-flto"
Im Anhang habe ich noch die Linkerkommandos.