espressif / esp-gdbstub

Other
159 stars 38 forks source link

gdbstub linking will not fit in iram1_0_seg #2

Open nkolban opened 8 years ago

nkolban commented 8 years ago

I have downloaded the esp-gdbstub repository, compiled the sources and placed them in an archive. When I now try and link the gdbstub archive with me simple C application, I find that I get the error:

a.out section '.text' will not fit in region 'iram1_0_seg'

Running objdump -h over the archive produces the following:

gdbstub.o:     file format elf32-xtensa-le

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .literal      00000000  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .irom0.literal 00000000  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .text         00001133  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  3 .data         00000008  00000000  00000000  00001168  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  4 .bss          00000128  00000000  00000000  00001170  2**2
                  ALLOC
  5 .rodata       000000aa  00000000  00000000  00001170  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .irom0.text   000000c2  00000000  00000000  0000121c  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  7 .comment      00000022  00000000  00000000  000012de  2**0
                  CONTENTS, READONLY
  8 .xtensa.info  00000038  00000000  00000000  00001300  2**0
                  CONTENTS, READONLY
  9 .xt.lit       000000b8  00000000  00000000  00001338  2**0
                  CONTENTS, RELOC, READONLY
 10 .xt.prop      00000be8  00000000  00000000  000013f0  2**0
                  CONTENTS, RELOC, READONLY

gdbstub-entry.o:     file format elf32-xtensa-le

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .literal      00000000  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .text         0000023f  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  2 .data         00000000  00000000  00000000  00000273  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  3 .bss          00000000  00000000  00000000  00000273  2**0
                  ALLOC
  4 .xtensa.info  00000038  00000000  00000000  00000273  2**0
                  CONTENTS, READONLY
  5 .xt.lit       00000008  00000000  00000000  000002ab  2**0
                  CONTENTS, RELOC, READONLY
  6 .xt.prop      00000144  00000000  00000000  000002b3  2**0
                  CONTENTS, RELOC, READONLY

Has anyone run up against this puzzle before?

Also posted to the forum here:

http://bbs.espressif.com/viewtopic.php?f=7&t=1424

Spritetm commented 8 years ago

What 'simple application' do you use? Do you use RTOS or non-RTOS?

Gdbstub neccesarily does use some IRAM, because the program may be interrupted or crashing when the flash isn't accessible. If your project alreasy uses a bunch of IRAM, linking in gdbstub may just tip it over the top.

nkolban commented 8 years ago

Attached is the sample file ... it is 100 lines of source. Also uploaded is the Makefile. I building with FreeRTOS.

test.txt makefile.txt