Page 1 of 1

xtensa-esp32-elf-ld does not create symbols from binary file

Posted: Sun Apr 22, 2018 8:59 am
by sap1359
Hi
I am working on ESP-WROOM-32 module. I want to embedding a whole binary file ( i.e. all sections + ...) as an array.

I know this can be achieved via ld command. I test this approach and it works fine for arm processor and PC (x86_64).
with this

Code: Select all

arm-linux-gnueabihf-ld -r -b binary pproc -o pproc.dat 
I have these symbols which can be accessed from source code.

Code: Select all

0000346c D _binary_pproc_end
0000346c A _binary_pproc_size
00000000 D _binary_pproc_start
but I can not create appropriate object file with xtensa-esp32-elf-ld. when I used this approach

Code: Select all

xtensa-esp32-elf-ld -r -b binary pproc -o pproc.dat --no-relax 
output file is the same as the input and no symbol is reported via xtensa-esp32-elf-nm. :?

How can I do it?

Re: xtensa-esp32-elf-ld does not create symbols from binary file

Posted: Sun Apr 22, 2018 9:34 am
by ESP_igrr
You can use objcopy with the following arguments:
https://github.com/espressif/esp-idf/bl ... er.mk#L289

or ask the build system to do that for you:
https://docs.espressif.com/projects/esp ... inary-data

Re: xtensa-esp32-elf-ld does not create symbols from binary file

Posted: Sun Apr 22, 2018 12:09 pm
by sap1359
ESP_igrr wrote:You can use objcopy with the following arguments:
https://github.com/espressif/esp-idf/bl ... er.mk#L289

or ask the build system to do that for you:
https://docs.espressif.com/projects/esp ... inary-data
The second approach sound better. I using platformIO along with the Atom text editor. How can I feed the COMPONENT_EMBED_FILES into the PlatformIO (which itself is defined in a component.mk file)?

Thank again "ESP_igrr" in advance