-->
Page 1 of 1

Map option for xtensa-lx106-elf-gcc

PostPosted: Sat Mar 28, 2015 4:46 am
by Daven006
I was having problem with code space:

Code: Select allmingw32-make.exe -f "C:/Documents and Settings/Administrator/My Documents/ESP8266/Boiler/Makefile" all
c:/Espressif/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc -Lc:/Espressif/ESP8266_SDK/lib -Tc:/Espressif/ESP8266_SDK/ld/eagle.app.v6.ld -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lc -lgcc -lhal -lphy -lpp -lat -lnet80211 -llwip -lwpa -lmain -lupgrade -lssl build/app_app.a -Wl,--end-group -o build/app.out
c:/espressif/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: build/app.out section `.irom0.text' will not fit in region `irom0_0_seg'


So I tried to set the map option for the linker. It didn't like anything such as -Map=file so I tried -M

Code: Select allmingw32-make.exe -f "C:/Documents and Settings/Administrator/My Documents/ESP8266/Boiler/Makefile" all
c:/Espressif/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc -Lc:/Espressif/ESP8266_SDK/lib -Tc:/Espressif/ESP8266_SDK/ld/eagle.app.v6.ld -M -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lc -lgcc -lhal -lphy -lpp -lat -lnet80211 -llwip -lwpa -lmain -lupgrade -lssl build/app_app.a -Wl,--end-group -o build/app.out
xtensa-lx106-elf-gcc: warning: build/app_app.a: linker input file unused because linking not done


Any ideas please as I am still very much in a learning phase!

Re: Map option for xtensa-lx106-elf-gcc

PostPosted: Sat Mar 28, 2015 12:07 pm
by jcmvbkbc
Daven006 wrote:So I tried to set the map option for the linker. It didn't like anything such as -Map=file so I tried -M

Code: Select allc:/Espressif/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc -Lc:/Espressif/ESP8266_SDK/lib -Tc:/Espressif/ESP8266_SDK/ld/eagle.app.v6.ld -M

This should have been -Wl,-M as you're passing linker option to the compiler.

Re: Map option for xtensa-lx106-elf-gcc

PostPosted: Sat Mar 28, 2015 2:14 pm
by Daven006
Thank you. There are so many little details to find out & learn!

Re: Map option for xtensa-lx106-elf-gcc

PostPosted: Mon Mar 21, 2016 11:51 am
by Gigel
Try adding the following params into your project's Makefile, section LDFLAGS: -Wl,-Map,YourProject.map -Wl,--cref

To pass a linker flag, use -Wl, and the linker flags you want to pass. The "--cref" is for cross-referencing.

Example from Makefile:
# linker flags used to generate the main object file
LDFLAGS = -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,-Map,YourProject.map -Wl,--cref