Hi Marc,
> On 23 Jul 2021, at 08:30, Marc <[email protected]> wrote:
>
> Thank you so far, this got me (unsurprisingly) one step further, but
> then the external function resolve error is moved to the library loading
> stage:
>
> ~/afl++ $ g++-11 -Wl,-flat_namespace -Wl,-undefined,dynamic_lookup -g
> -fPIC -std=c++11
> -I/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/gcc/x86_64-apple-darwin20/11.1.0/plugin/include
> -I/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11/gcc/x86_64-apple-darwin20/11.1.0/plugin
> -I/usr/local//Cellar/gmp/6.2.1/include -shared
> instrumentation/afl-gcc-pass.so.cc -o afl-gcc-pass.so
>
> (on the other hand it is the same on Linux, I cannot find a library that
> actually supplies that function.
$ grep -rH opt_pass::set_pass_param gcc/*.c
gcc/passes.c:opt_pass::set_pass_param (unsigned int, bool)
it’s a virtual function with a default impl that prints:
internal_error ("pass %s needs a %<set_pass_param%> implementation "
"to handle the extra argument in %<NEXT_PASS%>", name);
so… do you have an implementation in your pass?
Otherwise are you sure that your f951 is being built with -export_dynamic ?
(I think if it was you should have seen the error above if/when you tried to
call the function - but OTOH, not at load-time, I guess)
Iain