Shared library in Genode must be position-independent?

Josef Söntgen josef.soentgen at ...1...
Mon Feb 29 11:28:43 CET 2016


Hello Vincent,

* Vincent Stone <shihang7422166 at ...9...> [2016-02-29 10:36:29 +0800]:
> Why does Genode disable this assembly code option? ( I can only find a
> 1-sentence explaination on Genode release notes 12.08
> <http://genode.org/documentation/release-notes/12.08>
> 
> Because libcrypto provides certain optimized assembler functions, which
> > unfortunately are not expressed with position-independent code, we removed
> > this assembler code and build libcrypto with -DOPENSSL_NO_ASM

Only specific assembler implementations for x86 were enabled when we
did the initial libcrypto port. When the port was updated to a newer
version the generated asm files did contain text relocations, which did
not work when compiling with -fpic, IIRC. Since potential performance
gains from using the asm implementation were not important I decided
to remove the files and to use the generic C implementation instead.
We never tested or used the asm implementations on other platforms,
e.g. ARM.


> I guess the loader of Genode can not handle load-time relocation for shared
> library so all shared library must be position independent. Am I right?

The dynamic loader does support load-time relocations for data but code
relocations, e.g. function calls, are not supported [1].

[1] see repos/base/src/lib/ldso/spec/*/relocation.h


Regards,
Josef




More information about the users mailing list