fixes for bsd libelf in compiler