Surely they wouldn't bring the entire group of 5000+ to a stop for your needs, so what would your options be?
Would you be expected to simply shit yourself in formation and keep marching? Would you be allowed to run off for a minute to relieve yourself and then rejoin the formation? Did the whole Legion take bathroom breaks every once in a while? What if a Centurion had an emergency?
From my understanding, Legions routinely marched from sun up to sundown, so surely this was a common thing that the men dealt with.
OK, let me try and answer this very specific question. The marching roman army was called "Agmen", in opposition to the "Exercitus" which was the normal parade formation and "Acies" during a battle. We have very detailed descriptions of a marching column thrugh Polibius, Caesar, Vegezio, Flavio Giuseppe and Sallust (as well as Arrian). (example: http://www.parlandosparlando.com/view.php/id_1296/lingua_0/whoisit_1) We know the Agmen was a very tight formation, every century behind a centurion and flanked by the optio. The legionaries would be at the center of the column close to the baggages, while the auxiliary cohorts tended to guard the rearguard. The optio role during the march was to keep this tight formation and to reassemble any straggler that might have left the marching column. When imagining the army in marching formation we should always consider the sheer size of the column: just one legion with its luggage train would be at least 4 km long, a whole army at least 20 km. We know that soldiers could signal to their optio to exit the column, (sometime to answer the call of nature, sometime because they were injured or sick...). Every evening when building the marching camp, the legionaries set up rudimentary toilets with running water, as any waste was thrown outside of the camp. Before striking camp, stragglers were rounded up and every centurion had the duty to keep count of any missing soldier. So we could advance that individual soldiers were allowed to relieve themselves by the road before hurrying up to catch up to their position in the column. Sources are in italian, but still very knowleadgable: a long article on every kind of toilets in the Roman world and on the camps : http://www.romanoimpero.com/2011/04/latrine-romane.html Another very interesting link in english, a study on marching Roman legionaries: velocities, energy expenditure, column formations and distances http://www.bandaarcgeophysics.co.uk/arch/Roman_legionary_marchingV2.html