https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252307
--- Comment #2 from Alex S <[email protected]> --- > OTOH for malloc(3) related functions, I suspect the decision was deliberate to make it possible to interpose system implementation with any other user provided with LD_PRELOAD. Well, I tested (before filling the bug) whether this works in general and, as expected, it doesn't: % cat weak_sym_override_test2.c #include <assert.h> #include <dlfcn.h> #include <stdlib.h> #include <stdio.h> #if defined(ORIG) void __attribute__((weak)) test() { printf("original\n"); } void wrapper() { test(); } #elif defined(OVERRIDE) void test() { printf("override\n"); } #else extern void wrapper(); int main() { assert(dlopen("override.so", RTLD_NOW) != NULL); wrapper(); return 0; } #endif % cc -shared -fPIC -DORIG weak_sym_override_test2.c -o orig.so % cc -shared -fPIC -DOVERRIDE weak_sym_override_test2.c -o override.so % cc weak_sym_override_test2.c orig.so -Wl,-rpath,. -o test % ./test original Did I miss some compilation flags or something? How do I deliberately get this effect? -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ [email protected] mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "[email protected]"
