Comment 9 for bug 1697255

Revision history for this message
necwerk (m8r-njfnr31) wrote :

before and after the strip command:

+ arm-none-eabi-objdump -t applet.elf

applet.elf: file format elf32-littlearm

SYMBOL TABLE:
08000000 l d .text 00000000 .text
08000040 l d .rodata 00000000 .rodata
00000000 l d .comment 00000000 .comment
00000000 l d .ARM.attributes 00000000 .ARM.attributes
00000000 l df *ABS* 00000000 main.c
00000000 l df *ABS* 00000000 test1.c
08000038 l F .text 00000008 __test2_veneer
0801004e g .rodata 00000000 _bss_end__
0801004e g .rodata 00000000 __bss_start__
0800001c g F .text 00000016 test1
0801004e g .rodata 00000000 __bss_end__
0801004e g .rodata 00000000 __bss_start
08000000 g F .text 0000001c main
08010050 g .rodata 00000000 __end__
f0000000 g *ABS* 00000000 test2
0801004e g .rodata 00000000 _edata
08010050 g .rodata 00000000 _end
00080000 g .ARM.attributes 00000000 _stack
0801004e g .rodata 00000000 __data_start

+ arm-none-eabi-strip '--remove-section=*ABS*' -w -K '*' applet.elf
+ arm-none-eabi-objdump -t applet.elf

applet.elf: file format elf32-littlearm

SYMBOL TABLE:
08000000 l d .text 00000000 .text
08000040 l d .rodata 00000000 .rodata
00000000 l d .comment 00000000 .comment
00000000 l d .ARM.attributes 00000000 .ARM.attributes
08000038 l F .text 00000008 __test2_veneer
0801004e g .rodata 00000000 _bss_end__
0801004e g .rodata 00000000 __bss_start__
0800001c g F .text 00000016 test1
0801004e g .rodata 00000000 __bss_end__
0801004e g .rodata 00000000 __bss_start
08000000 g F .text 0000001c main
08010050 g .rodata 00000000 __end__
0801004e g .rodata 00000000 _edata
08010050 g .rodata 00000000 _end
00080000 g .ARM.attributes 00000000 _stack
0801004e g .rodata 00000000 __data_start

so in short. if the symbols imported from a symbols file specified at --just-symbols argument the linked output is fine. the problem is if the linker use a symbol from other elf file and that symbol is originally imported from an other symbol file.

Anyways I think the most important problem is that the linker want to switch to ARM instruction mode on an cortex m4 which is a totally invalid thing.