He performed the pilgrimage and used to lead his companions in prayer, calling the adhan and the iqamah himself. One day he called the iqamah for prayer and then said, "Let one of you lead the prayer, for I heard the Messenger of Allah ﷺ say, 'If one of you needs to relieve himself when the iqamah is called, let him go and relieve himself.'"
حدثنا يحيى بن سعيد عن هشام بن عروة قال أخبرني أبي
أنه حج فكان يصلي بأصحابه يؤذن ويقيم فأقام يوما الصلاة وقال ليصل أحدكم فإني سمعت رسول الله ﷺ يقول إذا أراد أحدكم أن يذهب إلى الخلاء وأقيمت الصلاة فليذهب إلى الخلاء
Its chain of transmission is sahih, its narrators being well-known imams. The hadith was reported by Abu Dawud 1/22, no. 88, in the chapter on Tahara, "Should a man pray while holding back the urge to urinate," and Hakim graded it sahih 1/168, with Dhahabi agreeing with him, and by Bayhaqi 3/72.