[libc-commits] [PATCH] D69020: Illustrate a redirector using the example of round function from math.h.

Jake Ehrlich via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Oct 28 12:06:03 PDT 2019


jakehehrlich added a comment.

I guess my question is more, whats the evidence that there isn't a way to avoid the two call overhead? The use case makes sense to me but my impression is that `__round_redirector` could be declared to have extern "C" linkage and then `llvm_libc::round` can be an alias for it. That gets rid of 1 layer of indirection. Getting rid of the next call seems more gross to me but I think some additional objcopy magic can be done to make `__round_redirector` an alias for `::round` then I think this would all link correctly, right?

We can do this for now perhaps and then we can add a feature to llvm-objcopy called `--add-symbol-alias` that would allow adding symbol aliases like this.

If we can't make `__round_redirector` live outside of `llvm_libc` and have extern "C" linkage then I suppose there's no good way but we should explain that we have that requirement


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69020/new/

https://reviews.llvm.org/D69020





More information about the libc-commits mailing list