agnosticbin2: Add a generic function to remove target pad

Change-Id: Iffbdea4975f8e0c8a9bdd270f7bfbea54ffa4f16