simulates the functionality of a two pass linker