Whining noise at startup. Only five or ten seconds. Not always.
hopefully the bolts connecting engine and transmission are not loose.
It could be the starter motor not retracting fast enough.
Get your alternator checked.
Check your belt tension.
The whirr noise on start up which just just a few seconds is from the fuel system pressurizing due to a faulty fuel system check valve. After the car has sat overnight, turn the key to the ON position so that the fuel pump runs, but don't try to start the car. Let it run for few seconds, they try to start it. If it starts without the noise, it means that check valve in the fuel system in malfuntioning and allowing the fuel to drain out of the lines when the engine is not running.
the fix is to replace your timing cover with a 2013 cover
I have the same issue and apparently it's common with Hyundai. not just the elantra. a few people I know complain about the same problem and sometimes comes with a ticking sound it can last a few seconds or even a minute or two. seems to depend on temperature outside. No garage seems to be able to find the problem. Was told by Hyundai that they don't know what the problem is and can't be fixed.
Its definitely the engine oil. I changed mine recently with Castrol Magnatec 5W-30 synthetic oil rather than go to a dealer service (with some unknown oil). The noise instantly went away after being there for 3 years of dealer servicing. I think (as a mechanical engineer) that even with moderate winters experienced here in Australia that these cars still need lightweight 5W synthetic oil at start up so that oil pressure increases sufficiently rapidly to prevent the noise.