Skip to content

rts/Linker: Fix __dso_handle handling

Ben Gamari requested to merge wip/T20493 into master

Previously the linker's handling of __dso_handle was quite wrong. Not only did we claim that __dso_handle could be NULL when statically linking (which it can not), we didn't even implement this mislead theory faithfully and instead resolved the symbol to a random pointer. This lead to the failing relocations on AArch64 noted in #20493.

Here we implement __dso_handle as a dynamic linker would do, choosing an address within the loaded object (specifically its start address) to serve as the object's handle.

I believe this should fix the AArch64 test failure seen in !6485 (closed) .

Edited by Ben Gamari

Merge request reports