Adjust the settings code so it runs before $LINK is
fully set up.