你好!我试图使用 std::string 但它给了我一堆链接器错误(对 _sbrk_r、_fstat_r、_read_r、_lseek_r、_write_r、_close_r、_open_r 的未定义引用)。我为这些功能制作了原型,之后链接器不再抱怨,但还有另一个问题。我有“‘.text’部分不适合区域‘iram1_0_seg’”。
我使用的代码来自这里: https:
//github.com/CHERTS/esp8266-devki ... r_main.cpp我刚刚添加了一个 std::string 变量。添加 std::string 变量之前的内存映射:
代码:
全选------------------------------------------------------------------------------
Sec
tion info:
build/app.out: file format elf32-xtensa-le
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000540 3ffe8000 3ffe8000 000000e0 2**4
CONTENTS, ALLOC, LOAD, DATA
1 .rodata 000004e8 3ffe8540 3ffe8540 00000620 2**4
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00009200 3ffe8a28 3ffe8a28 00000b08 2**4
ALLOC
3 .text 00006522 40100000 40100000 00000b08 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
4 .irom0.text 00029898 40240000 40240000 00007030 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
------------------------------------------------------------------------------
添加 std::string 变量后的内存映射
代码:
全选------------------------------------------------------------------------------
Section info:
build/app.out: file format elf32-xtensa-le
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000d88 3ffe8000 3ffe8000 000000e0 2**4
CONTENTS, ALLOC, LOAD, DATA
1 .rodata 00004e78 3ffe8d90 3ffe8d90 00000e70 2**4
CONTENTS, ALLOC, LOAD, DATA
39 .bss 00009be8 3ffede10 3ffede10 00005ef0 2**4
ALLOC
40 .text 00013666 40100000 40100000 00005ef0 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
41 .irom0.text 00029898 40240000 40240000 00019560 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
------------------------------------------------------------------------------