I'm using ChibiOS with an STM32F101x8, so I've needed to create the ld script myself. Still, the following might be useful to anyone else experiencing random segfaults.
What solved my problem was adding the following to the SECTIONS definition:
Code: Select all
.rel.plt : { . = .; } > flashI noticed that libbfd was looking for the section ".rel.plt" and was segfaulting on a NULL pointer when it couldn't find one in the hash table. My workaround is to create an "empty" entry in the hash table.
I don't know the scope of this problem, but here's the workaround in case anyone else is experiencing the same.