Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHi bkucera,
> So what happens to the .BSS section when you run elf2flash? Nothing. Try objdump -h on your application elf. The .bss section is for uninitialized objects (variables). A static object that isn't initialized (doesn't have an explicit initializer) must be assigned the value 0 before main() is called. When you look at the objdump -h output, you'll see that the .bss section has only the "allocated" (ALLOC), but does not have the load attribute (LOAD) like .data or .text. The allocated attribute basically means it occupies memory; the load attribute means a loader must actually copy the elf section into the target memory. The absence of the load attribute means the loader doesn't have to copy the elf section to the target memory space. crt0.s however, clears the target memory region since the C language requires uninitialized objects to be set to zero prior to calling main(). Regards, --Scott