1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
8 extern "C" bool Zoo() {
9 printf("%s: Entering\n", __FUNCTION__
);
10 void* bar_lib
= dlopen("libbar.so", RTLD_NOW
);
12 fprintf(stderr
, "Could not libbar.so: %s\n", dlerror());
15 printf("%s: Opened libbar.so @%p\n", __FUNCTION__
, bar_lib
);
19 bar_func
= reinterpret_cast<void (*)()>(dlsym(bar_lib
, "Bar"));
21 fprintf(stderr
, "Could not find 'Bar' symbol in libbar.so\n");
24 printf("%s: Found 'Bar' symbol at @%p\n", __FUNCTION__
, bar_func
);
27 printf("%s: Calling Bar()\n", __FUNCTION__
);
30 printf("%s: Closing libbar.so\n", __FUNCTION__
);
33 printf("%s: Exiting\n", __FUNCTION__
);