Skip to content

Libloader: report image info after relocation#1

Open
vilaureu wants to merge 1 commit intoL4Re:mainfrom
vilaureu:libloader-report-image-info
Open

Libloader: report image info after relocation#1
vilaureu wants to merge 1 commit intoL4Re:mainfrom
vilaureu:libloader-report-image-info

Conversation

@vilaureu
Copy link

I stumbled upon the issue that Moe, l4re_itas, and Ned seem to not send the correct base of loaded binaries via l4_debugger_add_image_info to the kernel if the binary is relocatable.
Instead, the kernel receives a base address of ~0.
The issue seems to be that all these loaders invoke the reporting function before they know the relocations, which are done in the ELF loader later on.

This commit adds a hook to the app model abstraction. This hook is called in the ELF loader after the binary is loaded to a potentially relocated address. The users of the loader library (Moe, l4re_itas, Ned) override this virtual hook to signal the binary’s image info to the debugging subsystem of the kernel.

I have not tested if this also works for loading an interpreter.
Also, none of my test cases set a base higher than 0. So, I do not know if this patch works with “actual” relocations; though, I would assume so.

This commit adds a hook to the app model abstraction. This hook is called
in the ELF loader after the binary is loaded to a potentially relocated
address. The users of the loader library (Moe, l4re_itas, Ned) override
this virtual hook to signal the binary's image info to the debugging
subsystem of the kernel.

Signed-off-by: Viktor Reusch <viktor.reusch@barkhauseninstitut.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant