Hi Tobias,

a short heads-up on your issue: A closer look at elf_load() revealed that the return value is EE_MEMORY. There is only one branch is elf_load() which returns this value and that is if the as_area_create() call fails.

The culprit is the genode.ld linker script. First, we do not allow to map the page 0, so you have to shift the starting virtual address of the output sections by at least one page. The SECTIONS section in the linker script should therefore start with:

. = 0x1000 + SIZEOF_HEADERS;

Second, the /DISCARD/ phony section should read like this:

/DISCARD/ : {
    *(*)
}

Without discarding all symbols which are not explicitly included into any other input sections the linker gets confused and it creates both the "ro" and "rw" program headers with the same starting virtual address (in other words they overlap and the elf_load() fails because it tries to map two address space areas starting from the same virtual address).

I am always puzzled whether some strange behaviour of the GNU Linker is a bug or a feature :-). I have already encountered a few of those ..

With these two modifications to the genode.ld your test applications finally load fine.


M.D.

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel

Reply via email to