Program Loading - Program Loading Assuming a simple program...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Program Loading Assuming a simple program like: brastius 723 % cat hello.c #include <stdio.h> main() { printf("Hello World\n"); } brastius 724 % gcc -o hello hello.c brastius 725 % ./hello Hello World brastius 726 % Now we can examine the system calls invoked by “hello” using truss
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Truss output of “hello” brastius 728 % truss -o t.out hello Hello World brastius 729 % cat t.out execve("hello", 0xFFBEF704, 0xFFBEF70C) argc = 1 resolvepath("/usr/lib/ld.so.1", "/usr/lib/ld.so.1", 1023) = 16 open("/var/ld/ld.config", O_RDONLY) Err#2 ENOENT stat("/usr/lib/libc.so.1", 0xFFBEEFE8) = 0 resolvepath("/usr/lib/libc.so.1", "/usr/lib/libc.so.1", 1023) = 18 open("/usr/lib/libc.so.1", O_RDONLY) = 3 mmap(0x00000000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xFF390000 mmap(0x00F4BC58, 802816, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON, -1, 0) = 0xFF280000 mmap(0xFF280000, 704200, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xFF280000
Background image of page 2
Truss output of “hello” resolvepath("/usr/lib/libdl.so.1", "/usr/lib/libdl.so.1", 1023) = 19
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/30/2012 for the course CS 354 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 4

Program Loading - Program Loading Assuming a simple program...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online