Heat sugar and milk until sugar is melted. Add marshmallows and bring to a boil. Remove from heat and stir in coconut, pecans, and vanilla. Spread filling between cake layers.
Icing
Mix first four ingredients and bring to a boil. Remove from heat. Add margarine and vanilla. Stir until blended. Refrigerate until very cold, and then spread icing on cake.