[lld][WebAssembly] Fix for weak undefined functions in -pie mode
This fixes two somewhat related issues. Firstly we were never generating imports for weak functions (even with the `import-functions` policy for undefined symbols). Adding a direct call to foo in the `weak-undefined-pic.s` exposed a crash in the linker which this change fixes. Secondly we were failing to call `handleWeakUndefines` for the `-pie` case which is PIC but doesn't set the undefined symbol policy to `import-functions`. With this change `-pie` binaries will by default call `handleWeakUndefines` which generates the undefined stub handlers for any weakly undefined symbols. Fixes: https://github.com/emscripten-core/emscripten/issues/13337 Differential Revision: https://reviews.llvm.org/D95914
Loading
Please sign in to comment