CS 5600: Computer Systems

Due Thursday September 21st by midnight

Overview

This assignment is to read data from a file using a memory mapped file and read the ELF data from the file and populate the necessary data structures, there are three projects within this assignment.


Configuring environment for this project

In order to be able to run this project there are a couple of things you need to do.


ELF Tester

ELF Tester will be used to test your project, it will need the location of your StudentELFReader from an environment variable. This program also requires the use of google test which must be installed per the above instructions. You must add the variable ELFREADER_LIB_DIR with the location of where your libStudentElfReader.a file

Also you will find that there is a file called libElfReader.a in the lib directory. This library is my implementation of the project. The tests will run my code and your code and then compare the answers.

The other thing you will notice is this is a C++ project, the header has a weird line extern "C". This tells the compiler that all functions in this bracket will be in a C library. Your library is a C library and therefore needs a different header than the ELF Reader project


Student ELF Reader

Student ELF Reader is a project where you will write your code, you are required to implement two functions getELFData and destroyELFData. The header file describes all functions and structures in helping you do the assignment.


ELF Main Check

This project only exists for the purpose of checking if you have any memory leaks, you will not writing code in this project. It will simply link to your library and call getELFData and destroyELFData. You will build this project and then run valgrind on it to note any memory leaks. You will have to add the same environment variable ELFREADER_LIB_DIR used by ELFTester. You will also have to add ELF_COMMON_INCLUDE which is the location of your Student ELF project to include the header file from your project.

You will have to install valgrind in order to use this project to test for memory leaks. Install valgrind with this command sudo apt-get install valgrind. Run valgrind with valgrind --leak-check=yes <location of executable> You can find the quick start guide valgrind here


Resources

Here are some resources to help you figure out how to complete this project.