[C++] Using std::string
Posted: Tue Aug 11, 2015 5:31 am
Hi! I was trying to use std::string but it gave me a bunch of linker errors (undefined reference to _sbrk_r, _fstat_r, _read_r, _lseek_r, _write_r, _close_r, _open_r). I made prototypes for those functions and after that linker doesn't complain any more but there is another problem. I've got "section `.text' will not fit in region `iram1_0_seg'".
The code that i'm using is from here: https://github.com/CHERTS/esp8266-devki ... r_main.cpp
I just added one std::string variable.
Memory map before adding std::string variable:
Memory map after adding std::string variable
(i resized iram section in .ld script to see how much space it takes, without this it doesn't compile)
Is there any possibility of using std::string?
The code that i'm using is from here: https://github.com/CHERTS/esp8266-devki ... r_main.cpp
I just added one std::string variable.
Memory map before adding std::string variable:
Code: Select all
------------------------------------------------------------------------------
Section 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
------------------------------------------------------------------------------
Memory map after adding std::string variable
Code: Select all
------------------------------------------------------------------------------
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
------------------------------------------------------------------------------
(i resized iram section in .ld script to see how much space it takes, without this it doesn't compile)
Is there any possibility of using std::string?