interposed.c 498 B

1234567891011121314151617181920212223
  1. /*
  2. * Copyright 2022 Yury Gribov
  3. *
  4. * The MIT License (MIT)
  5. *
  6. * Use of this source code is governed by MIT license that can be
  7. * found in the LICENSE.txt file.
  8. */
  9. #include <stdio.h>
  10. #include "interposed.h"
  11. __attribute__((visibility("default")))
  12. int foo(int x, float y) {
  13. printf("Calling foo from libtest: %d %g\n", x, y);
  14. return 0xf00;
  15. }
  16. __attribute__((visibility("default")))
  17. int bar(int x, int y, int z) {
  18. printf("Calling bar from libtest: %d %d %d\n", x, y, z);
  19. return 0xba7;
  20. }