mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 08:11:08 +00:00
(do_test): Get address of ref1 using DL_LOOKUP_ADDRESS.
This commit is contained in:
parent
319a82b036
commit
131fd00f9e
@ -1,5 +1,5 @@
|
|||||||
/* Test for dladdr.
|
/* Test for dladdr.
|
||||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Volkmar Sieh <vs@caldera.de> and Andreas Jaeger <aj@suse.de>.
|
Contributed by Volkmar Sieh <vs@caldera.de> and Andreas Jaeger <aj@suse.de>.
|
||||||
|
|
||||||
@ -25,6 +25,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <ldsodefs.h>
|
||||||
|
|
||||||
|
|
||||||
#define TEST_FUNCTION do_test ()
|
#define TEST_FUNCTION do_test ()
|
||||||
extern int do_test (void);
|
extern int do_test (void);
|
||||||
@ -52,7 +54,8 @@ do_test (void)
|
|||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
error (EXIT_FAILURE, 0, "dladdr failed");
|
error (EXIT_FAILURE, 0, "dladdr failed");
|
||||||
|
|
||||||
printf ("address of ref1 = %p\n", sym);
|
printf ("address of ref1 = %lx\n",
|
||||||
|
(unsigned long int) DL_LOOKUP_ADDRESS (sym));
|
||||||
printf ("ret = %d\n", ret);
|
printf ("ret = %d\n", ret);
|
||||||
printf ("info.dli_fname = %p (\"%s\")\n", info.dli_fname, info.dli_fname);
|
printf ("info.dli_fname = %p (\"%s\")\n", info.dli_fname, info.dli_fname);
|
||||||
printf ("info.dli_fbase = %p\n", info.dli_fbase);
|
printf ("info.dli_fbase = %p\n", info.dli_fbase);
|
||||||
|
Loading…
Reference in New Issue
Block a user