You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In zlib we have some static address-taken functions that the rewriter has rewritten and generated call gates for, e.g. deflate_fast. These both get compiled into libz.so, which is then used as a dependency when linking the final binary. However, we get linker errors when we try to link the final binary:
/usr/bin/ld: libz.so.1.3.1.1-motley: undefined reference to `deflate_fast'
If I run nm libz.so | rg deflate_ I get:
0000000000018480 R deflate_copyright
U deflate_fast
U deflate_slow
U deflate_stored
0000000000005305 t __ia2_deflate_fast
00000000000053bd t __ia2_deflate_slow
0000000000005475 t __ia2_deflate_stored
So deflate_fast is showing up as an undefined reference in libz.so, even though deflate_fast is defined within that shared object.
Removing the static modifier resolves the issue, but isn't an ideal solution here. We currently are deliberately generating the callgate assembly within the same file as the function specifically so that we can directly reference the function. But for some reason this doesn't seem to be working for zlib.
The text was updated successfully, but these errors were encountered:
In zlib we have some
static
address-taken functions that the rewriter has rewritten and generated call gates for, e.g.deflate_fast
. These both get compiled intolibz.so
, which is then used as a dependency when linking the final binary. However, we get linker errors when we try to link the final binary:If I run
nm libz.so | rg deflate_
I get:So
deflate_fast
is showing up as an undefined reference inlibz.so
, even thoughdeflate_fast
is defined within that shared object.Removing the
static
modifier resolves the issue, but isn't an ideal solution here. We currently are deliberately generating the callgate assembly within the same file as the function specifically so that we can directly reference the function. But for some reason this doesn't seem to be working for zlib.The text was updated successfully, but these errors were encountered: