dladdr.3 (108030) | dladdr.3 (131504) |
---|---|
1.\" 2.\" Copyright (c) 1998 John D. Polstra 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" | 1.\" 2.\" Copyright (c) 1998 John D. Polstra 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24.\" SUCH DAMAGE. 25.\" |
26.\" $FreeBSD: head/lib/libc/gen/dladdr.3 108030 2002-12-18 10:13:54Z ru $ | 26.\" $FreeBSD: head/lib/libc/gen/dladdr.3 131504 2004-07-02 23:52:20Z ru $ |
27.\" 28.Dd February 5, 1998 29.Os 30.Dt DLADDR 3 31.Sh NAME 32.Nm dladdr 33.Nd find the shared object containing a given address 34.Sh LIBRARY --- 53 unchanged lines hidden (view full) --- 88.Xr rtld 1 , 89.Xr dlopen 3 90.Sh HISTORY 91The 92.Fn dladdr 93function first appeared in the Solaris operating system. 94.Sh BUGS 95This implementation is bug-compatible with the Solaris | 27.\" 28.Dd February 5, 1998 29.Os 30.Dt DLADDR 3 31.Sh NAME 32.Nm dladdr 33.Nd find the shared object containing a given address 34.Sh LIBRARY --- 53 unchanged lines hidden (view full) --- 88.Xr rtld 1 , 89.Xr dlopen 3 90.Sh HISTORY 91The 92.Fn dladdr 93function first appeared in the Solaris operating system. 94.Sh BUGS 95This implementation is bug-compatible with the Solaris |
96implementation. In particular, the following bugs are present: | 96implementation. 97In particular, the following bugs are present: |
97.Bl -bullet 98.It 99If 100.Fa addr 101lies in the main executable rather than in a shared library, the 102pathname returned in 103.Va dli_fname | 98.Bl -bullet 99.It 100If 101.Fa addr 102lies in the main executable rather than in a shared library, the 103pathname returned in 104.Va dli_fname |
104may not be correct. The pathname is taken directly from | 105may not be correct. 106The pathname is taken directly from |
105.Va argv[0] | 107.Va argv[0] |
106of the calling process. When executing a program specified by its | 108of the calling process. 109When executing a program specified by its |
107full pathname, most shells set 108.Va argv[0] | 110full pathname, most shells set 111.Va argv[0] |
109to the pathname. But this is not required of shells or guaranteed | 112to the pathname. 113But this is not required of shells or guaranteed |
110by the operating system. 111.It 112If 113.Fa addr 114is of the form 115.Va &func , 116where 117.Va func | 114by the operating system. 115.It 116If 117.Fa addr 118is of the form 119.Va &func , 120where 121.Va func |
118is a global function, its value may be an unpleasant surprise. In | 122is a global function, its value may be an unpleasant surprise. 123In |
119dynamically linked programs, the address of a global function is 120considered to point to its program linkage table entry, rather than to | 124dynamically linked programs, the address of a global function is 125considered to point to its program linkage table entry, rather than to |
121the entry point of the function itself. This causes most global | 126the entry point of the function itself. 127This causes most global |
122functions to appear to be defined within the main executable, rather 123than in the shared libraries where the actual code resides. 124.It 125Returning 0 as an indication of failure goes against long-standing 126Unix tradition. 127.El | 128functions to appear to be defined within the main executable, rather 129than in the shared libraries where the actual code resides. 130.It 131Returning 0 as an indication of failure goes against long-standing 132Unix tradition. 133.El |