
CS485G Spring 2015 34
gcc, use -fstack-protector (adds code to evidently suspi-
cious routines) or -fstack-protector-all (adds code to all
routines)
8048654: 65 a1 14 00 00 00 mov %gs:0x14,%eax
804865a: 89 45 f8 mov %eax,0xfffffff8(%ebp)
804865d: 31 c0 xor %eax,%eax
...
8048672: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
8048675: 65 33 05 14 00 00 00 xor %gs:0x14,%eax
804867c: 74 05 je 8048683 <echo+0x36>
804867e: e8 a9 fd ff ff call 804842c <FAIL>
8. Malware
(a) Worm: a program that can run by itself, propagates a fully work-
ing version to other computers.
(b) Virus: code that adds itself to other programs, but cannot run
independently.
37 Linking
1. Lecture 20, 3/13/2015
2. Basic idea: combine results of one or more independent compilations
with libraries.
3. The individual compiled results are called relocatable object files;
the Unix convention is that their names end “.o”.
4. Benefits
(a) The programmer can decompose work into small files, promot-
ing modularity.
(b) Experts (hah!) can program commonly used functions and place
them in libraries (C library, math library, ...).
(c) Changes to one file do not require recompiling the entire suite
of files.
(d) The linker can pick up only those functions that are used from
a library, so the entire library need not be part of the executable.
5. Symbol resolution
Comentários a estes Manuais