Abu Hudhayfah bin Utbah bin Rabia bin Abd Shams, who was among those who fought at Badr with the Messenger of Allah ﷺ, adopted Salim and married him to his niece Hind bint Walid bin Utbah bin Rabia bin Abd Shams. Salim was the freed slave of a woman from the Ansar, just as the Messenger of Allah ﷺ had adopted Zayd. In the pre-Islamic era, whoever adopted a man, people would call the adopted man his son, and he would inherit from his estate, until Allah revealed concerning this, "Call them by the names of their fathers, that is more just in the sight of Allah. But if you do not know their fathers, then they are your brothers in religion and your freed slaves" [Ahzab 33:5]. So whoever's father was not known became a freed slave and a brother in religion. Abridged.
أخبرنا عمران بن بكار بن راشد قال حدثنا أبو اليمان قال أنبأنا شعيب عن الزهري قال أخبرني عروة بن الزبير
أن أبا حذيفة بن عتبة بن ربيعة بن عبد شمس وكان ممن شهد بدرا مع رسول الله ﷺ تبنى سالما وأنكحه ابنة أخيه هند بنت الوليد بن عتبة بن ربيعة بن عبد شمس وهو مولى لامرأة من الأنصار كما تبنى رسول الله ﷺ زيدا وكان من تبنى رجلا في الجاهلية دعاه الناس ابنه فورث من ميراثه حتى أنزل الله عز وجل في ذلك {ادعوهم لآبائهم هو أقسط عند الله فإن لم تعلموا آباءهم فإخوانكم في الدين ومواليكم} فمن لم يعلم له أب كان مولى وأخا في الدين مختصر
It was narrated by Bukhari, in the Book of Marriage, the chapter on compatibility in religion, hadith no. 5088, from Abu Yaman with the same, and it is also in Al-Kubra, hadith nos. 5331 and 5333.