heliflieger / a-culfw

Alternative culfw
Other
126 stars 64 forks source link

linker error in CUBe bootloader #26

Open mahowi opened 5 years ago

mahowi commented 5 years ago

When trying to compile the firmware for CUBe, compilation stops with a linker error at CUBe bootloader: /usr/lib/gcc/arm-none-eabi/7.3.1/../../../arm-none-eabi/bin/ld: section .ARM.exidx LMA [0011ccf0,0011ccf7] overlaps section .relocate LMA [0011ccf0,0011d25f] collect2: error: ld returned 1 exit status make[3]: *** [Makefile:125: CUBE_BL.elf] Fehler 1

Compiler version: arm-none-eabi-gcc (15:7-2018-q2-6) 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907]

spezifanta commented 3 years ago

I got the same error. I also tried using an Docker container as build environment:

git clone https://github.com/heliflieger/a-culfw.git
cd a-culfw
docker run -it --rm -v $(pwd):/code stronglytyped/arm-none-eabi-gcc

Inside the container I ran:

/code/culfw/Devices/CUBe
make

The Error:

arm-none-eabi-gcc  -L/arm-none-eabi/lib -Os -fno-isolate-erroneous-paths-dereference -o CUBE_BL.elf  
[...]
 ../../avr-uip/uip/uiplib.o -lc -lm -g -nostartfiles -Wl,--gc-sections -T"CUBE_BL_flash.lds"  -Xlinker -Map=CUBE_BL.map
/work/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: section .ARM.exidx LMA [000000000011c868,000000000011c86f] overlaps section .relocate LMA [000000000011c868,000000000011cdd7]
collect2: error: ld returned 1 exit status
Makefile:125: recipe for target 'CUBE_BL.elf' failed
make[1]: *** [CUBE_BL.elf] Error 1
make[1]: Leaving directory '/code/culfw/Devices/CUBe'
Makefile:97: recipe for target 'CUBE_BL' failed
make: *** [CUBE_BL] Error 2
Scyten commented 2 years ago

Solution but untested (according to this https://stackoverflow.com/questions/30778614/arm-none-eabi-ld-section-arm-exidx-overlaps-section-data) replace CUBE_flash.lds and CUBE_BLflash.lds with this: [CUBE.zip](https://github.com/heliflieger/a-culfw/files/9776197/CUBE_.zip) This avoids the linker error.

I have not tried this on my Max!Cube, yet!

If it works i will add a pull request!