6 phillip stanley-marbell
E.5 Questions
1. List the programs called by
make and state briefly what they do. You may
want to consult Chapter 4. Please state the exact names of the programs
(e.g., exactly as you would type them at the command line is the binaries
in question were already in your path) rather than any colloquial names
or pseudonyms by which the programs might informally be called.
2. By inspecting the map file (
findTheBugExample.map), determine how many
libraries are linked into the binary for findTheBugExample. State the num-
ber.
3. By inspecting the map file, how many object files within each library are
actually used?
4. Based on the contents of the map file (and not by any other method) and
based on information in Chapter
4 (especially Section 4.11), what are the
sizes (number of bytes) of the .text, .data, and .bss sections of the binary
findTheBugExample. Please state your answer in decimal.
5. By inspecting the map file, what fraction of the .text section in the final
binary is due to code that is not from findTheBugExample.c. Please state
your answer as a percentage to two decimal places.
6. Execute the commands in benchmarks/source/superh/findTheBugExample/run.m
on Sunflower. You can do this using either the load command with the
filename as an argument, or by typing in the contents of
run.m manually
to see their individual effect, or by launching
sf with the file run.m as a
command-line argument. Include a complete transcript of your actions
and the results in your submitted coursework.
After you type the final command, you will see the message Heap and
stack collision interspersed with other messages in the emulator out-
put. The emulator is still running. You can hit <ENTER> to get back to
the emulator command prompt. Describe in fewer than 150 words what
you think has happened to the emulator, to the program you are run-
ning over the emulator, or to both. What program or function printed the
text “Heap and stack collision”? You have access to the source for the
findTheBugExample program as well as the source for Sunflower so you
can verify the validity of your answer.
7. Using information from the result of the
pcbt command and information
from the map file (
findTheBugExample.map), describe what you think hap-
pened to the program.