Symbol not found on macOS

I am facing a linking issue on macOS. Symbol s1 works as expected, but s2 is not found, although it is in the library and can be found in a test C program.

let cf_handle = Dl.dlopen ~flags:[RTLD_LAZY]

let () =
  let s1 = Dl.dlsym ~handle:cf_handle ~symbol:"CFGetTypeID" in

  let s2 = Dl.dlsym ~handle:cf_handle ~symbol:"CFByteOrderGetCurrent" in
  (* Results in Dl.DL_error("dlsym(0xfff13356d238, CFByteOrderGetCurrent): symbol not found") *)

  Printf.eprintf "s1: %i\n" (Nativeint.to_int s1);
  Printf.eprintf "s2: %i\n" (Nativeint.to_int s2)

Any ideas why that is and how to resolve it?

Turns out the issue is not related to OCaml, nor is it macOS specific. The symbol that fails is an inline function, so it cannot be accessed with a dlsym call.