To fill a gap between a wall and a cornice you can use Selleys No More Gaps Multipurpose. It has superior flexibility to cope with building movement, meaning the gaps and cracks will be hidden for longer.
To apply, ensure the surface is clean, dry, and free of dust. Simply apply a small bead of product along the entire gap, then using your finger or the back of a teaspoon dipped in a small amount of detergent you can wipe the residue off to leave a smooth finish. To get the neatest possible edges it is often a good idea to apply masking tape to either side so the result is nice and smooth.