dladdr for AIX 5.3


 
Thread Tools Search this Thread
Operating Systems AIX dladdr for AIX 5.3
# 1  
Old 10-12-2009
dladdr for AIX 5.3

Hi,
Am new to AIX and am trying to find a function that works similar to the function dladdr on HP-UX which takes parameter as an address and a Dl_info type.

On AIX am finding it hard to get a function that does the same job as dladdr does.

Basically what I am doing is getting an address from _builtin_return_address and then pass this as one of the parameters to dladdr and the other as a Dl_info type.

The Dl_info type has 4 elements

function name
file name
nearest object
and one more such thing (sorry since i dont use this one I dont remember it at the moment :|)
This way I am able to trace a function call (a malloc call) on HP UX.
Now there is a dl_info on aix but it does not seem to serve the same purpose.

Could some one please guide me as to how I could do the same on AIX as I have done on HP UX.

1)to find somethign similar to Dl_info(on hp ux) in AIX
2)to find somethign similar to dladdr(on hp-ux) in AIX
Thank you very much in advance Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. AIX

Samba 3.6 on AIX 7.1 - Windows 10 Access to AIX file shares using Active Directory authentication

I am running AIX 7.1 and currently we have samba 3.6.25 installed on the server. As it stands some AIX folders are shared that can be accessed by certain Windows users. The problem is that since Windows 10 the guest feature no longer works so users have to manually type in their Windows login/pwd... (14 Replies)
Discussion started by: linuxsnake
14 Replies

2. AIX

Will it affect my AIX LPAR security, when i set up email alerts on AIX server.

Hello, I've set up email alerts on AIX Servers. so that i can get email notifications (via mail relay server) when ever there is abnormal behavior. for example 1) my script monitors CPU/disk/memory etc... when it reaches high water ark, it will send an email alert. 2) disk usage alerts 3)... (5 Replies)
Discussion started by: System Admin 77
5 Replies

3. AIX

AIX How to exchange hostname and IP address between two AIX servers?

Hi all, I am trying to exchange hostname and IP address of two AIX machines. But i am confused as how to change it ? do i need to use "smitty mktcpip" or "smitty tcpip" ? what is the difference between smitty mktcpip and smitty tcpip ? Also anymore steps to follow or just updating... (3 Replies)
Discussion started by: lramsb4u
3 Replies

4. AIX

Nim on AIX 7.1 used to migrate AIX 5.3 to AIX 6.1...is possible?

Using nimadm: nimadm -j nimadmvg -c sap024 -s spot_6100 -l lpp_6100 -d "hdisk1" -Y Initializing the NIM master. Initializing NIM client sap024. 0505-205 nimadm: The level of bos.alt_disk_install.rte installed in SPOT spot_6100 (6.1.3.4) does not match the NIM master's level (7.1.1.2).... (2 Replies)
Discussion started by: sciacca75
2 Replies

5. AIX

How to upgrade AIX Firmware & TL Maintenance Level in AIX

Steps to upgrade AIX TL ( technology Level ) / Maintenance Level in AIX ( including Firmware HMC VIOS ) This article or post covers upgrades for - Hardware Management Console ( HMC ) - Firmware ( also known as microcode ) - VIO ( Virtual I/O Server = PowerVM ) - AIX Version, Technology... (2 Replies)
Discussion started by: filosophizer
2 Replies

6. AIX

AIX Printers moved to anothere AIX system

AIX Printers need to be moved to another system Guy's We have two servers old AIX 5.2 and new AIX 6.1 the old server has more than 300 printers installed with different configurations I'd like to move all the printers from the old server to the new server with fast steps it's... (1 Reply)
Discussion started by: ITHelper
1 Replies

7. AIX

IY17981 fix required for aix 4.3.3 to aix 5L migration but not found

Hi, redbook documentation is telling that IY17981 fix is required for aix 4.3.3 to aix 5L migration. But there is no mention about that fix in any ML installation packages. - My system is ML11 : oslevel –r 4330-11 - But xlC.rte is on wrong version : lslpp -L xlC.rte xlC.rte ... (3 Replies)
Discussion started by: astjen
3 Replies

8. AIX

How to apply aix 5.3 TL8 properly on ML5 aix system ?

Is it necessary to put system into single user mode for applying aix 5.3 TL8 on a aix 5.3.5.0 system ? Is the TL8 installation not totally safe ? thank you. (6 Replies)
Discussion started by: astjen
6 Replies
Login or Register to Ask a Question
DLADDR(3)						     Linux Programmer's Manual							 DLADDR(3)

NAME
dladdr, dladdr1 - translate address to symbolic information SYNOPSIS
#define _GNU_SOURCE #include <dlfcn.h> int dladdr(void *addr, Dl_info *info); int dladdr1(void *addr, Dl_info *info, void **extra_info, int flags); Link with -ldl. DESCRIPTION
The function dladdr() determines whether the address specified in addr is located in one of the shared objects loaded by the calling appli- cation. If it is, then dladdr() returns information about the shared object and symbol that overlaps addr. This information is returned in a Dl_info structure: typedef struct { const char *dli_fname; /* Pathname of shared object that contains address */ void *dli_fbase; /* Base address at which shared object is loaded */ const char *dli_sname; /* Name of symbol whose definition overlaps addr */ void *dli_saddr; /* Exact address of symbol named in dli_sname */ } Dl_info; If no symbol matching addr could be found, then dli_sname and dli_saddr are set to NULL. The function dladdr1() is like dladdr(), but returns additional information via the argument extra_info. The information returned depends on the value specified in flags, which can have one of the following values: RTLD_DL_LINKMAP Obtain a pointer to the link map for the matched file. The extra_info argument points to a pointer to a link_map structure (i.e., struct link_map **), defined in <link.h> as: struct link_map { ElfW(Addr) l_addr; /* Difference between the address in the ELF file and the address in memory */ char *l_name; /* Absolute pathname where object was found */ ElfW(Dyn) *l_ld; /* Dynamic section of the shared object */ struct link_map *l_next, *l_prev; /* Chain of loaded objects */ /* Plus additional fields private to the implementation */ }; RTLD_DL_SYMENT Obtain a pointer to the ELF symbol table entry of the matching symbol. The extra_info argument is a pointer to a symbol pointer: const ElfW(Sym) **. The ElfW() macro definition turns its argument into the name of an ELF data type suitable for the hardware architecture. For example, on a 64-bit platform, ElfW(Sym) yields the data type name Elf64_Sym, which is defined in <elf.h> as: typedef struct { Elf64_Word st_name; /* Symbol name */ unsigned char st_info; /* Symbol type and binding */ unsigned char st_other; /* Symbol visibility */ Elf64_Section st_shndx; /* Section index */ Elf64_Addr st_value; /* Symbol value */ Elf64_Xword st_size; /* Symbol size */ } Elf64_Sym; The st_name field is an index into the string table. The st_info field encodes the symbol's type and binding. The type can be extracted using the macro ELF64_ST_TYPE(st_info) (or ELF32_ST_TYPE() on 32-bit platforms), which yields one of the following values: Value Description STT_NOTYPE Symbol type is unspecified STT_OBJECT Symbol is a data object STT_FUNC Symbol is a code object STT_SECTION Symbol associated with a section STT_FILE Symbol's name is file name STT_COMMON Symbol is a common data object STT_TLS Symbol is thread-local data object STT_GNU_IFUNC Symbol is indirect code object The symbol binding can be extracted from the st_info field using the macro ELF64_ST_BIND(st_info) (or ELF32_ST_BIND() on 32-bit platforms), which yields one of the following values: Value Description STB_LOCAL Local symbol STB_GLOBAL Global symbol STB_WEAK Weak symbol STB_GNU_UNIQUE Unique symbol The st_other field contains the symbol's visibility, which can be extracted using the macro ELF64_ST_VISIBILITY(st_info) (or ELF32_ST_VISIBILITY() on 32-bit platforms), which yields one of the following values: Value Description STV_DEFAULT Default symbol visibility rules STV_INTERNAL Processor-specific hidden class STV_HIDDEN Symbol unavailable in other modules STV_PROTECTED Not preemptible, not exported RETURN VALUE
On success, these functions return a nonzero value. If the address specified in addr could be matched to a shared object, but not to a symbol in the shared object, then the info->dli_sname and info->dli_saddr fields are set to NULL. If the address specified in addr could not be matched to a shared object, then these functions return 0. In this case, an error message is not available via dlerror(3). VERSIONS
dladdr() is present in glibc 2.0 and later. dladdr1() first appeared in glibc 2.3.3. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +--------------------+---------------+---------+ |Interface | Attribute | Value | +--------------------+---------------+---------+ |dladdr(), dladdr1() | Thread safety | MT-Safe | +--------------------+---------------+---------+ CONFORMING TO
These functions are nonstandard GNU extensions that are also present on Solaris. BUGS
Sometimes, the function pointers you pass to dladdr() may surprise you. On some architectures (notably i386 and x86-64), dli_fname and dli_fbase may end up pointing back at the object from which you called dladdr(), even if the function used as an argument should come from a dynamically linked library. The problem is that the function pointer will still be resolved at compile time, but merely point to the plt (Procedure Linkage Table) sec- tion of the original object (which dispatches the call after asking the dynamic linker to resolve the symbol). To work around this, you can try to compile the code to be position-independent: then, the compiler cannot prepare the pointer at compile time any more and gcc(1) will generate code that just loads the final symbol address from the got (Global Offset Table) at run time before passing it to dladdr(). SEE ALSO
dl_iterate_phdr(3), dlinfo(3), dlopen(3), dlsym(3), ld.so(8) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2017-09-15 DLADDR(3)