On Fri, Sep 11, 2009 at 7:39 AM, Adrian Cornish <[email protected]> wrote:
> Hi All, > > Please excuse me if this is incorrect list. > > How/where should I look in kernel source to see how Linux loads binaries > and whether debug symbols are using physical RAM if they are included in > executable. > > Or is kernel smart enough to skip all debug symbols and only load needed > Text page into ram. > > I dont think theres "smarts" in there, so much as the kernel just doing what the ELF contents tell it. heres some sections from my local perl binary, which I built with -DDEBUGGING While not actually knowing, Id expect the usual dynamic linking mechanics would also pull in the debugging symbols Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .interp PROGBITS 08048134 000134 000013 00 A 0 0 1 [ 2] .note.ABI-tag NOTE 08048148 000148 000020 00 A 0 0 4 [ 3] .note.gnu.build-i NOTE 08048168 000168 000024 00 A 0 0 4 [ 4] .gnu.hash GNU_HASH 0804818c 00018c 003800 04 A 5 0 4 [ 9] .rel.dyn REL 0805e870 016870 000028 08 A 5 0 4 [10] .rel.plt REL 0805e898 016898 000768 08 A 5 12 4 [11] .init PROGBITS 0805f000 017000 000030 00 AX 0 0 4 [12] .plt PROGBITS 0805f030 017030 000ee0 04 AX 0 0 4 [13] .text PROGBITS 0805ff10 017f10 1a8afc 00 AX 0 0 16 [14] .fini PROGBITS 08208a0c 1c0a0c 00001c 00 AX 0 0 4 [15] .rodata PROGBITS 08208a40 1c0a40 08f070 00 A 0 [21] .dynamic DYNAMIC 082ac018 264018 0000f8 08 WA 6 0 4 [22] .got PROGBITS 082ac110 264110 000004 04 WA 0 0 4 [23] .got.plt PROGBITS 082ac114 264114 0003c0 04 WA 0 0 4 [24] .data PROGBITS 082ac4e0 2644e0 001594 00 WA 0 0 32 [25] .bss NOBITS 082ada80 265a74 00013c 00 WA 0 0 32 [26] .comment PROGBITS 00000000 265a74 0007e9 00 0 0 1 [27] .debug_aranges PROGBITS 00000000 26625d 0004c0 00 0 0 1 [28] .debug_pubnames PROGBITS 00000000 26671d 00a93f 00 0 0 1 [29] .debug_info PROGBITS 00000000 27105c 159666 00 0 0 1 [30] .debug_abbrev PROGBITS 00000000 3ca6c2 00a4ac 00 0 0 1 [31] .debug_line PROGBITS 00000000 3d4b6e 031374 00 0 0 1 [32] .debug_str PROGBITS 00000000 405ee2 014e54 01 MS 0 0 1 [33] .debug_loc PROGBITS 00000000 41ad36 0d3aca 00 0 0 1 [34] .debug_ranges PROGBITS 00000000 4ee800 0393a8 00 0 0 1
