Heat the oven to 350°F and grease a 9-by-13-inch metal baking pan.
Whisk the flour, granulated sugar and salt in a large bowl.
Bring the cola, 1/2 cup butter and 1/4 cup cocoa to a boil in a saucepan, pour it over the flour mixture and whisk until smooth.
Whisk in the buttermilk, eggs, baking soda and 1 tsp vanilla until the batter is even, then pour it into the pan.
Bake until the center springs back and a tester has a few moist crumbs, 27 to 30 minutes.
During the last 5 minutes, boil the remaining 1/2 cup butter, milk and 1/4 cup cocoa for 1 minute, then remove from the heat and whisk in the powdered sugar and remaining vanilla.
Fold the pecans into the frosting, pour it over the hot cake and spread it to the corners before it sets.
Cool for at least 45 minutes before cutting into squares.