Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

From where does the ldd command retrieve dependency information?

Tags:

c

linux

Kindly bare if the question is very basic. ldd command displays the dependent libraries over the executable file is what i know. In executable file, where these information is kept?.

like image 493
Whoami Avatar asked Apr 29 '26 16:04

Whoami


1 Answers

This is stored in the .dynamic section of the ELF executable. See ELF-64 Object File Format, starting on page 14 (Dynamic Tables):

Dynamically-bound object files will have a PT_DYNAMIC program header entry. This program header entry refers to a segment containing the .dynamic section, whose contents are an array of Elf64_Dyn structures.

like image 76
NPE Avatar answered May 01 '26 05:05

NPE