0% found this document useful (0 votes)
170 views1 page

Struct Link Map

The link_map struct contains information for loaded shared objects including the difference between the address in the ELF file and memory addresses, the absolute file name, a pointer to the dynamic section, and a chain of loaded objects using next and prev pointers. It is used by the debugger and dynamic linker to manage shared libraries in memory.

Uploaded by

Shashank Shekhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
170 views1 page

Struct Link Map

The link_map struct contains information for loaded shared objects including the difference between the address in the ELF file and memory addresses, the absolute file name, a pointer to the dynamic section, and a chain of loaded objects using next and prev pointers. It is used by the debugger and dynamic linker to manage shared libraries in memory.

Uploaded by

Shashank Shekhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

struct link_map

{
/* These first few members are part of the protocol with the debugger.
This is the same format used in SVR4. */

ElfW(Addr) l_addr; /* Difference between the address in the ELF


file and the addresses in memory. */
char *l_name; /* Absolute file name object was found in. */
ElfW(Dyn) *l_ld; /* Dynamic section of the shared object. */
struct link_map *l_next, *l_prev; /* Chain of loaded objects. */
......//rest of the struct
}

ElfW(Type) returns ElfW64_Type on x64 platforms


ElfW(addr) returns Elf64_addr which is uint64_t
https://elixir.bootlin.com/glibc/latest/source/elf/link.h#L30
https://man7.org/linux/man-pages/man5/elf.5.html
https://man7.org/linux/man-pages/man3/dl_iterate_phdr.3.html

ElfW(Dyn) == Elf64_Dyn which is a struct:


typedef struct
{
Elf64_Sxword d_tag;
union {
Elf64_Xword d_val;
Elf64_Addr d_ptr;
} d_un;
} Elf64_Dyn;

You might also like