tests/cortexm_common_ldscript: update code section for kinetis#11588
Conversation
Update the 'code' section detection to also work on kinetis. The boards using 'cortexm.ld' have the code section starting with '.text'. For the 'cpu/kinetis/kinetis.ls' the first section is '.vector'. Update the 'awk' matching pattern to correctly detect the kinetis boards. It is a dependency to allow testing upcoming offset support with kinetis. I am not 100% sure about the pattern for awk.
fjmolinas
left a comment
There was a problem hiding this comment.
Tested for some kinetis boards: frdm-kw41z pba-d-01-kw2x.
Can you add them to the whitelist? at least frdm-kw41z since riotboot should be soon supported. Also l1 and l0 boards pass the test but aren't white listed.
|
@fjmolinas it currently does not work for It is also shown in my testing procedure. |
|
@cladmi you are right, should be in the next one. I was jumping a step. |
|
|
|
@fjmolinas Because I do not know about how to write patterns for But I can remove it, I wrote it so the pattern gets a second look. |
| # * [ 1] .text PROGBITS 08001000 001000 001ef8 ... | ||
| # * [ 1] .vector PROGBITS 00001000 001000 000400 ... | ||
| # So match with the section [ 1] being `PROGBITS`. Adapt if new cases appear. | ||
| CODE_SECTION = \[ 1\] \.[a-zA-Z_.]* *PROGBITS |
There was a problem hiding this comment.
[a-zA-Z_.] Do sections have "." in the middle of their names? you are already matching the one leading the section name.
There was a problem hiding this comment.
I used the output of for an iotlab-m3 as example:
And .ARM.attributes has one.
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .text PROGBITS 08001000 001000 001ed0 00 AX 0 0 4
[ 2] .stack NOBITS 20000000 020000 000200 00 WA 0 0 1
readelf: Warning: [ 3]: Link field (0) should index a symtab section.
[ 3] .relocate REL 20000200 010200 000078 08 WA 0 0 4
[ 4] .noinit PROGBITS 20000278 010278 000000 00 W 0 0 1
[ 5] .bss NOBITS 20000278 010278 0007fc 00 WA 0 0 4
[ 6] .debug_info PROGBITS 00000000 010278 016389 00 0 0 1
[ 7] .debug_abbrev PROGBITS 00000000 026601 00378e 00 0 0 1
[ 8] .debug_aranges PROGBITS 00000000 029d8f 000558 00 0 0 1
[ 9] .debug_ranges PROGBITS 00000000 02a2e7 0005e8 00 0 0 1
[10] .debug_macro PROGBITS 00000000 02a8cf 01e43a 00 0 0 1
[11] .debug_line PROGBITS 00000000 048d09 009a70 00 0 0 1
[12] .debug_str PROGBITS 00000000 052779 03e32e 01 MS 0 0 1
[13] .comment PROGBITS 00000000 090aa7 00007f 01 MS 0 0 1
[14] .ARM.attributes ARM_ATTRIBUTES 00000000 090b26 000033 00 0 0 1
[15] .debug_frame PROGBITS 00000000 090b5c 00105c 00 0 0 4
[16] .debug_loc PROGBITS 00000000 091bb8 001a2d 00 0 0 1
[17] .symtab SYMTAB 00000000 0935e8 001d90 10 18 271 4
[18] .strtab STRTAB 00000000 095378 000c0a 00 0 0 1
[19] .shstrtab STRTAB 00000000 095f82 0000cb 00 0 0 1
|
Ok, I keep my warning then :) |
|
Thank you for the review. |
Contribution description
Update the 'code' section detection to also work on kinetis.
The boards using 'cortexm.ld' have the code section starting with
'.text'. For the 'cpu/kinetis/kinetis.ls' the first section is '.vector'.
Update the 'awk' matching pattern to correctly detect the kinetis boards.
It is a dependency to allow testing upcoming offset support with kinetis.
I am not 100% sure about the pattern for awk.
Testing procedure
All the currently supported boards still work. It will be tested by
CIduring compilation (no need to run tests).You can also run the test for
samr21-xprooriotlab-m3if you want.For the
frdm-kw41zthe test fails with only this pull request but works with #11562 . However the address of0x0000is currently detected and fails as expected.With
masterit was detecting0x410which was not the base of the whole code section as it starts with.vector/.fcfield/.text.Issues/PRs references
Part of #11562