cancel
Showing results for 
Search instead for 
Did you mean: 

Makefile export creating overlapping program headers

James Hemsing
Associate
Posted on May 29, 2017 at 07:11

I'm trying to create an ELF file to run in qemu gnuarmeclipse, and I'm getting an error when running. I know this problem is probably more one related to qemu, but it seems that the linker output is generating program segments that overlap. I've attached the verbose output of qemu. I'm just hoping that someone can help me figure out how to fix the linker file.

1 REPLY 1
James Hemsing
Associate
Posted on May 29, 2017 at 09:06

I added a new section in the MEMORY block at the top of the .ld file called HEAP that splits the RAM area in to two pieces, and then I assigned the ._user_heap_stack  section to go in this section by changing the name of the offset  ( >HEAP) after the closing brace of the section block. Now the elf compiles and runs in qemu, though I haven't made it do anything useful yet. An interesting thing to note is that the compiler does not have any issues with these overlapping sections, but QEMU does, and this makes sense for compiling on bare metal, since putting the heap in RAM is fine. Perhaps there could be a flag that splits the user heap into a different section to maintain compatibility with qemu?