On Fri, Dec 04, 2009 at 08:03:42PM +0300, Maxim Kuvyrkov wrote:
In most valid cases NOBITS sections (.bss, usually) are placed at the
end of the loaded segments. However, if a user provides a custom linker
scripts which puts, a .bss section in the middle of the data segment,
the linker will produce a broken binary. The proper behavior for linker
is to fail with appropriate error message.
We could also treat such NOBITS sections as if they were PROGBITS.
Like the following untested patch. What do you think?
* elf.c (write_zeros): New function.
(assign_file_positions_for_load_sections): Allocate file space for
NOBITS sections that are followed by PROGBITS sections in a segment.