You rebuked nations, You destroyed a wicked man; You erased their name forever and ever.
MIDRASH TEHILLIM
1.....(9.7) You have rebuked the nations...
That is, rebuked Amalek, of whom it is said: "Amalek was the first of the nations... (Bamidbar - Numbers 24:20)
You have destroyed the wicked that is, destroyed Esau, of whose descendants it is said: "...and they shall be called the border of wickedness..." (Malachi 1:4). For in a single day Esau did five wicked deeds, he forced a betrothed maiden, he killed a man, he denied the resurrection of the dead, he denied the root of the world, and he rejected his birthright.
When David foresaw that the wicked would oppress the righteous, he asked God - Rebuke the nations, destroy the wicked, blot out their name forever and ever.
RASHI
...You erased their name...
“...I will surely obliterate the remembrance of Amalek from beneath the heavens” (Shemot - Exodus 17:14).
RADAK
1. You have rebuked the nations (גוִֹיִם גערת):
When expression - "rebuke" without the preposition BETH, has the meaning of destruction
2. You have rebuked the nations:
– these being the Philistines. You have destroyed the wicked (man):
– viz. Goliath the Philistine.
3. You have blotted out their name:
– speaking of the dead in the war, as it is said: "...and the slain of the Philistines fell ..." (Shmuel I - I Samuel 17:52).