CS32, Fall 2017

Lab07:
Inspecting object/load modules


Goals for this lab

By the time you have completed this lab you should be able to

Step by Step Instructions

Step 1: Choose roles, log in, and get a file

Step 2: Compile, link separately, and begin exploring the binaries

Step 3: Inspect object module names/sections with nm and objdump

The command nm lists the "names" (symbols) in an object or load module, and objdump displays various information about such files. Both commands have useful options that are worth learning.

Using objdump can reveal more details about object files. At least one option must be specified.

Step 4: Inspect executable module with readelf

Although you could use objdump to inspect this load module, the readelf tool gives more information about load modules (so called because they are ready to be loaded into memory for execution). As with objdump, at least one option must be specified.

By the way, don't just search the object and load modules for answers to these questions. Instead recall what you learned from the reading. Ask if you get stuck.

Step 5: Show off your work and get credit for the in-lab requirements

First be sure you know the answers to all of questions a through f listed at the end of Step 4. Then ...

Get your TA's attention to inspect your work, and to record completion of your in-lab work.

Now look around the lab to find out if there are other students who might need your help. If yes, first ask them if they would like you to help, and if they say "Yes" then do help guide them through their remaining lab steps - without just giving them the exact solution. When all students are either successful or are being helped by someone else, then you may leave early! But make sure that you were checked off first.

Step 5a. ONLY IF YOU RAN OUT OF TIME TO HAVE THE TA INSPECT YOUR WORK

If you must complete this assignment at CSIL, then submit it with the turnin program - but do NOT turn it in if the TA already checked you off.

First create a text file named lab07.txt, and type answers to each of the six questions at the end of Step 4 above. You MUST have both your name and your partner's name in lab07.txt in order to receive credit.

Bring up a terminal window on CSIL, and cd into the original pilot's ~/cs32/lab07 directory. Then type the following to turn in your text file:

turnin lab07@cs32 lab07.txt

Evaluation and Grading

Each pair of students must accomplish the following to earn full credit for this lab:


No after-lab work this week


Prepared by Michael Costanzo.