Expert C Programming
Executable files on UNIX are also labelled in a special way so that systems can recognize their special properties. It's a commo ...
When you run size on an executable, it tells you the size of three segments known as text, data, and bss in the file: % echo; ec ...
The BSS segment gets its name from abbreviating "Block Started by Symbol"—a pseudo-op from the old IBM 704 assembler, carried ov ...
Analyze the results of the above "Programming Challenge" to convince yourself that: the data segment is kept in the object file ...
block of this size, putting it right after the data segment. This block is zeroed out as it is put in the program's address spac ...
What the C Runtime Does with Your a.out Now we come to the fine detail of how C organizes the data structures of a running progr ...
variables local to its calling function via parameters or global pointers. The runtime maintains a pointer, often in a register ...
the stack grow by calling a function, and declaring some large local arrays. What's the address of the top of the stack now? The ...
pointer, often in a register and usually called fp, which indicates the active stack frame. This will be the stack frame nearest ...
2 if (i>0) 3 a(--i); 4 else 5 printf("i has reached zero "); 6 return; 7 } 8 9 main(){ 10 a(1); 11 } If we compile and run th ...
The Stack Frame Manually trace the flow of control in the above program, and fill in the stack frames at each call statement. F ...
auto int almond; static int hazel; instead of: register int filbert; int almond; static int hazel; A Stack Frame Might Not Be on ...
The contents of the j are destroyed when it is used in a longjmp(). Setjmp saves a copy of the program counter and the current ...
Point to watch: the only reliable way to ensure that a local variable retains the value that it had at the time of the longjmp i ...
The Stack Segment Under UNIX On UNIX, the stack grows automatically as a process needs more space. The programmer can just assum ...
manpage for each, and try running each on a couple of different a.out's—the "hello world" program, and a big program. Go through ...
Tool Where to Find It What It Does truss /usr/bin The SVr4 version of trace. This tool prints out the system calls that an execu ...
frighten an operating system. The kernel development group at Sun had one obscure bug that was very difficult to track down. The ...
IP address le0=129.144.248.36 /usr/sbin/ifconfig -a The IP address is built into the network Floating-point hardware FPU's frequ ...
like loop unrolling, in-line function expansion, common subexpression elimination, improved register allocation, omitting runtim ...
«
2
3
4
5
6
7
8
9
10
11
»
Free download pdf