Print phdr addresses when loading
PATCH 1/1 Print phdr addresses when loading
# HG changeset patch
# User Hollis Blanchard <[email protected]> # Date 1171052336 21600
# Node ID bbbbab538b8802fde10139f0c2ae7307c1ecf812 # Parent f63c8b64840956b95a911387e1de6f76bd3dc3d5 [LIBELF] Print phdr addresses when loading.
xen/common/libelf/libelf-loader.c +2 -0
@@ -128,6 +128,8 @@ void elf_load_binary(struct elf_binary * filesz =elf_uval (elf, phdr, p_filesz); memsz =elf_uval (elf, phdr, p_memsz); dest =elf_get_ptr (elf, paddr); +elf_msg (elf,"%s: phdr %" PRIu64" at 0x%p -> 0x%p\n" , + __func__, i, dest, dest + filesz);memcpy (dest, elf->image + offset, filesz);memset (dest + filesz,0 , memsz - filesz); }
Quoted 6 lines · Hollis Blanchard
# HG changeset patch
# User Hollis Blanchard <[email protected]> # Date 1171052336 21600
# Node IDbbbbab538b8802fde10139f0c2ae7307c1ecf812# Parentf63c8b64840956b95a911387e1de6f76bd3dc3d5[LIBELF] Print phdr addresses when loading.
elf_parse_binary() prints them already ...
Why print them again?
cheers,
Gerd
Signature · 1 line
Gerd Hoffmann <[email protected]>
Quoted 10 lines · Gerd Hoffmann
Quoted 6 lines · Hollis Blanchard
# HG changeset patch
# User Hollis Blanchard <[email protected]> # Date 1171052336 21600
# Node IDbbbbab538b8802fde10139f0c2ae7307c1ecf812# Parentf63c8b64840956b95a911387e1de6f76bd3dc3d5[LIBELF] Print phdr addresses when loading.
elf_parse_binary()prints them already ...
Why print them again?
It's not just the address contained in the phdr; it's the address the phdr is being loaded at. Seeing the calculation of elf_get_ptr() is important.
Signature · 2 lines
Hollis Blanchard IBM Linux Technology Center