Only the bits of Linux which are used are linked in, same as when you link together any program. The big advantage of using Linux is driver support - you can run a UKL application on baremetal, linking to the drivers needed to run on the target hardware.