This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly][lld] Fix for static linking of PIC code
ClosedPublic

Authored by sbc100 on Oct 29 2019, 6:38 PM.

Details

Summary

When statically linking PIC code we create an internalized __memory_base
so that memory-base-relative relocation work correctly. The value of
this global should be zero, and not the globalBase since the globalBase
offset is already taken into account by getVirtualAddress.

Fixes: https://github.com/emscripten-core/emscripten/issues/9013

Diff Detail

Event Timeline

sbc100 created this revision.Oct 29 2019, 6:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 29 2019, 6:38 PM
sbc100 edited the summary of this revision. (Show Details)Oct 29 2019, 6:39 PM
sbc100 added reviewers: jgravelle-google, ruiu.
ruiu accepted this revision.Oct 29 2019, 6:43 PM

LGTM

This revision is now accepted and ready to land.Oct 29 2019, 6:43 PM
This revision was automatically updated to reflect the committed changes.