Underwear maker Hanesbrands Inc has raised its full-year guidance as it revealed second-quarter earnings that beat analyst estimates.