Libc_nano.a (10.2.1) has Arm CODE instead of THUMB code for strlcpyCODE FOR
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
New
|
Undecided
|
Unassigned |
Bug Description
Version 10.2.1 seems to have the wrong compile flags for strlcpy:
As can be seen from the clip out of the map file and disassembled elf files, the same library contains two different types of code.
c:/program files (x86)/gnu arm embedded toolchain/10 2020-q4-
c:/program files (x86)/gnu arm embedded toolchain/10 2020-q4-
00001cb0 <strlcpy>:
1cb0: e3520000 cmp r2, #0
1cb4: e1a03001 mov r3, r1
1cb8: 0a00000a beq 1ce8 <strlcpy+0x38>
1cbc: e2522001 subs r2, r2, #1
1cc0: 0a000006 beq 1ce0 <strlcpy+0x30>
1cc4: e4d3c001 ldrb ip, [r3], #1
1cc8: e35c0000 cmp ip, #0
1ccc: e4c0c001 strb ip, [r0], #1
1cd0: 1afffff9 bne 1cbc <strlcpy+0xc>
1cd4: e0430001 sub r0, r3, r1
1cd8: e2400001 sub r0, r0, #1
1cdc: e12fff1e bx lr
1ce0: e3a02000 mov r2, #0
1ce4: e5c02000 strb r2, [r0]
1ce8: e4d32001 ldrb r2, [r3], #1
1cec: e3520000 cmp r2, #0
1cf0: 1afffffc bne 1ce8 <strlcpy+0x38>
1cf4: eafffff6 b 1cd4 <strlcpy+0x24>
00001cf8 <strlen>:
1cf8: 2300 movs r3, #0
1cfa: 5cc2 ldrb r2, [r0, r3]
1cfc: 3301 adds r3, #1
1cfe: 2a00 cmp r2, #0
1d00: d1fb bne.n 1cfa <strlen+0x2>
1d02: 1e58 subs r0, r3, #1
1d04: 4770 bx lr
1d06: Address 0x00001d06 is out of bounds.