Automatic gathering of linker dependencies